mus_nonNewtonian_module Module

This module keeps all information about the nonNewtonian models. Contains routines which calculates non-Newtonian kinematic viscosity according to non-Newtonian model.

It supports three non-Newtonian models: Power law, Carrear Yasuda and Casson. All these models are described in Ashrafizaadeh, M., & Bakhshaei, H. (2009). A comparison of non-Newtonian models for lattice Boltzmann blood flow simulations. Computers and Mathematics with Applications, 58(5), 1045–1054.

For further information about the theory visit the non-newtonian theory page.


Uses

  • module~~mus_nonnewtonian_module~~UsesGraph module~mus_nonnewtonian_module mus_nonNewtonian_module module~mus_scheme_header_module mus_scheme_header_module module~mus_nonnewtonian_module->module~mus_scheme_header_module module~aot_table_module aot_table_module module~mus_nonnewtonian_module->module~aot_table_module module~tem_param_module tem_param_module module~mus_nonnewtonian_module->module~tem_param_module module~aotus_module aotus_module module~mus_nonnewtonian_module->module~aotus_module module~mus_scheme_layout_module mus_scheme_layout_module module~mus_nonnewtonian_module->module~mus_scheme_layout_module module~mus_physics_module mus_physics_module module~mus_nonnewtonian_module->module~mus_physics_module module~tem_tools_module tem_tools_module module~mus_nonnewtonian_module->module~tem_tools_module module~tem_logging_module tem_logging_module module~mus_nonnewtonian_module->module~tem_logging_module module~aot_out_module aot_out_module module~mus_nonnewtonian_module->module~aot_out_module module~env_module env_module module~mus_nonnewtonian_module->module~env_module module~tem_aux_module tem_aux_module module~mus_nonnewtonian_module->module~tem_aux_module module~mus_scheme_header_module->module~aot_table_module module~mus_scheme_header_module->module~aotus_module module~mus_scheme_header_module->module~tem_tools_module module~mus_scheme_header_module->module~tem_logging_module module~mus_scheme_header_module->module~aot_out_module module~mus_scheme_header_module->module~env_module module~mus_scheme_header_module->module~tem_aux_module module~mus_scheme_layout_module->module~aot_table_module module~mus_scheme_layout_module->module~tem_param_module module~mus_scheme_layout_module->module~aotus_module module~mus_scheme_layout_module->module~tem_tools_module module~mus_scheme_layout_module->module~tem_logging_module module~mus_scheme_layout_module->module~aot_out_module module~mus_scheme_layout_module->module~env_module module~mus_scheme_layout_module->module~tem_aux_module module~tem_stencil_module tem_stencil_module module~mus_scheme_layout_module->module~tem_stencil_module module~tem_comm_env_module tem_comm_env_module module~mus_scheme_layout_module->module~tem_comm_env_module mpi mpi module~mus_scheme_layout_module->mpi module~mus_moments_type_module mus_moments_type_module module~mus_scheme_layout_module->module~mus_moments_type_module module~tem_grow_array_module tem_grow_array_module module~mus_scheme_layout_module->module~tem_grow_array_module module~tem_dyn_array_module tem_dyn_array_module module~mus_scheme_layout_module->module~tem_dyn_array_module module~mus_physics_module->module~aot_table_module module~mus_physics_module->module~aotus_module module~mus_physics_module->module~tem_tools_module module~mus_physics_module->module~tem_logging_module module~mus_physics_module->module~aot_out_module module~mus_physics_module->module~env_module module~mus_physics_module->module~tem_aux_module module~treelmesh_module treelmesh_module module~mus_physics_module->module~treelmesh_module module~tem_geometry_module tem_geometry_module module~mus_physics_module->module~tem_geometry_module module~mus_moments_type_module->module~env_module module~tem_matrix_module tem_matrix_module module~mus_moments_type_module->module~tem_matrix_module

