ENH: Adding features for phase change solvers

1) Adding interfaceHeight FO
2) Adding interfaceHeatResistance mass transfer model to
   interCondensatingEvaporatingFoam with spread source approach
3) Reworking framework for icoReactingMultiphaseInterFoam
This commit is contained in:
sergio
2020-02-04 13:14:04 -08:00
committed by Mattijs Janssens
parent 2ee9315532
commit 499933dbab
85 changed files with 6616 additions and 548 deletions

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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 373.15;
boundaryField
{
sideWalls
{
type zeroGradient;
}
faceWall
{
type fixedValue;
value uniform 378.15;
}
outlet
{
type inletOutlet;
inletValue uniform 373.15;
value uniform 373.15;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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
{
sideWalls
{
type slip;
value uniform (0 0 0);
}
faceWall
{
type noSlip;
}
frontAndBack
{
type empty;
}
outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
".*"
{
type zeroGradient;
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
".*"
{
type zeroGradient;
}
outlet
{
type inletOutlet;
inletValue uniform 1;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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
{
sideWalls
{
type fixedFluxPressure;
}
faceWall
{
type fixedFluxPressure;
}
outlet
{
//type fixedValue;
type totalPressure;
rho rho;
p0 uniform 1e5;
value uniform 1e5;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
sideWalls
{
type fixedFluxPressure;
}
faceWall
{
type fixedFluxPressure;
}
outlet
{
//type fixedValue;
type totalPressure;
rho rho;
p0 uniform 1e5;
value uniform 1e5;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf 0
rm positionClean.dat
rm OF_vs_Exact.eps
#------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
restore0Dir
cp -r 0 1.36
cp system/setAlphaFieldDict.liquid system/setAlphaFieldDict
runApplication setAlphaField
rm log.setAlphaField
cp system/setAlphaFieldDict.gas system/setAlphaFieldDict
runApplication setAlphaField
#runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 0);
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object phaseChangeProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type massTransferMultiphaseSystem;
phases (liquid gas);
liquid
{
type pureMovingPhaseModel;
}
gas
{
type pureMovingPhaseModel;
}
surfaceTension
(
(gas and liquid)
{
type constant;
sigma 0.0;
}
);
massTransferModel
(
(liquid to gas)
{
type Lee;
C 1700;
Tactivate 373.25;
}
);
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
// ************************************************************************* //
mixture
{
specie
{
nMoles 1;
molWeight 18.9;
}
equationOfState
{
rho 0.581;
}
thermodynamics
{
Hf 0;//-1.338e7; //[J/kg]
Cp 2030;
}
transport
{
mu 0.9e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 18.9;
}
equationOfState
{
rho 958.4;
}
thermodynamics
{
Cp 4216;
Hf 2.26e6;//-1.5833e7;//deltaHv 2.45e6; //[J/Kg]
}
transport
{
mu 959e-6;
Pr 6.62;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (liquid vapour); // FC-72
liquid
{
transportModel Newtonian;
nu 1e-6;
rho 958.4;
Cp 4216; // irrelevant
Cv 4216; // irrelevant
kappa 0.671; // irrelevant
hf 0;
}
vapour
{
transportModel Newtonian;
nu 1e-5; // irrelevant
rho 0.581;
Cp 2030; // FC72 vapour
Cv 2030; // Cv = Cp - R/w
kappa 0.025; // FC72 vapour // 0.01;
hf 2260.0e3;
}
sigma 0;
Prt 0.7;
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,25 @@
createGraphs()
{
OF=$1
EXPT=$2
gnuplot<<EOF
set terminal postscript default
set output "OF_vs_Exact.eps"
set xlabel "t [sec]"
set ylabel "x [mm]"
set grid
plot \
"$EXPT" u 1:2 title "Exact", \
"$OF" u 1:2 title "OpenFOAM" with line lt -1 lw 1
EOF
}
sed -e 's/[()]//g' "postProcessing/interfaceHeight1/1.36/position.dat" > "positionClean.dat"
OF="positionClean.dat"
EXPT="data.dat"
createGraphs $OF $EXPT

View File

@ -0,0 +1,63 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 0 -0.0)
(10 0 -0.0)
(10 0.2 -0.0)
(0 0.2 -0.0)
(0 0 0.02)
(10 0 0.02)
(10 0.2 0.02)
(0 0.2 0.02)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (400 2 1)
simpleGrading (1 1 1)
);
patches
(
/* wall sideWalls
(
(1 5 4 0)
(3 7 6 2)
)*/
wall faceWall
(
(0 4 7 3)
)
patch outlet
(
(2 6 5 1)
)
empty frontAndBack
(
(0 3 2 1)
(4 5 6 7)
(1 5 4 0)
(3 7 6 2)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoReactingMultiphaseInterFoam;
startFrom startTime;
startTime 1.36;
stopAt endTime;
endTime 40;
deltaT 1e-5;
writeControl adjustableRunTime;
writeInterval 4;
purgeWrite 0;
writeFormat ascii;
writePrecision 12;
writeCompression off;
timeFormat general;
timePrecision 10;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.01;
maxAlphaCo 0.01;
maxAlphaDdt 0.01;
functions
{
interfaceHeight1
{
type interfaceHeight;
libs ("libfieldFunctionObjects.so");
alpha alpha.liquid;
locations ((0 0 0));
direction (1 0 0);
writeControl timeStep;
writeInterval 3;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwind grad(U);
"div\(phi,alpha.*\)" Gauss vanLeer;
"div\(phir,alpha.*\)" Gauss linear;
"div\(phi,.*\.gas.*\)" Gauss vanLeer;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(phi,T) Gauss vanLeer;
div(rhoPhi,epsilon) Gauss upwind;
div(rhoPhi,k) Gauss upwind;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
"alpha.*";
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.*"
{
nAlphaCorr 1;
nAlphaSubCycles 1;
cAlphas ((liquid and gas) 0.1);
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
}
rho
{
solver diagonal;
tolerance 1e-7;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-7;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-9;
relTol 0.001;
smoother DIC;
}
mDotSmearFinal
{
solver PCG;
tolerance 1e-6;
preconditioner DIC;
relTol 0.00;
smoother DIC;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-9;
relTol 0;
minIter 10;
}
pcorrFinal
{
$p_rgh;
tolerance 1e-9;
relTol 0;
}
"(U|h|T.*|k|epsilon|R)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0.01;
}
"(U|h|T.*|k|epsilon|R)Final"
{
$U;
tolerance 1e-8;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
nCorrectors 4;
nOuterCorrectors 1;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system/fluid";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field "alpha.gas";
type plane;
origin (0.503e-3 0 0);
direction (1 0 0);
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system/fluid";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field "alpha.gas";
type plane;
origin (0.503e-3 0 0);
direction (1 0 0);
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system/fluid";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field "alpha.liquid";
type plane;
origin (0.503e-3 0 0);
direction (-1 0 0);
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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 373.15;
boundaryField
{
sideWalls
{
type zeroGradient;
}
faceWall
{
type fixedValue;
value uniform 378.15;
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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
{
sideWalls
{
type slip;
value uniform (0 0 0);
}
faceWall
{
type noSlip;
}
frontAndBack
{
type empty;
}
outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
".*"
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: 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
{
sideWalls
{
type fixedFluxPressure;
}
faceWall
{
type fixedFluxPressure;
}
outlet
{
//type fixedValue;
type totalPressure;
rho rho;
p0 uniform 1e5;
value uniform 1e5;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
sideWalls
{
type fixedFluxPressure;
}
faceWall
{
type fixedFluxPressure;
}
outlet
{
//type fixedValue;
type totalPressure;
rho rho;
p0 uniform 1e5;
value uniform 1e5;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf 0
rm positionClean.dat
rm OF_vs_Exact.eps
#------------------------------------------------------------------------------

View File

@ -0,0 +1,14 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
restore0Dir
cp -r 0 1.36
runApplication setAlphaField
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 0);
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object phaseChangeProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phaseChangeTwoPhaseModel constant;//interfaceHeatResistance;
R 1e6;
maxAlphaRate 1;
spread 3;
coeffC 0;
coeffE 500;
// interfacePhaseChangeCoeffs
// {
// R_ 1e6;
// }
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
TSat TSat [0 0 0 1 0] 373.15; // saturation temperature
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (liquid vapour); // FC-72
liquid
{
transportModel Newtonian;
nu 1e-6;
rho 958.4;
Cp 4216; // irrelevant
Cv 4216; // irrelevant
kappa 0.671; // irrelevant
hf 0;
}
vapour
{
transportModel Newtonian;
nu 1e-5; // irrelevant
rho 0.581;
Cp 2030; // FC72 vapour
Cv 2030; // Cv = Cp - R/w
kappa 0.025; // FC72 vapour // 0.01;
hf 2260.0e3;
}
sigma 0;
Prt 0.7;
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,25 @@
createGraphs()
{
OF=$1
EXPT=$2
gnuplot<<EOF
set terminal postscript default
set output "OF_vs_Exact.eps"
set xlabel "t [sec]"
set ylabel "x [mm]"
set grid
plot \
"$EXPT" u 1:2 title "Exact", \
"$OF" u 1:2 title "OpenFOAM" with line lt -1 lw 1
EOF
}
sed -e 's/[()]//g' "postProcessing/interfaceHeight1/1.36/position.dat" > "positionClean.dat"
OF="positionClean.dat"
EXPT="data.dat"
createGraphs $OF $EXPT

View File

@ -0,0 +1,63 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 0 -0.0)
(10 0 -0.0)
(10 0.2 -0.0)
(0 0.2 -0.0)
(0 0 0.02)
(10 0 0.02)
(10 0.2 0.02)
(0 0.2 0.02)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (400 2 1)
simpleGrading (1 1 1)
);
patches
(
/* wall sideWalls
(
(1 5 4 0)
(3 7 6 2)
)*/
wall faceWall
(
(0 4 7 3)
)
patch outlet
(
(2 6 5 1)
)
empty frontAndBack
(
(0 3 2 1)
(4 5 6 7)
(1 5 4 0)
(3 7 6 2)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interCondensatingEvaporatingFoam;
startFrom startTime;
startTime 1.36;
stopAt endTime;
endTime 5;
deltaT 1e-5;
writeControl adjustableRunTime;
writeInterval 0.5;
purgeWrite 0;
writeFormat ascii;
writePrecision 12;
writeCompression off;
timeFormat general;
timePrecision 10;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.01;
maxAlphaCo 0.01;
maxDeltaT 0.01;
functions
{
interfaceHeight1
{
type interfaceHeight;
libs ("libfieldFunctionObjects.so");
alpha alpha.liquid;
locations ((0 0 0));
direction (1 0 0);
writeControl timeStep;
writeInterval 3;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(rhoPhi,U) Gauss vanLeerV;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(rhoCpPhi,T) Gauss vanLeer;
div((interpolate(cp)*rhoPhi),T) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
p_rgh;
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
alpha.liquid
{
nAlphaCorr 2;
nAlphaSubCycles 2;
cAlpha 1;
MULESCorr no;
nLimiterIter 5;
//solver smoothSolver;
//smoother symGaussSeidel;
//tolerance 1e-8;
//relTol 0;
}
rho
{
solver diagonal;
tolerance 1e-7;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-7;
relTol 0;
}
p_rgh
{
//solver GAMG;
tolerance 1e-9;
solver PCG;
preconditioner DIC;
relTol 0.001;
smoother DIC;
}
mDotSmearFinal
{
solver PCG;
tolerance 1e-6;
preconditioner DIC;
relTol 0.00;
smoother DIC;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-9;
relTol 0;
minIter 10;
}
pcorrFinal
{
$p_rgh;
tolerance 1e-9;
relTol 0;
}
"(U|h|T.*|k|epsilon|R)"
{
solver smoothSolver; //PBiCGStab;
smoother symGaussSeidel;
//preconditioner DILU;
tolerance 1e-7;
relTol 0.;
minIter 15;
maxIter 50;
}
"(U|h|T.*|k|epsilon|R)Final"
{
$U;
tolerance 1e-7;
relTol 0;
maxIter 50;
}
}
PIMPLE
{
momentumPredictor yes;
nCorrectors 4;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system/fluid";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field "alpha.liquid";
type plane;
origin (0.503e-3 0 0);
direction (-1 0 0);
// ************************************************************************* //