mus_derivedQuantities_module2 Module

This module provides functions for calculating macroscopic quantities



Interfaces

public interface getEquilibrium

  • private pure function getEquilibrium_forElemfromState(state, elem, layout, varPos, nScalars, neigh) result(equil)

    Calculate the equilibrium distribution function in all directions

    The equilibrim distribution function is:\n \n where is the weight in each direction,\n is the macroscopic value of density,\n is the speed of sound,\n is the lattice unit velocity in each direction,\n is the macroscopic value of velocity.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: state(:)
    integer, intent(in) :: elem
    type(mus_scheme_layout_type), intent(in) :: layout
    integer, intent(in) :: varPos(:)
    integer, intent(in) :: nScalars
    integer, intent(in) :: neigh(:)

    Return Value real(kind=rk), (layout%fStencil%QQ)

  • public pure function getEqByDensVel(dens, vel, layout) result(equil)

    Calculate the equilibrium distribution function in all directions

    The equilibrium distribution function is:\n

    where is the weight in each direction,\n is the macroscopic value of density,\n is the speed of sound,\n is the lattice unit velocity in each direction,\n is the macroscopic value of velocity.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: dens
    real(kind=rk), intent(in) :: vel(3)
    type(mus_scheme_layout_type), intent(in) :: layout

    Return Value real(kind=rk), (layout%fStencil%QQ)

  • private pure function getEquilibrium_forPdfSubset(subset, layout, varPos) result(equil)

    Calculate the equilibrium distribution function in all directions

    The equilibrim distribution function is:\n \n where is the weight in each direction,\n is the macroscopic value of density,\n is the speed of sound,\n is the lattice unit velocity in each direction,\n is the macroscopic value of velocity.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: subset(:)
    type(mus_scheme_layout_type), intent(in) :: layout
    integer, intent(in) :: varPos(:)

    Return Value real(kind=rk), (layout%fStencil%QQ)

public interface getDensity

  • private pure function getDensity_forElemFromState(state, elem, stencil, varPos, nScalars) result(res)

    Calculate the density of a given element number with the given state vector (sum up all values)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: state(:)
    integer, intent(in) :: elem
    type(tem_stencilHeader_type), intent(in) :: stencil
    integer, intent(in) :: varPos(:)
    integer, intent(in) :: nScalars

    Return Value real(kind=rk)

  • private pure function getDensity_forPdfSubset(subset, stencil, varPos) result(res)

    Calculate the density of a given subset of pdfs vector (sum up all values)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: subset(:)
    type(tem_stencilHeader_type), intent(in) :: stencil
    integer, intent(in) :: varPos(:)

    Return Value real(kind=rk)

public interface getVelocity

  • private pure function getVelocity_forElemFromState_noForce(state, elem, stencil, varPos, nScalars) result(vel)

    Calculate the velocity in all 3 directions from the element indicated (elem), reading the pdf (state information) from the state array. state array includes all the pdfs of all elements. The access to the state array has to be done via the generic access macro IDX, as we want to access post-collision values.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: state(:)
    integer, intent(in) :: elem

    element index, for which to calc velocity

    type(tem_stencilHeader_type), intent(in) :: stencil
    integer, intent(in) :: varPos(:)
    integer, intent(in) :: nScalars

    Return Value real(kind=rk), (3)

  • private pure function getVelocity_forPdfSubset(subset, stencil, varPos) result(vel)

    Calculate the velocity in all 3 directions from a subset given, ordered according to the stencil

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: subset(:)
    type(tem_stencilHeader_type), intent(in) :: stencil
    integer, intent(in) :: varPos(:)

    Return Value real(kind=rk), (3)

public interface getVelocity_incomp

  • private pure function getVelocity_forPdfSubset_incomp(subset, stencil, varPos) result(vel)

    Calculate the velocity in all 3 directions from a subset given, ordered according to the stencil

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in) :: subset(:)
    type(tem_stencilHeader_type), intent(in) :: stencil
    integer, intent(in) :: varPos(:)

    Return Value real(kind=rk), (3)