Used by

  • module~~mus_nonnewtonian_module~~UsedByGraph module~mus_nonnewtonian_module mus_nonNewtonian_module module~mus_relaxationparam_module mus_relaxationParam_module module~mus_relaxationparam_module->module~mus_nonnewtonian_module module~mus_fluid_module mus_fluid_module module~mus_fluid_module->module~mus_nonnewtonian_module module~mus_fluid_module->module~mus_relaxationparam_module module~mus_aux_module mus_aux_module module~mus_aux_module->module~mus_relaxationparam_module module~mus_aux_module->module~mus_fluid_module module~mus_interpolate_quadratic_module mus_interpolate_quadratic_module module~mus_interpolate_quadratic_module->module~mus_relaxationparam_module module~mus_interpolate_quadratic_module->module~mus_fluid_module module~mus_interpolate_d3q27_module mus_interpolate_d3q27_module module~mus_interpolate_d3q27_module->module~mus_fluid_module module~mus_interpolate_d2q9_module mus_interpolate_d2q9_module module~mus_interpolate_d2q9_module->module~mus_fluid_module module~mus_interpolate_average_module mus_interpolate_average_module module~mus_interpolate_average_module->module~mus_relaxationparam_module module~mus_interpolate_average_module->module~mus_fluid_module module~mus_field_module mus_field_module module~mus_field_module->module~mus_fluid_module module~mus_interpolate_compact_module mus_interpolate_compact_module module~mus_interpolate_compact_module->module~mus_fluid_module module~mus_interpolate_debug_module mus_interpolate_debug_module module~mus_interpolate_debug_module->module~mus_fluid_module module~mus_dynloadbal_module mus_dynLoadBal_module module~mus_dynloadbal_module->module~mus_fluid_module module~mus_tools_module mus_tools_module module~mus_tools_module->module~mus_relaxationparam_module module~mus_interpolate_d3q19_module mus_interpolate_d3q19_module module~mus_interpolate_d3q19_module->module~mus_fluid_module module~mus_flow_module mus_flow_module module~mus_flow_module->module~mus_fluid_module module~mus_hvs_aux_module mus_hvs_aux_module module~mus_hvs_aux_module->module~mus_fluid_module module~mus_field_prop_module mus_field_prop_module module~mus_field_prop_module->module~mus_fluid_module module~mus_interpolate_linear_module mus_interpolate_linear_module module~mus_interpolate_linear_module->module~mus_relaxationparam_module module~mus_interpolate_linear_module->module~mus_fluid_module

Contents


Variables

TypeVisibilityAttributesNameInitial
integer, public, parameter:: powerLaw =1

Identifier for Power-Law model

integer, public, parameter:: casson =2

Identifier for Casson model

integer, public, parameter:: carreauYasuda =3

Identifier for Carreau-Yasuda model


Abstract Interfaces

abstract interface

