Non-Newtonian Models in OpenFOAM, Implementation a non-Newtonian - - PowerPoint PPT Presentation

β–Ά
non newtonian models in openfoam
SMART_READER_LITE
LIVE PREVIEW

Non-Newtonian Models in OpenFOAM, Implementation a non-Newtonian - - PowerPoint PPT Presentation

Non-Newtonian Models in OpenFOAM, Implementation a non-Newtonian model Naser Hamedi Energy Sciences Department, Fluid Mechanics Division, Lund University Contents Non-Newtonian fluids Non-Newtonian models in OpenFOAM TransportModels


slide-1
SLIDE 1

Non-Newtonian Models in OpenFOAM, Implementation a non-Newtonian model

Naser Hamedi Energy Sciences Department, Fluid Mechanics Division, Lund University

slide-2
SLIDE 2

Contents

  • Non-Newtonian fluids
  • Non-Newtonian models in OpenFOAM
  • TransportModels in OpenFOAM
  • Casson model
  • Shear rate
  • Non-Newtonian solvers
  • Adding Casson model to OpenFOAM
  • Run the channel flow case
slide-3
SLIDE 3

Non-Newtonian fluid

  • . In Newtonian fluids, the strain shear rate is linearly

dependent to shear stress with a constant coefficient which is called viscosity. 𝜐 = 𝜈 𝛿

  • Fluids in which shear stress is not directly

proportional to deformation rate are non-Newtonian flow.

  • Examples: Toothpaste and paint.
slide-4
SLIDE 4

Non-newtonian curves

Chhabra, R. P. and Richardson, J. F., Non-Newtonian flow in the process industries: Fundamentals and engineering Applications. Butterworth-Heinemann, Oxford, (1999).

slide-5
SLIDE 5

Non-Newtonian models in OpenFOAM

Non-Newtonian Model Mathematical Eq. Coefficient

powerLaw

πœƒ = 𝐿 π›Ώπ‘œβˆ’1 K: Consistency index 𝛿: Shear rate n: power law index

CrossPwerLaw

πœƒ =

πœƒ0βˆ’πœƒπ‘—π‘œπ‘” 1+ 𝑛 𝛿 π‘œ+πœƒπ‘—π‘œπ‘”

m: time constant πœƒ0: lower bound viscosity πœƒπ‘—π‘œπ‘”: upper bound viscosity 𝛿: Shear rate

HerschelBulckley

πœƒ = πœπ‘§ + 𝑙 𝛿 π‘œβˆ’1 πœπ‘§: yield stress 𝑙: time constant 𝛿: Shear strain rate

BirdCarrea

πœƒ = πœƒπ‘—π‘œπ‘” + πœƒ0 βˆ’ πœƒπ‘—π‘œπ‘” 1 + 𝑙 𝛿 π‘œβˆ’1 k: time constant πœƒ0: lower bound viscosity πœƒπ‘—π‘œπ‘”: upper bound viscosity 𝛿: Shear rate

viscosityModel in OpenFOAM is a defined as an abstract class (powerLaw, HerschelBuckley, etc).

slide-6
SLIDE 6

TransportModels in OpenFOAM

  • The transport model library in OpenFOAM is classified into two

base classes, transport models and viscosity models.

  • The role of the transport models is not transporting the
  • properties. On the other words, the viscosity is made accessible

by transport models.

  • There are two implementations of transport model classes,

singlePhaseTransportModel and incompressibleTwoPhaseMixer.

  • All of the single phase solvers in OpenFOAM uses

singlePhaseTransportModel to calculate the viscosity nu().

  • additional data stored by incompressibleTwoPhaseMixer
slide-7
SLIDE 7

Casson model

  • Many models have been developed to describe the blood
  • viscosity. The Casson model is the most widely used

model to model the human blood:

  • πœƒ =

πœπ‘§ 𝛿 +

𝑛

  • Ξ· is the viscosity, Ο„y is yield stress,

𝛿 is shear strain rate (1/s) and m is consistency index.

slide-8
SLIDE 8

Strain rate

  • The shear strain rate (strainRate()) is a member

function in viscosityModel class which is defined in viscosityModel.C:

Foam::tmp<Foam::volScalarField> Foam::viscosityModel::strainRate() const { return sqrt(2.0)*mag(symm(fvc::grad(U_))); }

slide-9
SLIDE 9

Non-Newtonian solvers in OpenFOAM

SimpleFoam

Steady state solver for incompressible, turbulent flow of non- Newtonian fluid

nonNewtonianIcoFoam

Transient solver for incompressible, laminar flow of non-Newtonian fluid

PISOFoam

Transient solver for incompressible, turbulent flow of non-Newtonian fluid

slide-10
SLIDE 10

nonNewtonianicoFoam

  • The only difference between icoFoam and nonNewtonianIcoFoam