Functions

public pure function getEqByDensVel(dens, vel, layout) result(equil)

Calculate the equilibrium distribution function in all directions

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: dens
real(kind=rk), intent(in) :: vel(3)
type(mus_scheme_layout_type), intent(in) :: layout

Return Value real(kind=rk), (layout%fStencil%QQ)

public pure function getShearRate(strain) result(shear)

Author
Jiaxing Qi

Calculate the Shear Rate

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: strain(:)

strain rate tensor: xx, yy, zz, xy, yz, zx

Return Value real(kind=rk)

public function getNEq_acoustic(layout, omega, Sxx) result(nEq)

Author
Jiaxing Qi

Setting the non-equilibrium part based on the acoustic scaling

Read more…

Arguments

Type IntentOptional Attributes Name
type(mus_scheme_layout_type), intent(in) :: layout
real(kind=rk), intent(in) :: omega
real(kind=rk), intent(in) :: Sxx(3,3)

strain rate tensor

Return Value real(kind=rk), (layout%fStencil%QQ)

public function getNEq_diffusive(layout, omega, Sxx) result(nEq)

Author
Jiaxing Qi

Calculate the non-equilibrium part of pdf from strain rate tensor based on the diffusive scaling

Read more…

Arguments

Type IntentOptional Attributes Name
type(mus_scheme_layout_type), intent(in) :: layout
real(kind=rk), intent(in) :: omega
real(kind=rk), intent(in) :: Sxx(3,3)

Strain rate tensor. It is a symmetric 3x3 matrix

Return Value real(kind=rk), (layout%fStencil%QQ)

public pure function convPrePost(omega) result(conv)

Author
Jiaxing Qi

Conversion factor betwen the pre- and post-collision quantity for the shear stress.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: omega

Return Value real(kind=rk)

public pure function getNonEqFac_intp(omegaS, omegaT) result(fac)

Calculate the conversion factor to convert nonEq moments between fine and coarser.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: omegaS
real(kind=rk), intent(in) :: omegaT

Return Value real(kind=rk)

public pure function getNonEqFac_intp_coarse_to_fine(omegaC, omegaF) result(fac)

Calculate the conversion factor to convert nonEq pdfs from coarse to fine.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: omegaC
real(kind=rk), intent(in) :: omegaF

Return Value real(kind=rk)

public pure function getNonEqFac_intp_fine_to_coarse(omegaC, omegaF) result(fac)

Calculate the conversion factor to convert nonEq pdfs from fine to coarse.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: omegaC
real(kind=rk), intent(in) :: omegaF

Return Value real(kind=rk)

public pure function getEquilibriumIncomp(dens, vel, layout, rho0) result(equil)

Calculate the equilibrium distribution function in all directions This is the incompressible formulation with reference density rho0

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: dens
real(kind=rk), intent(in) :: vel(3)
type(mus_scheme_layout_type), intent(in) :: layout
real(kind=rk), intent(in) :: rho0

Return Value real(kind=rk), (layout%fStencil%QQ)

public pure function secondMom_2D(cxcx, f, QQ) result(m)

Calculate second moments of some quantity where Q is number of discrete velocity.\n The output is 1 dimentional array which has 6 componenents.\n Specifically, This function is used by shear stress and strain rate. 1=xx, 2=yy, 3=xy

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: cxcx(6,QQ)
real(kind=rk), intent(in) :: f(QQ)

quantity to which second moment is applied

integer, intent(in) :: QQ

Return Value real(kind=rk), (3)

public pure function secondMom_3D(cxcx, f, QQ) result(m)

Calculate second moments of some quantity where Q is number of discrete velocity.\n The output is 1 dimentional array which has 6 componenents.\n Specifically, This function is used by shear stress and strain rate. 1=xx, 2=yy, 3=zz, 4=xy, 5=yz, 6=xz in 2D: 1=xx, 2=yy, 3=xy

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: cxcx(6,QQ)
real(kind=rk), intent(in) :: f(QQ)