Interface to calculate kinematic viscosity for non-Newtonian model. Viscosity is computed from shear rate which is computed from strain rate which is computed from nonEquilibrium PDF which in turn is computed from pre-collision PDF

  • private subroutine proc_calc_nNwtn_visc_fromPreColPDF(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

    Arguments

    TypeIntentOptionalAttributesName
    class(mus_nNwtn_type), intent(in) :: nNwtn

    contains non-Newtonian model parameters loaded from config file

    real(kind=rk), intent(inout) :: viscKine(:)

    output: kinematic viscosity from non-Netonian model

    real(kind=rk), intent(in) :: omega(:)

    Kinematic viscosity omega from last timestep

    real(kind=rk), intent(in) :: state(:)

    state array

    integer, intent(in) :: neigh(:)

    neigh array to obtain precollision pdf

    real(kind=rk), intent(in) :: auxField(:)

    Auxiliary field variable array

    integer, intent(in) :: densPos

    position of density in auxField

    integer, intent(in) :: velPos(3)

    position of velocity components in auxField

    integer, intent(in) :: nSize

    number of elements in state array

    integer, intent(in) :: nSolve

    Number of element to solve in this level

    integer, intent(in) :: nScalars

    number of scalars in state array

    integer, intent(in) :: nAuxScalars

    number of scalars in auxField array

    type(mus_scheme_layout_type), intent(in) :: layout

    scheme layout

    type(mus_convertFac_type), intent(in) :: convFac

    conversion factor to convert lattice to physical units


Derived Types

type, public :: mus_nNwtn_type

The nonNewtonian fluid feature description type

Read more…

Components

TypeVisibilityAttributesNameInitial
logical, private :: active =.false.

Indicator whether nonNewtonian feature is active maybe not useful. schemeHeader%kind can used to check if nNwtn is active

character(len=labellen), private :: label

nonNewtonian fluid model label

integer, private :: model

nonNewtonian fluid model identifier

type(mus_nNwtn_PL_type), private :: PL

Power Law (PL) model type

type(mus_nNwtn_CY_type), private :: CY

Carreau-Yasuda (CY) model type

type(mus_nNwtn_CS_type), private :: CS

Casson model type

procedure(proc_calc_nNwtn_visc_fromPreColPDF), private, pointer:: calcVisc=> null()

this procedure compute kinematic viscosity in lattice unit on current level from preCollision PDF based on non-Newtonian model. It uses shear-rate to compute viscosity. Non-newtonian model is given in dynamic viscosity in physical unit so it is dimensionalized using viscDyna in physics%fac and lattice kinematic viscosity = lattice dynamic viscosity / rho (local density) for compressible model and lattice kinematic viscosity = lattice dynamic viscosity / rho0 for incompressible model.

type, private :: mus_nNwtn_PL_type

The nonNewtonian power law model parameter

Read more…

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: n =0.5_rk

exponentiation parameter

real(kind=rk), private :: visc0 =0.0035_rk

Unit consistency index. Dynamic viscosity parameter when shear rate equals to 1. i.e. backgroud viscosity for power-law model

real(kind=rk), private :: nMinus1

parameter for computation

type, private :: mus_nNwtn_CY_type

The nonNewtonian power law model parameter

Read more…

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: n =0.2128_rk

model parameter

real(kind=rk), private :: a =0.64_rk

model parameter

real(kind=rk), private :: lambda =8.2_rk

model parameter

real(kind=rk), private :: visc0 =0.16_rk

model parameter, dynamic viscosity at zero shear-rate

real(kind=rk), private :: viscInf =0.0035_rk

model parameter, dynamic viscosity in infinity shear-rate

real(kind=rk), private :: nMinus1Div_a =(0.2128_rk-1._rk)/0.64_rk

calculated parameter for later usage, nMinus1Div_a = (n-1)/a

type, private :: mus_nNwtn_CS_type

The nonNewtonian power law model parameter

Read more…

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: k0 =0.1937_rk

model parameter

real(kind=rk), private :: k1 =0.055_rk

model parameter


Functions

private function viscPhy_PL(me, shearRate)

nonNewtonian power-law model

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(in) :: me

nonNewtonian parameters

real(kind=rk), intent(in) :: shearRate

Return Value real(kind=rk)

private function viscPhy_CS(me, shearRate)

nonNewtonian Casson model

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(in) :: me

nonNewtonian parameters

real(kind=rk), intent(in) :: shearRate

Return Value real(kind=rk)

private function viscPhy_CY(me, shearRate)

nonNewtonian Carreau-Yasuda model

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(in) :: me

nonNewtonian parameters

real(kind=rk), intent(in) :: shearRate

Return Value real(kind=rk)


Subroutines

public subroutine mus_nNwtn_load(me, conf, parent)

Read in the nonNewtonian table from Lua file and dump parameters to logUnit Specificly, this routine calls each model parameter loader.

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(out) :: me

nonNewtonian type

type(flu_state), intent(inout) :: conf

lua state

integer, intent(in), optional :: parent

parent handle

public subroutine mus_nNwtn_save2lua(me, conf)

write nonNewtonian fluid parameters into a lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(in) :: me

nonNewtonian parameters

type(aot_out_type) :: conf

public subroutine mus_nNwtn_dump2outUnit(me, outUnit)

Dump nonNewtonian fluid parameters to outUnit

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(in) :: me

nonNewtonian parameters

integer, intent(in) :: outUnit

public subroutine mus_assign_nNwtnVisc_ptr(nNwtn, schemeHeader)

This routine assigns function pointer to compute non-Newtonian viscosity

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_type), intent(inout) :: nNwtn

non-Newtonian type

type(mus_scheme_header_type), intent(in) :: schemeHeader

scheme header

public subroutine calcVisc_CY(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian Carreau-Yasuda model. $\mu = \mu_\inf + (\mu_0-\mu_\inf)(1+(\lambdashearRate)a)^((n-1)/a)$

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units

private subroutine mus_nNwtn_PL_load(me, conf, tHandle)

Read in the nonNewtonian Power Law (PL) model parameters from Lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_PL_type), intent(out) :: me