is the fluid (an object) which is defined in nonNewtonianIcoFoam to access to all member functions and member data of singlephaseTransportModel.

  • Fluid is defined in createField.H.

fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U)

  • fvm::laplacian(fluid.nu(), U)

); solve(UEqn == -fvc::grad(p))

slide-11
SLIDE 11

Adding Casson model-1

  • The viscosity models are located in:

$FOAM_SRC/transportModels/incompressible/viscosityModels

  • To make a new viscosity model, first we make copy a viscosity model e.g. BirdCarrea model in a directory that we create

in the OpenFOAM installation: cd $WM_PROJECT_DIR cp -r --parents \ src/transportModels/incompressible/viscosityModels/BirdCarreau/ \ $WM_PROJECT_USER_DIR/ cd $WM_PROJECT_USER_DIR/src/transportModels/incompressible/viscosityModels mv BirdCarreau Casson cd Casson mv BirdCarreau.C Casson.C mv BirdCarreau.H Casson.H sed -i s/BirdCarreau/Casson/g Casson.C sed –i s/BirdCarreau/Casson/g Casson.H

slide-12
SLIDE 12

Adding Casson model-2

  • We also need Make/files and Make/options:

mkdir Make

  • Create Make/files and add Casson model to it:

Casson.C LIB = $(FOAM_USER_LIBBIN)/libCasson

  • Create Make/options:

EXE_INC = \

  • I$(LIB_SRC)/transportModels/incompressible/lnInclude \
  • I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \

  • lfiniteVolume
slide-13
SLIDE 13

Adding Casson model-2

  • In Casson.C to define the viscosity function:

return max ( nuMin_, min ( nuMax_, pow ( pow( tau0_/max ( strainRate(), dimensionedScalar("VSMALL", dimless/dimTime, VSMALL) ),0.5 ) +pow(m_,0.5) , scalar(2.0) ) ) );

πœƒ =

πœπ‘§ 𝛿 +

𝑛

  • The key note to define the Casson non-Newtonian model is defining the values in which the model

function shows singularity.

  • We have to define some values for the viscosity in very high value (as nuMax) and very low value (as

nuMin).

slide-14
SLIDE 14

Adding Casson model-3

  • In Casson.C to define the constructors:

m_(CassonCoeffs_.lookup("m")), tau0_(CassonCoeffs_.lookup("tau0")), nuMin_(CassonCoeffs_.lookup("nuMin")), nuMax_(CassonCoeffs_.lookup("nuMax")),

CassonCoeffs_.lookup("m") >> m_; CassonCoeffs_.lookup("tau0") >> tau0_; CassonCoeffs_.lookup("nuMin") >> nuMin_; CassonCoeffs_.lookup("nuMax") >> nuMax_;

  • In Casson.C to define the member functions:
  • In Casson.H in class Casson decleration:

dimensionedScalar m_; dimensionedScalar tau0_; dimensionedScalar nuMin_; dimensionedScalar nuMax_;

  • To compile: wmake libso
slide-15
SLIDE 15

Run the 2D-channel flow case

  • Channel 50Γ—1Γ—0.1 (m3)
  • Long enough channel length to have fully-developed velocity profile
  • The discretized domain was created in ANSYS ICEM and exported with .msh extension.
  • To export in OpenFOAM:

fluentMeshtoFoam fluent.msh

Name of the file

slide-16
SLIDE 16

0/p

FoamFile { version 2.0; format ascii; class volScalarField;

  • bject p;

} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type zeroGradient; } OUTLET { type fixedValue; value uniform 0; } FIXED_WALLS { type zeroGradient; } FRONT_AND_BACK { type empty; } } // **************************************** ********************************* //

slide-17
SLIDE 17

0/U

dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET { type fixedValue; value uniform (1 0 0); } OUTLET { type zeroGradient; } FIXED_WALLS { type fixedValue; value uniform (0 0 0); } FRONT_AND_BACK { type empty; } }

slide-18
SLIDE 18

Run the 2D-channel flow case

  • In constant/transportProperties we add:

transportModel Casson; . . . . CassonCoeffs { m m [ 0 2 -1 0 0 0 0 ] 0.00414; tau0 tau0 [0 2 -2 0 0 0 0] 0.0038; nuMin nuMin [0 2 -1 0 0 0 0] 0.0001; nuMax nuMax [0 2 -1 0 0 0 0] 100; }

slide-19
SLIDE 19

Run the 2D-channel flow case

  • In system/controlDict:

application nonNewtonianIcoFoam;

. . . .

libs ( "libCasson.so" );

  • And finally:

nonNewtonianIcoFoam

slide-20
SLIDE 20

Results

INLET

slide-21
SLIDE 21

Naser Hamedi

Email: naser.hamedi@energy.lth.se