fvOptions: Added volumeFractionSource and solidEquilibriumEnergySource

The volumeFractionSource represents the effect of a reduction in the
volume of the domain due to the presence of a stationary phase, most
likely a solid porous media. It only represents the dynamic effects
associated with the reduction in volume; it does not does not model
loss, drag or heat transfer. Separate models (e.g., the existing
porosity models) will be necessary to represent these effects. An
example usage, in system/fvOptions, is as follows:

    volumeFraction
    {
        type            volumeFractionSource;
        phase           solid;
        phi             phi;
        rho             rho;
        U               U;
        fields          (rho U e);
    }

The volume fraction will be read from constant/alpha.<phase>, and must
be generated in advance using setFields or a function object. Note that
the names of the flux, density (if compressible) and velocity must all
be specified. Every field for which a transport equation is solved
should also be specified in the "fields" entry.

The solidEquilibriumEnergySource adds the thermal inertia and diffusive
characteristics of a stationary solid phase to the energy equation of
the fluid, assuming that the two phases are in thermal equilibrium. An
example usage is as follows:

    solidEqulibriumEnergy
    {
        type            solidEqulibriumEnergySource;
        phase           solid;
        field           e;
    }

This will read the volume fraction in the same way as the
volumeFractionSource option. In addition, thermal properties of the
solid will be constructed from settings in
system/thermophysicalProperties.<phase>.