nonNewtonian type

type(flu_state), intent(inout) :: conf

lua state

integer, intent(inout) :: tHandle

nonNewtonian table handle

private subroutine mus_nNwtn_CY_load(me, conf, tHandle)

Read in the nonNewtonian Carreau-Yasuda (CY) model parameters from Lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CY_type), intent(out) :: me

nonNewtonian type

type(flu_state), intent(inout) :: conf

lua state

integer, intent(inout) :: tHandle

nonNewtonian table handle

private subroutine mus_nNwtn_CS_load(me, conf, tHandle)

Read in the nonNewtonian Casson model parameters from Lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CS_type), intent(out) :: me

nonNewtonian type

type(flu_state), intent(inout) :: conf

lua state

integer, intent(inout) :: tHandle

nonNewtonian table handle

private subroutine mus_nNwtn_PL_save(me, conf)

write nonNewtonian Power Law (PL) parameters into a lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_PL_type), intent(in) :: me

nonNewtonian parameters

type(aot_out_type) :: conf

private subroutine mus_nNwtn_CY_save(me, conf)

write nonNewtonian (CY) parameters into a lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CY_type), intent(in) :: me

nonNewtonian parameters

type(aot_out_type) :: conf

private subroutine mus_nNwtn_CS_save(me, conf)

write nonNewtonian Casson parameters into a lua file

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CS_type), intent(in) :: me

nonNewtonian parameters

type(aot_out_type) :: conf

private subroutine mus_nNwtn_PL_dump(me, outUnit)

Dump nonNewtonian Power Law (PL) parameters to outUnit

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_PL_type), intent(in) :: me

nonNewtonian parameters

integer, intent(in) :: outUnit

private subroutine mus_nNwtn_CY_dump(me, outUnit)

Dump nonNewtonian (CY) parameters to outUnit

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CY_type), intent(in) :: me

nonNewtonian parameters

integer, intent(in) :: outUnit

private subroutine mus_nNwtn_CS_dump(me, outUnit)

Dump nonNewtonian (CY) parameters to outUnit

Arguments

TypeIntentOptionalAttributesName
type(mus_nNwtn_CS_type), intent(in) :: me

nonNewtonian parameters

integer, intent(in) :: outUnit

private subroutine calcVisc_PL(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian power-law model. $\mu = K shearRate^(n-1)$. Shear rate is computed from strain rate which is computed from nonEquilibrium PDF which in turn computed from pre-collision PDF

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units

private subroutine calcVisc_CS(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian Casson model. $\mu = (k0 + k1 * sqrt(shearRate))^2/shearRate$

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units

private subroutine calcVisc_incomp_PL(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian power-law model for incompressible model $\mu = K shearRate^(n-1)$

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units

private subroutine calcVisc_incomp_CS(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian Casson model for incompressible model. $\mu = (k0 + k1 * sqrt(shearRate))^2/shearRate$

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units

private subroutine calcVisc_incomp_CY(nNwtn, viscKine, omega, state, neigh, auxField, densPos, velPos, nSize, nSolve, nScalars, nAuxScalars, layout, convFac)

Calculate kinematic viscosity from nonNewtonian Carreau-Yasuda model for incompressible model. $\mu = \mu_\inf + (\mu_0-\mu_\inf)(1+(\lambdashearRate)a)^((n-1)/a)$

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_nNwtn_type), intent(in) :: nNwtn

contains non-Newtonian model parameters loaded from config file

real(kind=rk), intent(inout) :: viscKine(:)

non-Netonian model

real(kind=rk), intent(in) :: omega(:)

Kinematic viscosity omega from last timestep

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neigh array to obtain precollision pdf

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

integer, intent(in) :: densPos

position of density in auxField

integer, intent(in) :: velPos(3)

position of velocity components in auxField

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nSolve

Number of element to solve in this level

integer, intent(in) :: nScalars

number of scalars in state array

integer, intent(in) :: nAuxScalars

number of scalars in auxField array

type(mus_scheme_layout_type), intent(in) :: layout

scheme layout

type(mus_convertFac_type), intent(in) :: convFac

conversion factor to convert lattice to physical units