ENH: adding generalizedNewtonian to laminar turbulence model

The generalizedNewtonian viscocity models were ported from
the org version and added to the laminar turbulence framework.

This allows use in compressible and incompressible solvers
through the turbulence dictionary under the laminar sub-dictionary.

The thermal laminar viscosity is taken from the thermo for solvers
that use thermo library or from the transportProperties dictionary
for incompressible solvers.

At the moment the option to include viscocity models through the
transportDict is still available.

The icoTabulated equation of state was ported from the org version.

STYLE: use 'model' instead of 'laminarModel' in tutorials
This commit is contained in:
sergio
2020-07-27 12:38:26 -07:00
committed by Andrew Heather
parent a89ecdeee0
commit c3c4f30a55
60 changed files with 3835 additions and 59 deletions

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
}
"(?i).*walls"
{
type fixedValue;
value uniform 350;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type flowRateInletVelocity;
massFlowRate constant 5;
rhoInlet 1000; // Guess for rho
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type noSlip;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"(?i).*walls"
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 200;
boundaryField
{
inlet
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type kqRWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"(?i).*walls"
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
"(?i).*walls"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
properties liquid;
energy sensibleInternalEnergy;
}
mixture
{
H2O;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
laminar
{
model generalizedNewtonian;
viscosityModel powerLaw;
nuMin 1e-03;
nuMax 1;
k 0.02;
n 0.4;
}
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
// OpenFOAM dictionary -*- C++ -*-
abort
{
type abort;
libs (utilityFunctionObjects);
file "<case>/ABORT"; // Instead of default name
// action writeNow; // If we want to see immediate results
// Or use default (nextWrite) and force with
// "action=writeNow" in the trigger file
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.001;
zmin -25;
zmax 25;
vertices
(
// front-plane:
// inlet region
( -50 25 $zmax) // pt 0
( 0 25 $zmax) // pt 1
( -50 75 $zmax) // pt 2
( 0 75 $zmax) // pt 3
// outlet region
( -500 -75 $zmax) // pt 4
( 0 -75 $zmax) // pt 5
( -500 -25 $zmax) // pt 6
( 0 -25 $zmax) // pt 7
// bend mid-points
( 25 0 $zmax) // pt 8
( 75 0 $zmax) // pt 9
// back-plane:
// inlet region
( -50 25 $zmin) // pt 0 + 10
( 0 25 $zmin) // pt 1 + 10
( -50 75 $zmin) // pt 2 + 10
( 0 75 $zmin) // pt 3 + 10
// outlet region
( -500 -75 $zmin) // pt 4 + 10
( 0 -75 $zmin) // pt 5 + 10
( -500 -25 $zmin) // pt 7 + 10
( 0 -25 $zmin) // pt 8 + 10
// bend mid-points
( 25 0 $zmin) // pt 8 + 10
( 75 0 $zmin) // pt 9 + 10
);
blocks
(
hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1)
hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1)
hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1)
hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1)
);
edges
(
// block 2
arc 1 8 origin (0 0 $zmax)
arc 3 9 origin (0 0 $zmax)
arc 11 18 origin (0 0 $zmin)
arc 13 19 origin (0 0 $zmin)
// block 3
arc 7 8 origin (0 0 $zmax)
arc 5 9 origin (0 0 $zmax)
arc 17 18 origin (0 0 $zmin)
arc 15 19 origin (0 0 $zmin)
);
boundary
(
inlet
{
type patch;
faces
(
(0 2 12 10)
);
}
outlet
{
type patch;
faces
(
(4 6 16 14)
);
}
);
mergePatchPairs
(
);
// The defaultFaces == outside "walls"
defaultPatch
{
name walls;
type wall;
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable true;
functions
{
#include "abort"
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method hierarchical;
simpleCoeffs
{
n (8 1 1);
}
hierarchicalCoeffs
{
n (4 2 1);
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
limited cellLimited Gauss linear 1;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind limited;
div(phi,e) bounded Gauss linearUpwind limited;
div(phi,epsilon) bounded Gauss linearUpwind limited;
div(phi,k) bounded Gauss linearUpwind limited;
div(phi,Ekp) bounded Gauss linearUpwind limited;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
tolerance 1e-7;
relTol 0.1;
}
"(U|e|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-7;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 1.5;
transonic no;
consistent no;
residualControl
{
p 1e-4;
U 1e-4;
"(k|omega|epsilon|e|h)" 1e-3;
}
}
relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
e 0.7;
k 0.7;
epsilon 0.7;
}
}
// ************************************************************************* //

View File

@ -18,15 +18,11 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
printCoeffs on;
MaxwellCoeffs
{
nuM 0.002;
lambda 0.03;
}
printCoeffs on;
nuM 0.002;
lambda 0.03;
}
// ************************************************************************* //

View File

@ -18,15 +18,14 @@ simulationType laminar;
laminar
{
laminarModel LAMINAR_MODEL;
model LAMINAR_MODEL;
printCoeffs on;
MaxwellCoeffs
{
nuM 1;
lambda 5;
nuM 1;
lambda 5;
}
printCoeffs on;
}
// ************************************************************************* //

View File

@ -19,10 +19,10 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
nuM 0.01476;
lambda 0.018225;
nuM 0.01476;
lambda 0.018225;
}

View File

@ -19,10 +19,10 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
nuM 0.01476;
lambda 0.018225;
nuM 0.01476;
lambda 0.018225;
}