quantity to which second moment is applied

integer, intent(in) :: QQ

Return Value real(kind=rk), (6)

public pure function secondMom_minus_cs2_2D(cxcx, f, QQ) result(m)

Calculate second moments of some quantity where Q is number of discrete velocity.\n The output is 1 dimentional array which has 6 componenents.\n Specifically, This function is used by shear stress and strain rate. 1=xx, 2=yy, 3=xy

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: cxcx(6,QQ)
real(kind=rk), intent(in) :: f(QQ)

quantity to which second moment is applied

integer, intent(in) :: QQ

Return Value real(kind=rk), (3)

public pure function secondMom_minus_cs2_3D(cxcx, f, QQ) result(m)

Calculate second moments of some quantity where Q is number of discrete velocity.\n The output is 1 dimentional array which has 6 componenents.\n Specifically, This function is used by shear stress and strain rate. 1=xx, 2=yy, 3=zz, 4=xy, 5=yz, 6=xz

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: cxcx(6,QQ)
real(kind=rk), intent(in) :: f(QQ)

quantity to which second moment is applied

integer, intent(in) :: QQ

Return Value real(kind=rk), (6)

private pure function getDensity_forPdfSubset(subset, stencil, varPos) result(res)

Calculate the density of a given subset of pdfs vector (sum up all values)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: subset(:)
type(tem_stencilHeader_type), intent(in) :: stencil
integer, intent(in) :: varPos(:)

Return Value real(kind=rk)

private pure function getDensity_forElemFromState(state, elem, stencil, varPos, nScalars) result(res)

Calculate the density of a given element number with the given state vector (sum up all values)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: state(:)
integer, intent(in) :: elem
type(tem_stencilHeader_type), intent(in) :: stencil
integer, intent(in) :: varPos(:)
integer, intent(in) :: nScalars

Return Value real(kind=rk)

private pure function getVelocity_forPdfSubset(subset, stencil, varPos) result(vel)

Calculate the velocity in all 3 directions from a subset given, ordered according to the stencil

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: subset(:)
type(tem_stencilHeader_type), intent(in) :: stencil
integer, intent(in) :: varPos(:)

Return Value real(kind=rk), (3)

private pure function getVelocity_forPdfSubset_incomp(subset, stencil, varPos) result(vel)

Calculate the velocity in all 3 directions from a subset given, ordered according to the stencil

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: subset(:)
type(tem_stencilHeader_type), intent(in) :: stencil
integer, intent(in) :: varPos(:)

Return Value real(kind=rk), (3)

private pure function getVelocity_forElemFromState_noForce(state, elem, stencil, varPos, nScalars) result(vel)

Calculate the velocity in all 3 directions from the element indicated (elem), reading the pdf (state information) from the state array. state array includes all the pdfs of all elements. The access to the state array has to be done via the generic access macro IDX, as we want to access post-collision values.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: state(:)
integer, intent(in) :: elem

element index, for which to calc velocity

type(tem_stencilHeader_type), intent(in) :: stencil
integer, intent(in) :: varPos(:)
integer, intent(in) :: nScalars

Return Value real(kind=rk), (3)

private pure function getEquilibrium_forPdfSubset(subset, layout, varPos) result(equil)

Calculate the equilibrium distribution function in all directions

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: subset(:)
type(mus_scheme_layout_type), intent(in) :: layout
integer, intent(in) :: varPos(:)

Return Value real(kind=rk), (layout%fStencil%QQ)

private pure function getEquilibrium_forElemfromState(state, elem, layout, varPos, nScalars, neigh) result(equil)

Calculate the equilibrium distribution function in all directions

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: state(:)
integer, intent(in) :: elem
type(mus_scheme_layout_type), intent(in) :: layout
integer, intent(in) :: varPos(:)
integer, intent(in) :: nScalars
integer, intent(in) :: neigh(:)

Return Value real(kind=rk), (layout%fStencil%QQ)