Two tutorials have been added, demonstrating use of these options in
both incompressible and compressible simulations. These are
incompressible/pimpleFoam/laminar/blockedChannel and
compressible/rhoPimpleFoam/laminar/blockedChannel.
This commit is contained in:
Will Bainbridge
2019-05-03 15:14:03 +01:00
parent 5203a84a0f
commit 8803a89407
37 changed files with 2456 additions and 0 deletions

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
inlet
{
type fixedValue;
value uniform 400;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T.solid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (10 0 0);
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
walls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object tracer;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase && rm -f constant/alpha.solid

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication postProcess -func generateAlphaSolid
runApplication $(getApplication)

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport const;
thermo eConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
mixture
{
specie
{
molWeight 28.9;
}
thermodynamics
{
Cv 712;
Cp 1005;
Hf 0;
}
transport
{
mu 1.8e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties.solid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
molWeight 1;
}
equationOfState
{
rho 900;
}
thermodynamics
{
Hf 0;
Cp 1900;
}
transport
{
kappa 0.5;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-05;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 -16 -1) (256 -16 -1)
(0 16 -1) (256 16 -1)
(0 -16 1) (256 -16 1)
(0 16 1) (256 16 1)
(0 -52 -1) ( 32 -52 -1) (64 -44 -1) (128 -44 -1) (224 -52 -1) (256 -52 -1)
(0 -20 -1) ( 32 -20 -1) (64 -28 -1) (128 -28 -1) (224 -20 -1) (256 -20 -1)
(0 -52 1) ( 32 -52 1) (64 -44 1) (128 -44 1) (224 -52 1) (256 -52 1)
(0 -20 1) ( 32 -20 1) (64 -28 1) (128 -28 1) (224 -20 1) (256 -20 1)
(0 -88 -1) (256 -88 -1)
(0 -56 -1) (256 -56 -1)
(0 -88 1) (256 -88 1)
(0 -56 1) (256 -56 1)
);
blocks
(
hex (0 1 3 2 4 5 7 6) (256 32 1) simpleGrading (1 1 1)
hex (8 9 15 14 20 21 27 26) (32 32 1) simpleGrading (1 1 1)
hex (9 10 16 15 21 22 28 27) (32 32 1) simpleGrading (1 1 1)
hex (10 11 17 16 22 23 29 28) (32 32 1) simpleGrading (1 1 1)
hex (11 12 18 17 23 24 30 29) (96 32 1) simpleGrading (1 1 1)
hex (12 13 19 18 24 25 31 30) (64 32 1) simpleGrading (1 1 1)
hex (32 33 35 34 36 37 39 38) (256 32 1) simpleGrading (1 1 1)
);
edges
(
);
defaultPatch
{
name frontAndBack;
type empty;
}
boundary
(
inlet
{
type patch;
faces
(
(0 2 6 4)
(8 14 26 20)
(32 34 38 36)
);
}
outlet
{
type patch;
faces
(
(1 3 7 5)
(13 19 31 25)
(33 35 39 37)
);
}
walls
{
type wall;
faces
(
(0 1 5 4)
(2 3 7 6)
(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(11 12 24 23)
(12 13 25 24)
(14 15 27 26)
(15 16 28 27)
(16 17 29 28)
(17 18 30 29)
(18 19 31 30)
(32 33 37 36)
(34 35 39 38)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.03;
deltaT 0.0001;
writeControl adjustableRunTime;
writeInterval 0.001;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 5;
functions
{
#includeFunc scalarTransport
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
rho rho;
U U;
fields (rho U e);
}
solidEqulibriumEnergy
{
type solidEqulibriumEnergySource;
phase solid;
field e;
}
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
limited cellLimited Gauss linear 1;
}
divSchemes
{
default none;
div(phi,U) Gauss linearUpwind limited;
div(phi,e) Gauss linearUpwind limited;
div(phi,tracer) Gauss linearUpwind limited;
div(phi,K) Gauss linear;
div(phiv,p) Gauss linear;
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,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"rho.*"
{
solver diagonal;
}
p
{
solver GAMG;
smoother DICGaussSeidel;
tolerance 1e-7;
relTol 0.01;
}
pFinal
{
$p;
relTol 0;
}
"(U|e|tracer)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
"(U|e|tracer)Final"
{
$U;
relTol 0;
}
}
PIMPLE
{
nNonOrthogonalCorrectors 0;
nCorrectors 2;
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
type coded;
libs ("libutilityFunctionObjects.so");
name generateAlphaSolid;
codeWrite
#{
const dimensionedVector dx(dimless/dimLength, vector(1, 0, 0));
const dimensionedVector dy(dimless/dimLength, vector(0, 1, 0));
const volScalarField x(mesh().C() & dx), y(mesh().C() & dy);
const scalar x0 = 0.032, x1 = 0.064, x2 = 0.128, x3 = 0.224;
const scalar y0 = -0.088, y1 = -0.056;
volScalarField alpha
(
IOobject
(
IOobject::groupName("alpha", "solid"),
mesh().time().constant(),
mesh()
),
mesh(),
dimless,
zeroGradientFvPatchScalarField::typeName
);
alpha =
0.5
*(
pos(x - x0)*pos(x1 - x)*(x - x0)/(x1 - x0)
+ pos(x - x1)*pos(x2 - x)
+ pos(x - x2)*pos(x3 - x)*(x3 - x)/(x3 - x2)
)
*pos(y - y0)*pos(y1 - y);
alpha.write();
#};
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Solves a transport equation for a scalar field.
The name of the scalar field is specified in this file. A sample scalar
field file, that must be initialised for the case, typically in the 0
directory, is available in $FOAM_ETC/caseDicts/solvers/scalarTransport.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/solvers/scalarTransport/scalarTransport.cfg"
field tracer;
fvOptions
{
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
rho rho;
U U;
fields (tracer);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (10 0 0);
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
walls
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
walls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object tracer;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase && rm -f constant/alpha.solid

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication postProcess -func generateAlphaSolid
runApplication $(getApplication)

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-05;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 -16 -1) (256 -16 -1)
(0 16 -1) (256 16 -1)
(0 -16 1) (256 -16 1)
(0 16 1) (256 16 1)
(0 -52 -1) ( 32 -52 -1) (64 -44 -1) (128 -44 -1) (224 -52 -1) (256 -52 -1)
(0 -20 -1) ( 32 -20 -1) (64 -28 -1) (128 -28 -1) (224 -20 -1) (256 -20 -1)
(0 -52 1) ( 32 -52 1) (64 -44 1) (128 -44 1) (224 -52 1) (256 -52 1)
(0 -20 1) ( 32 -20 1) (64 -28 1) (128 -28 1) (224 -20 1) (256 -20 1)
(0 -88 -1) (256 -88 -1)
(0 -56 -1) (256 -56 -1)
(0 -88 1) (256 -88 1)
(0 -56 1) (256 -56 1)
);
blocks
(
hex (0 1 3 2 4 5 7 6) (256 32 1) simpleGrading (1 1 1)
hex (8 9 15 14 20 21 27 26) (32 32 1) simpleGrading (1 1 1)
hex (9 10 16 15 21 22 28 27) (32 32 1) simpleGrading (1 1 1)
hex (10 11 17 16 22 23 29 28) (32 32 1) simpleGrading (1 1 1)
hex (11 12 18 17 23 24 30 29) (96 32 1) simpleGrading (1 1 1)
hex (12 13 19 18 24 25 31 30) (64 32 1) simpleGrading (1 1 1)
hex (32 33 35 34 36 37 39 38) (256 32 1) simpleGrading (1 1 1)
);
edges
(
);
defaultPatch
{
name frontAndBack;
type empty;
}
boundary
(
inlet
{
type patch;
faces
(
(0 2 6 4)
(8 14 26 20)
(32 34 38 36)
);
}
outlet
{
type patch;
faces
(
(1 3 7 5)
(13 19 31 25)
(33 35 39 37)
);
}
walls
{
type wall;
faces
(
(0 1 5 4)
(2 3 7 6)
(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(11 12 24 23)
(12 13 25 24)
(14 15 27 26)
(15 16 28 27)
(16 17 29 28)
(17 18 30 29)
(18 19 31 30)
(32 33 37 36)
(34 35 39 38)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.03;
deltaT 0.0001;
writeControl adjustableRunTime;
writeInterval 0.001;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 5;
functions
{
#includeFunc scalarTransport
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
U U;
fields (U);
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother DICGaussSeidel;
tolerance 1e-7;
relTol 0.01;
}
pFinal
{
$p;
relTol 0;
}
"(U|tracer)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
}
"(U|tracer)Final"
{
$U;
relTol 0;
}
}
PIMPLE
{
nNonOrthogonalCorrectors 0;
nCorrectors 2;
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
type coded;
libs ("libutilityFunctionObjects.so");
name generateAlphaSolid;
codeWrite
#{
const dimensionedVector dx(dimless/dimLength, vector(1, 0, 0));
const dimensionedVector dy(dimless/dimLength, vector(0, 1, 0));
const volScalarField x(mesh().C() & dx), y(mesh().C() & dy);
const scalar x0 = 0.032, x1 = 0.064, x2 = 0.128, x3 = 0.224;
const scalar y0 = -0.088, y1 = -0.056;
volScalarField alpha
(
IOobject
(
IOobject::groupName("alpha", "solid"),
mesh().time().constant(),
mesh()
),
mesh(),
dimless,
zeroGradientFvPatchScalarField::typeName
);
alpha =
0.5
*(
pos(x - x0)*pos(x1 - x)*(x - x0)/(x1 - x0)
+ pos(x - x1)*pos(x2 - x)
+ pos(x - x2)*pos(x3 - x)*(x3 - x)/(x3 - x2)
)
*pos(y - y0)*pos(y1 - y);
alpha.write();
#};
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Solves a transport equation for a scalar field.
The name of the scalar field is specified in this file. A sample scalar
field file, that must be initialised for the case, typically in the 0
directory, is available in $FOAM_ETC/caseDicts/solvers/scalarTransport.
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/solvers/scalarTransport/scalarTransport.cfg"
field tracer;
fvOptions
{
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
U U;
fields (tracer);
}
}
// ************************************************************************* //