diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/C3H8O.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/C3H8O.liquid new file mode 100644 index 0000000000..602bee04eb --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/C3H8O.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 C3H8O.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.5; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/H2O.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/H2O.liquid new file mode 100644 index 0000000000..3b210d67ef --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/H2O.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 H2O.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.5; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.gas new file mode 100644 index 0000000000..2924b40d23 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.liquid new file mode 100644 index 0000000000..280052a619 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/T.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.gas new file mode 100644 index 0000000000..14489b22f6 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.liquid new file mode 100644 index 0000000000..3bcfca0321 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/U.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + location "0"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.gas new file mode 100644 index 0000000000..16d6f4975c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 Ydefault.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.liquid new file mode 100644 index 0000000000..dd77419fc8 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/Ydefault.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 Ydefault.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/air.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/air.gas new file mode 100644 index 0000000000..f98c8f6e7c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/air.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 air.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.gas new file mode 100644 index 0000000000..07cf7d1611 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.99; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.liquid new file mode 100644 index 0000000000..d60223deec --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/alpha.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p new file mode 100644 index 0000000000..8742fb3a25 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p_rgh b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p_rgh new file mode 100644 index 0000000000..49f2c42836 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/0/p_rgh @@ -0,0 +1,24 @@ +/*--------------------------------*- 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_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allclean b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allclean new file mode 100755 index 0000000000..4290f2ef6b --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +cd ${0%/*} || exit 1 + +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase && rm -rf postProcessing_* postProcessing.eps diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun new file mode 100755 index 0000000000..8d344a7838 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/Allrun @@ -0,0 +1,141 @@ +#!/bin/sh + +cd ${0%/*} || exit 1 + +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +gYs="air.gas H2O.gas C3H8O.gas none.gas" +lYs="H2O.liquid C3H8O.liquid none.liquid" + +runApplication blockMesh + +setInertY() +{ + y=${1%.*} + phase=${1#*.} + [ $y != "none" ] && arg="-set $y" || arg="-remove" + foamDictionary -entry inertSpecie $arg constant/thermophysicalProperties.$phase +} + +for gY in $gYs +do + setInertY $gY + for lY in $lYs + do + setInertY $lY + runApplication -s ${gY}_${lY} $(getApplication) + mv postProcessing postProcessing_${gY}_$lY + done +done + +gnuplot << EOF + +set terminal eps enhanced size 5.83,8.27 +set output 'postProcessing.eps' + +set lmargin at screen 0.15 +set rmargin at screen 0.84 + +gYs = '$gYs' +lYs = '$lYs' + +gY0 = word(gYs, 1) +lY0 = word(lYs, 1) + +set multiplot layout 6,1 + +set xlabel "Time (s)" + +set ytics nomirror +set y2tics +set ylabel 'Gas volume fraction' +set y2label 'Liquid volume fraction' + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/alpha.gas' w l lc 1 t 'Gas', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/alpha.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/alpha.liquid' w l axes x1y2 lc 2 t 'Liquid', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/alpha.liquid' w l axes x1y2 lc 2 notitle + +set ytics mirror +unset y2tics +set ylabel 'Temperature (K)' +unset y2label + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/T.gas' w l lc 1 t 'Gas', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/T.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/T.liquid' w l lc 2 t 'Liquid', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/T.liquid' w l lc 2 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/Tf.gasAndLiquid' w l lc 3 t 'Interface', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/Tf.gasAndLiquid' w l lc 3 notitle + +set ytics nomirror +set y2tics +set ylabel "Vapour mass fraction" +set y2label "Air mass fraction" + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/H2O.gas' w l lc 1 t 'H2O', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/H2O.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/C3H8O.gas' w l lc 2 t 'C3H8O', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/C3H8O.gas' w l lc 2 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/air.gas' w l axes x1y2 lc 3 t 'Air', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/air.gas' w l axes x1y2 lc 3 notitle + +set ytics mirror +unset y2tics +set ylabel "Liquid mass fraction" +unset y2label + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/H2O.liquid' w l lc 1 t 'H2O', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/H2O.liquid' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/C3H8O.liquid' w l lc 2 t 'C3H8O', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/C3H8O.liquid' w l lc 2 notitle + +set ytics nomirror +set y2tics +set ylabel "Mass (kg/m^3)" +set y2label "Energy (J/m^3)" + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dMass.gas' w l lc 1 t 'Gas Mass Change', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dMass.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dMass.liquid' w l lc 2 t 'Liquid Mass Change', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dMass.liquid' w l lc 2 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dEnergy.gas' w l axes x1y2 lc 3 t 'Gas Energy Change', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dEnergy.gas' w l axes x1y2 lc 3 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dEnergy.liquid' w l axes x1y2 lc 4 t 'Liquid Energy Change', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dEnergy.liquid' w l axes x1y2 lc 4 notitle + +set ytics nomirror +set y2tics +set ylabel "Mass (kg/m^3)" +set y2label "Energy (J/m^3)" + +plot \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dMass' w l lc 1 t 'Mass Error', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dMass' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.lY0.'/plot/0/dEnergy' w l axes x1y2 lc 2 t 'Energy Error', \ + for [gY in gYs] for [lY in lYs] \ + 'postProcessing_'.gY.'_'.lY.'/plot/0/dEnergy' w l axes x1y2 lc 2 notitle + +unset multiplot + +EOF diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/g b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/g new file mode 100644 index 0000000000..716851f8f2 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 0); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.gas new file mode 100644 index 0000000000..a33e17a274 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.gas @@ -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 momentumTransport.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.liquid new file mode 100644 index 0000000000..4b970b8c2e --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/momentumTransport.liquid @@ -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 momentumTransport.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/phaseProperties b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/phaseProperties new file mode 100644 index 0000000000..a04b5fda03 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/phaseProperties @@ -0,0 +1,193 @@ +/*--------------------------------*- 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 phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type interfaceCompositionPhaseChangeMultiphaseSystem; + +phases (gas liquid); + +nInterfaceCorrectors 1; + +gas +{ + type multiComponentPhaseModel; + diameterModel constant; + d 1e-3; + residualAlpha 1e-6; + Sct 0.7; +} + +liquid +{ + type multiComponentPhaseModel; + diameterModel constant; + d 5e-4; + residualAlpha 1e-6; + Sct 1; +} + +blending +{ + default + { + type none; + continuousPhase gas; + } +} + +surfaceTension +( + (gas and liquid) + { + type constant; + sigma 0.07; + } +); + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } + + (liquid in gas) + { + type constant; + E0 1.0; + } +); + +drag +( +); + +virtualMass +( +); + +interfaceComposition.gas +( + (gas and liquid) + { + type nonRandomTwoLiquid; + species (H2O C3H8O); + Le 1.0; + H2O + { + alpha 0.3; + beta 0.0; + interaction + { + type Antoine; + A 6.8284; + B -1283.46; + C 0; + } + type saturated; + species (H2O); + Le 1.0; + saturationPressure + { + type ArdenBuck; + } + } + C3H8O + { + alpha 0.3; + beta 0.0; + interaction + { + type Antoine; + A -1.3115; + B 426.398; + C 0; + } + type saturated; + species (C3H8O); + Le 1.0; + saturationPressure + { + type Antoine; + A 22.7057916; + B -3125.59117503; + C -75.814; + } + } + } +); + +interfaceComposition.liquid +( +); + +heatTransfer.gas +( + (liquid in gas) + { + type RanzMarshall; + residualAlpha 1e-4; + } +); + +heatTransfer.liquid +( + (liquid in gas) + { + type spherical; + residualAlpha 1e-4; + } +); + +diffusiveMassTransfer.gas +( + (liquid in gas) + { + type Frossling; + Le 1.0; + } +); + +diffusiveMassTransfer.liquid +( + (liquid in gas) + { + type spherical; + Le 1.0; + } +); + +phaseTransfer +( +); + +lift +( +); + +wallLubrication +( +); + +turbulentDispersion +( +); + +// Minimum allowable pressure +pMin 10000; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.gas.orig b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.gas.orig new file mode 100644 index 0000000000..6e29af11df --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.gas.orig @@ -0,0 +1,101 @@ +/*--------------------------------*- 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.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture multiComponentMixture; + transport sutherland; + thermo janaf; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +species +( + air + H2O + C3H8O +); + +inertSpecie air; + +air +{ + specie + { + molWeight 28.9596; + } + thermodynamics + { + Tlow 200; + Thigh 3500; + Tcommon 1000; + highCpCoeffs ( 3.57304 -7.24383e-04 1.67022e-06 -1.26501e-10 -4.20580e-13 -1047.41 3.12431 ); + lowCpCoeffs ( 3.09589 1.22835e-03 -4.14267e-07 6.56910e-11 -3.87021e-15 -983.191 5.34161 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +H2O +{ + specie + { + molWeight 18.0153; + } + thermodynamics + { + Tlow 200; + Thigh 3500; + Tcommon 1000; + highCpCoeffs ( 3.03399 0.00217692 -1.64073e-07 -9.7042e-11 1.68201e-14 -30004.3 4.96677 ); + lowCpCoeffs ( 4.19864 -0.00203643 6.5204e-06 -5.48797e-09 1.77198e-12 -30293.7 -0.849032 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +C3H8O +{ + specie + { + molWeight 60.09661; + } + thermodynamics + { + Tlow 200; + Thigh 6000; + Tcommon 1000; + highCpCoeffs ( 8.52377 0.0210371 -7.48398e-06 1.19959e-09 -7.14873e-14 -35070.2 -17.7857 ); + lowCpCoeffs ( 5.41878 -0.000575566 8.51215e-05 -1.1106e-07 4.43007e-11 -32836.8 5.29974 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.liquid.orig b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.liquid.orig new file mode 100644 index 0000000000..6d4662efda --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/constant/thermophysicalProperties.liquid.orig @@ -0,0 +1,81 @@ +/*--------------------------------*- 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.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture multiComponentMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +species +( + H2O + C3H8O +); + +inertSpecie H2O; + +H2O +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1027; + } + thermodynamics + { + Hf -1.5879e+07; + Cv 4195; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + +C3H8O +{ + specie + { + molWeight 60.09661; + } + equationOfState + { + rho 786; + } + thermodynamics + { + Hf -5.303e+06; + Cv 2680; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/blockMeshDict b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/blockMeshDict new file mode 100644 index 0000000000..1d0fd1a105 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/blockMeshDict @@ -0,0 +1,55 @@ +/*--------------------------------*- 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 1; + +vertices +( + (-1 -1 -1) + (1 -1 -1) + (1 1 -1) + (-1 1 -1) + + (-1 -1 1) + (1 -1 1) + (1 1 1) + (-1 1 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1) +); + +edges +( +); + +defaultPatch +{ + name defaultPatch; + type empty; +} + +patches +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/continuity b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/continuity new file mode 100644 index 0000000000..77edd3514d --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/continuity @@ -0,0 +1,145 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +libs ("libutilityFunctionObjects.so"); + +type coded; + +writeControl timeStep; +writeInterval 1; + +name continuity; + +codeOptions +#{ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude +#}; + +codeInclude +#{ + #include "rhoThermo.H" + + namespace Foam + { + tmp ea(const rhoThermo& thermo) + { + tmp tEa = thermo.he() + thermo.hc(); + + if (thermo.he().name() == thermo.phasePropertyName("h")) + { + tEa.ref() -= thermo.p()/thermo.rho(); + } + + return tEa; + } + } +#}; + +codeRead +#{ + volScalarField* dMass = + new volScalarField + ( + IOobject("dMass", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimMass/dimVolume, 0) + ); + volScalarField* dMassGas = new volScalarField("dMass.gas", *dMass); + volScalarField* mass0Gas = new volScalarField("mass0.gas", *dMass); + volScalarField* dMassLiq = new volScalarField("dMass.liquid", *dMass); + volScalarField* mass0Liq = new volScalarField("mass0.liquid", *dMass); + volScalarField* dEnergy = + new volScalarField + ( + IOobject("dEnergy", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimEnergy/dimVolume, 0) + ); + volScalarField* dEnergyLiq = new volScalarField("dEnergy.liquid", *dEnergy); + volScalarField* energy0Liq = new volScalarField("energy0.liquid", *dEnergy); + volScalarField* dEnergyGas = new volScalarField("dEnergy.gas", *dEnergy); + volScalarField* energy0Gas = new volScalarField("energy0.gas", *dEnergy); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.gas"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.liquid"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.gas"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.liquid"); + + *mass0Gas = alphaGas*thermoGas.rho(); + *mass0Liq = alphaLiq*thermoLiq.rho(); + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + *energy0Gas = alphaGas*thermoGas.rho()*ea(thermoGas); + *energy0Liq = alphaLiq*thermoLiq.rho()*ea(thermoLiq); + + dMass->store(); + dMassGas->store(); + mass0Gas->store(); + dMassLiq->store(); + mass0Liq->store(); + dEnergy->store(); + dEnergyGas->store(); + energy0Gas->store(); + dEnergyLiq->store(); + energy0Liq->store(); +#}; + +codeExecute +#{ + volScalarField& dMass = + mesh().lookupObjectRef("dMass"); + volScalarField& dMassGas = + mesh().lookupObjectRef("dMass.gas"); + const volScalarField& mass0Gas = + mesh().lookupObject("mass0.gas"); + volScalarField& dMassLiq = + mesh().lookupObjectRef("dMass.liquid"); + const volScalarField& mass0Liq = + mesh().lookupObject("mass0.liquid"); + + volScalarField& dEnergy = + mesh().lookupObjectRef("dEnergy"); + volScalarField& dEnergyGas = + mesh().lookupObjectRef("dEnergy.gas"); + const volScalarField& energy0Gas = + mesh().lookupObject("energy0.gas"); + volScalarField& dEnergyLiq = + mesh().lookupObjectRef("dEnergy.liquid"); + const volScalarField& energy0Liq = + mesh().lookupObject("energy0.liquid"); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.gas"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.liquid"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.gas"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.liquid"); + + dMassGas = alphaGas*thermoGas.rho() - mass0Gas; + dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; + dMass = dMassGas + dMassLiq; + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + dEnergyGas = alphaGas*thermoGas.rho()*ea(thermoGas) - energy0Gas; + dEnergyLiq = alphaLiq*thermoLiq.rho()*ea(thermoLiq) - energy0Liq; + dEnergy = dEnergyGas + dEnergyLiq; +#}; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/controlDict b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/controlDict new file mode 100644 index 0000000000..0457f77202 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/controlDict @@ -0,0 +1,60 @@ +/*--------------------------------*- 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 multiphaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.005; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + #includeFunc continuity + #includeFunc plot +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSchemes b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSchemes new file mode 100644 index 0000000000..5a9fc1f07e --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSchemes @@ -0,0 +1,62 @@ +/*--------------------------------*- 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; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSolution b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSolution new file mode 100644 index 0000000000..229a464730 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/fvSolution @@ -0,0 +1,69 @@ +/*--------------------------------*- 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 +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver PCG; + preconditioner none; + tolerance 1e-11; + relTol 0.001; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|e|h|Yi).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 1; + residualAlpha 0; + } +} + +PIMPLE +{ + nOuterCorrectors 5; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 1e5; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/plot b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/plot new file mode 100644 index 0000000000..569579cdc7 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterAndIsopropanolEvaporation/system/plot @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +libs ("libsampling.so"); + +type probes; + +writeControl timeStep; +writeInterval 1; + +fields +( + air.gas + alpha.gas + alpha.liquid + H2O.gas + H2O.liquid + C3H8O.gas + C3H8O.liquid + p + T.gas + T.liquid + Tf.gasAndLiquid + dMass.gas + dMass.liquid + dMass + dEnergy.gas + dEnergy.liquid + dEnergy +); + +probeLocations ((0 0 0)); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.gas new file mode 100644 index 0000000000..aacf922422 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.liquid new file mode 100644 index 0000000000..4d2729c081 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/T.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.gas new file mode 100644 index 0000000000..14489b22f6 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.liquid new file mode 100644 index 0000000000..3bcfca0321 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/U.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + location "0"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/Ydefault.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/Ydefault.gas new file mode 100644 index 0000000000..16d6f4975c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/Ydefault.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 Ydefault.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/air.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/air.gas new file mode 100644 index 0000000000..f98c8f6e7c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/air.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 air.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.gas new file mode 100644 index 0000000000..07cf7d1611 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.gas @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.99; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.liquid new file mode 100644 index 0000000000..d60223deec --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/alpha.liquid @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField {} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p new file mode 100644 index 0000000000..8742fb3a25 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p_rgh b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p_rgh new file mode 100644 index 0000000000..49f2c42836 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/0/p_rgh @@ -0,0 +1,24 @@ +/*--------------------------------*- 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_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField {} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allclean b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allclean new file mode 100755 index 0000000000..4290f2ef6b --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +cd ${0%/*} || exit 1 + +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase && rm -rf postProcessing_* postProcessing.eps diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun new file mode 100755 index 0000000000..2bc8820e03 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/Allrun @@ -0,0 +1,161 @@ +#!/bin/sh + +cd ${0%/*} || exit 1 + +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +gYs="air.gas H2O.gas none.gas" +gHes="e.gas h.gas" +lHes="e.liquid h.liquid" + +setInertY() +{ + y=${1%.*} + phase=${1#*.} + + case $y in + none ) arg="-remove";; + * ) arg="-set $y";; + esac + + foamDictionary -entry inertSpecie $arg constant/thermophysicalProperties.$phase +} + +setThermoAndEnergy() +{ + he=${1%.*} + phase=${1#*.} + + case $phase in + gas ) thermo="janaf";; + liquid ) thermo="${he}Const";; + * ) exit 1;; + esac + + foamDictionary -entry thermoType.thermo -set $thermo \ + constant/thermophysicalProperties.$phase + + case $he in + e ) energy="sensibleInternalEnergy";; + h ) energy="sensibleEnthalpy";; + * ) exit 1;; + esac + + foamDictionary -entry thermoType.energy -set $energy \ + constant/thermophysicalProperties.$phase +} + +runApplication blockMesh + +for gY in $gYs +do + setInertY $gY + for gHe in $gHes + do + setThermoAndEnergy $gHe + for lHe in $lHes + do + setThermoAndEnergy $lHe + runApplication -s ${gY}_${gHe}_${lHe} $(getApplication) + mv postProcessing postProcessing_${gY}_${gHe}_${lHe} + done + done +done + +gnuplot << EOF + +set terminal eps enhanced size 5.83,8.27 +set output 'postProcessing.eps' + +set lmargin at screen 0.15 +set rmargin at screen 0.84 + +gYs = '$gYs' +gHes = '$gHes' +lHes = '$lHes' + +gY0 = word(gYs, 1) +gHe0 = word(gHes, 1) +lHe0 = word(lHes, 1) + +set multiplot layout 5,1 + +set xlabel "Time (s)" + +set ytics nomirror +set y2tics +set ylabel 'Gas volume fraction' +set y2label 'Liquid volume fraction' + +plot \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/alpha.gas' w l lc 1 t 'Gas', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/alpha.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/alpha.liquid' w l axes x1y2 lc 2 t 'Liquid', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/alpha.liquid' w l axes x1y2 lc 2 notitle + +set ytics mirror +unset y2tics +set ylabel 'Temperature (K)' +unset y2label + +plot \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/T.gas' w l lc 1 t 'Gas', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/T.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/T.liquid' w l lc 2 t 'Liquid', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/T.liquid' w l lc 2 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/Tf.gasAndLiquid' w l lc 3 t 'Interface', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/Tf.gasAndLiquid' w l lc 3 notitle + +set ytics nomirror +set y2tics +set ylabel "Vapour mass fraction" +set y2label "Air mass fraction" + +plot \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/H2O.gas' w l lc 1 t 'H2O', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/H2O.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/air.gas' w l axes x1y2 lc 2 t 'Air', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/air.gas' w l axes x1y2 lc 2 notitle + +set ytics nomirror +set y2tics +set ylabel "Mass (kg/m^3)" +set y2label "Energy (J/m^3)" + +plot \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dMass.gas' w l lc 1 t 'Gas Mass Change', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dMass.gas' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dMass.liquid' w l lc 2 t 'Liquid Mass Change', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dMass.liquid' w l lc 2 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dEnergy.gas' w l axes x1y2 lc 3 t 'Gas Energy Change', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dEnergy.gas' w l axes x1y2 lc 3 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dEnergy.liquid' w l axes x1y2 lc 4 t 'Liquid Energy Change', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dEnergy.liquid' w l axes x1y2 lc 4 notitle + +set ytics nomirror +set y2tics +set ylabel "Mass (kg/m^3)" +set y2label "Energy (J/m^3)" + +plot \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dMass' w l lc 1 t 'Mass Error', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dMass' w l lc 1 notitle, \ + 'postProcessing_'.gY0.'_'.gHe0.'_'.lHe0.'/plot/0/dEnergy' w l axes x1y2 lc 2 t 'Energy Error', \ + for [gY in gYs] for [ gHe in gHes ] for [ lHe in lHes ] \ + 'postProcessing_'.gY.'_'.gHe.'_'.lHe.'/plot/0/dEnergy' w l axes x1y2 lc 2 notitle + +unset multiplot + +EOF diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/g b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/g new file mode 100644 index 0000000000..716851f8f2 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 0); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.gas b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.gas new file mode 100644 index 0000000000..a33e17a274 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.gas @@ -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 momentumTransport.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.liquid b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.liquid new file mode 100644 index 0000000000..4b970b8c2e --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/momentumTransport.liquid @@ -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 momentumTransport.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/phaseProperties b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/phaseProperties new file mode 100644 index 0000000000..18d9877d4b --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/phaseProperties @@ -0,0 +1,150 @@ +/*--------------------------------*- 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 phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type interfaceCompositionPhaseChangeMultiphaseSystem; + +phases (gas liquid); + +nInterfaceCorrectors 1; + +gas +{ + type multiComponentPhaseModel; + diameterModel constant; + d 1e-3; + residualAlpha 1e-6; + Sct 0.7; +} + +liquid +{ + type purePhaseModel; + diameterModel constant; + d 5e-4; + residualAlpha 1e-6; +} + +blending +{ + default + { + type none; + continuousPhase gas; + } +} + +surfaceTension +( + (gas and liquid) + { + type constant; + sigma 0.07; + } +); + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } + + (liquid in gas) + { + type constant; + E0 1.0; + } +); + +drag +( +); + +virtualMass +( +); + +interfaceComposition.gas +( + (gas and liquid) + { + type saturated; + species ( H2O ); + Le 1.0; + saturationPressure + { + type ArdenBuck; + } + } +); + +interfaceComposition.liquid +( +); + +heatTransfer.gas +( + (liquid in gas) + { + type RanzMarshall; + residualAlpha 1e-4; + } +); + +heatTransfer.liquid +( + (liquid in gas) + { + type spherical; + residualAlpha 1e-4; + } +); + +diffusiveMassTransfer.gas +( + (liquid in gas) + { + type Frossling; + Le 1.0; + } +); + +diffusiveMassTransfer.liquid +( +); + +phaseTransfer +( +); + +lift +( +); + +wallLubrication +( +); + +turbulentDispersion +( +); + +// Minimum allowable pressure +pMin 10000; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.gas.orig b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.gas.orig new file mode 100644 index 0000000000..02c26c95b0 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.gas.orig @@ -0,0 +1,80 @@ +/*--------------------------------*- 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.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture multiComponentMixture; + transport sutherland; + thermo janaf; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +inertSpecie air; + +species +( + air + H2O +); + +H2O +{ + specie + { + molWeight 18.0153; + } + thermodynamics + { + Tlow 200; + Thigh 3500; + Tcommon 1000; + highCpCoeffs ( 3.03399 0.00217692 -1.64073e-07 -9.7042e-11 1.68201e-14 -30004.3 4.96677 ); + lowCpCoeffs ( 4.19864 -0.00203643 6.5204e-06 -5.48797e-09 1.77198e-12 -30293.7 -0.849032 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +air +{ + specie + { + molWeight 28.9596; + } + thermodynamics + { + Tlow 200; + Thigh 3500; + Tcommon 1000; + highCpCoeffs ( 3.57304 -7.24383e-04 1.67022e-06 -1.26501e-10 -4.20580e-13 -1047.41 3.12431 ); + lowCpCoeffs ( 3.09589 1.22835e-03 -4.14267e-07 6.56910e-11 -3.87021e-15 -983.191 5.34161 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.liquid.orig b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.liquid.orig new file mode 100644 index 0000000000..a2ea26f282 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/constant/thermophysicalProperties.liquid.orig @@ -0,0 +1,52 @@ +/*--------------------------------*- 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.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1027; + } + thermodynamics + { + Cp 4195; + Cv 4195; + Hf -1.5879e+07; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/blockMeshDict b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/blockMeshDict new file mode 100644 index 0000000000..1d0fd1a105 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/blockMeshDict @@ -0,0 +1,55 @@ +/*--------------------------------*- 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 1; + +vertices +( + (-1 -1 -1) + (1 -1 -1) + (1 1 -1) + (-1 1 -1) + + (-1 -1 1) + (1 -1 1) + (1 1 1) + (-1 1 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1) +); + +edges +( +); + +defaultPatch +{ + name defaultPatch; + type empty; +} + +patches +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/continuity b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/continuity new file mode 100644 index 0000000000..77edd3514d --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/continuity @@ -0,0 +1,145 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +libs ("libutilityFunctionObjects.so"); + +type coded; + +writeControl timeStep; +writeInterval 1; + +name continuity; + +codeOptions +#{ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude +#}; + +codeInclude +#{ + #include "rhoThermo.H" + + namespace Foam + { + tmp ea(const rhoThermo& thermo) + { + tmp tEa = thermo.he() + thermo.hc(); + + if (thermo.he().name() == thermo.phasePropertyName("h")) + { + tEa.ref() -= thermo.p()/thermo.rho(); + } + + return tEa; + } + } +#}; + +codeRead +#{ + volScalarField* dMass = + new volScalarField + ( + IOobject("dMass", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimMass/dimVolume, 0) + ); + volScalarField* dMassGas = new volScalarField("dMass.gas", *dMass); + volScalarField* mass0Gas = new volScalarField("mass0.gas", *dMass); + volScalarField* dMassLiq = new volScalarField("dMass.liquid", *dMass); + volScalarField* mass0Liq = new volScalarField("mass0.liquid", *dMass); + volScalarField* dEnergy = + new volScalarField + ( + IOobject("dEnergy", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimEnergy/dimVolume, 0) + ); + volScalarField* dEnergyLiq = new volScalarField("dEnergy.liquid", *dEnergy); + volScalarField* energy0Liq = new volScalarField("energy0.liquid", *dEnergy); + volScalarField* dEnergyGas = new volScalarField("dEnergy.gas", *dEnergy); + volScalarField* energy0Gas = new volScalarField("energy0.gas", *dEnergy); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.gas"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.liquid"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.gas"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.liquid"); + + *mass0Gas = alphaGas*thermoGas.rho(); + *mass0Liq = alphaLiq*thermoLiq.rho(); + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + *energy0Gas = alphaGas*thermoGas.rho()*ea(thermoGas); + *energy0Liq = alphaLiq*thermoLiq.rho()*ea(thermoLiq); + + dMass->store(); + dMassGas->store(); + mass0Gas->store(); + dMassLiq->store(); + mass0Liq->store(); + dEnergy->store(); + dEnergyGas->store(); + energy0Gas->store(); + dEnergyLiq->store(); + energy0Liq->store(); +#}; + +codeExecute +#{ + volScalarField& dMass = + mesh().lookupObjectRef("dMass"); + volScalarField& dMassGas = + mesh().lookupObjectRef("dMass.gas"); + const volScalarField& mass0Gas = + mesh().lookupObject("mass0.gas"); + volScalarField& dMassLiq = + mesh().lookupObjectRef("dMass.liquid"); + const volScalarField& mass0Liq = + mesh().lookupObject("mass0.liquid"); + + volScalarField& dEnergy = + mesh().lookupObjectRef("dEnergy"); + volScalarField& dEnergyGas = + mesh().lookupObjectRef("dEnergy.gas"); + const volScalarField& energy0Gas = + mesh().lookupObject("energy0.gas"); + volScalarField& dEnergyLiq = + mesh().lookupObjectRef("dEnergy.liquid"); + const volScalarField& energy0Liq = + mesh().lookupObject("energy0.liquid"); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.gas"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.liquid"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.gas"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.liquid"); + + dMassGas = alphaGas*thermoGas.rho() - mass0Gas; + dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; + dMass = dMassGas + dMassLiq; + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + dEnergyGas = alphaGas*thermoGas.rho()*ea(thermoGas) - energy0Gas; + dEnergyLiq = alphaLiq*thermoLiq.rho()*ea(thermoLiq) - energy0Liq; + dEnergy = dEnergyGas + dEnergyLiq; +#}; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/controlDict b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/controlDict new file mode 100644 index 0000000000..0457f77202 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/controlDict @@ -0,0 +1,60 @@ +/*--------------------------------*- 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 multiphaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.005; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + #includeFunc continuity + #includeFunc plot +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSchemes b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSchemes new file mode 100644 index 0000000000..5a9fc1f07e --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSchemes @@ -0,0 +1,62 @@ +/*--------------------------------*- 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; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSolution b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSolution new file mode 100644 index 0000000000..229a464730 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/fvSolution @@ -0,0 +1,69 @@ +/*--------------------------------*- 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 +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver PCG; + preconditioner none; + tolerance 1e-11; + relTol 0.001; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|e|h|Yi).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 1; + residualAlpha 0; + } +} + +PIMPLE +{ + nOuterCorrectors 5; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 1e5; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/plot b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/plot new file mode 100644 index 0000000000..724f09ed7f --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/interfaceComposition/waterEvaporation/system/plot @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +libs ("libsampling.so"); + +type probes; + +writeControl timeStep; +writeInterval 1; + +fields +( + air.gas + alpha.gas + alpha.liquid + H2O.gas + p + T.gas + T.liquid + Tf.gasAndLiquid + dMass.gas + dMass.liquid + dMass + dEnergy.gas + dEnergy.liquid + dEnergy +); + +probeLocations ((0 0 0)); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/README b/test/multiphase/multiphaseEulerFoam/populationBalance/README index 637ef31dac..dd5455be73 100644 --- a/test/multiphase/multiphaseEulerFoam/populationBalance/README +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/README @@ -1,11 +1,6 @@ The cases contained in this directory can be used for testing the populationBalanceModel class which is a part of the multiphaseEulerFoam framework. They represent single-cell setups, i.e. they solve the population balance -equation without spatial transport. The setups already represent the -inhomogeneous case, i.e. the populationBalance is split over multiple -velocityGroups. This can help to identify whether the populationBalance-induced -mass transfer terms are handled correctly. The cases can also be used to study -the influence of certain parameters on the form of the size distribution, before -running a simulation with spatial transport. Further test cases are contained in - -test/multiphase/reactingMultiphaseEulerFoam/populationBalanceModeling +equation without spatial transport. The cases can also be used to study the +influence of certain parameters on the form of the size distribution, before +running a simulation with spatial transport. diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.air b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.air new file mode 100644 index 0000000000..14af98a1d3 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.air @@ -0,0 +1,25 @@ +/*--------------------------------*- 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; + object T.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.water b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.water new file mode 100644 index 0000000000..c678eb451c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/T.water @@ -0,0 +1,25 @@ +/*--------------------------------*- 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; + object T.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.air b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.air new file mode 100644 index 0000000000..0356c6f14b --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.air @@ -0,0 +1,25 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + object U.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.water b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.water new file mode 100644 index 0000000000..85a2905d1c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/U.water @@ -0,0 +1,25 @@ +/*--------------------------------*- 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 binary; + class volVectorField; + object U.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/alpha.air b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/alpha.air new file mode 100644 index 0000000000..a0a1f9128a --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/alpha.air @@ -0,0 +1,26 @@ +/*--------------------------------*- 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 alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.0751237; + +boundaryField +{ +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/f.air.bubbles b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/f.air.bubbles new file mode 100644 index 0000000000..f6cac58749 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/f.air.bubbles @@ -0,0 +1,26 @@ +/*--------------------------------*- 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 f.air.bubbles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1.0; + +boundaryField +{ +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p new file mode 100644 index 0000000000..75814dc0cb --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p @@ -0,0 +1,25 @@ +/*--------------------------------*- 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; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p_rgh b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p_rgh new file mode 100644 index 0000000000..fb9f37adc5 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/0/p_rgh @@ -0,0 +1,25 @@ +/*--------------------------------*- 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; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allclean b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allclean new file mode 100755 index 0000000000..60691a4c65 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +cd ${0%/*} || exit 1 + +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase && rm -f moments.eps numberDensity.eps diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allrun b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allrun new file mode 100755 index 0000000000..10a9274540 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application=$(getApplication) + +runApplication blockMesh +runApplication $application + +( cd validation && ./createGraphs ) + +#------------------------------------------------------------------------------ diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/fvOptions b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/fvOptions new file mode 100644 index 0000000000..17fa68d831 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/fvOptions @@ -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 dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +options +{ + massSource + { + type semiImplicitSource; + + selectionMode all; + volumeMode specific; + + sources + { + thermo:rho.air + { + explicit 0.024535; // kg/s/m^3 + implicit 0; + } + thermo:rho.water + { + explicit -24.535; // kg/s/m^3 + implicit 0; + } + } + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/g b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/g new file mode 100644 index 0000000000..24a8dfba51 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/g @@ -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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 0); + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.air b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.air new file mode 100644 index 0000000000..31424d6c73 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.air @@ -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 momentumTransport.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.water b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.water new file mode 100644 index 0000000000..8f42ef3c8a --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/momentumTransport.water @@ -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 momentumTransport.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/phaseProperties b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/phaseProperties new file mode 100644 index 0000000000..ffa58915cd --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/phaseProperties @@ -0,0 +1,155 @@ +/*--------------------------------*- 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 phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type populationBalanceMultiphaseSystem; + +phases (air water); + +referencePhase water; + +populationBalances (bubbles); + +air +{ + type pureIsothermalPhaseModel; + diameterModel velocityGroup; + velocityGroupCoeffs + { + populationBalance bubbles; + + shapeModel spherical; + + sizeGroups + ( + f0 {dSph 1.240700982; value 0;} + f1 {dSph 1.302736031; value 0;} + f2 {dSph 1.364771080; value 0;} + f3 {dSph 1.426806129; value 0;} + f4 {dSph 1.488841178; value 0;} + f5 {dSph 1.550876227; value 0.0609671;} + f6 {dSph 1.612911276; value 0.0741729;} + f7 {dSph 1.674946325; value 0.0895739;} + f8 {dSph 1.736981375; value 0.1074333;} + f9 {dSph 1.799016424; value 0.1280343;} + f10{dSph 1.861051473; value 0.151681;} + f11{dSph 1.923086522; value 0.1786995;} + f12{dSph 1.985121571; value 0.209438;} + f13{dSph 2.047156620; value 0;} + f14{dSph 2.109191669; value 0;} + f15{dSph 2.171226718; value 0;} + f16{dSph 2.233261767; value 0;} + f17{dSph 2.295296816; value 0;} + f18{dSph 2.357331865; value 0;} + f19{dSph 2.419366915; value 0;} + f20{dSph 2.481401964; value 0;} + f21{dSph 2.543437013; value 0;} + f22{dSph 2.605472062; value 0;} + f23{dSph 2.667507111; value 0;} + f24{dSph 2.729542160; value 0;} + f25{dSph 2.791577209; value 0;} + f26{dSph 2.853612258; value 0;} + f27{dSph 2.915647307; value 0;} + f28{dSph 2.977682356; value 0;} + f29{dSph 3.039717405; value 0;} + f30{dSph 3.101752454; value 0;} + ); + } + + residualAlpha 1e-6; +} + +water +{ + type pureIsothermalPhaseModel; + diameterModel constant; + constantCoeffs + { + d 1e-4; + } + + residualAlpha 1e-6; +} + +populationBalanceCoeffs +{ + bubbles + { + continuousPhase water; + + coalescenceModels + (); + + binaryBreakupModels + (); + + breakupModels + (); + + driftModels + ( + constant{} + ); + + nucleationModels + (); + } +} + +blending +{ + default + { + type none; + continuousPhase water; + } +} + +surfaceTension +(); + +interfaceCompression +(); + +aspectRatio +(); + +drag +(); + +virtualMass +(); + +heatTransfer +(); + +phaseTransfer +(); + +lift +(); + +wallLubrication +(); + +turbulentDispersion +(); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.air b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.air new file mode 100644 index 0000000000..0a82e2af6b --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.air @@ -0,0 +1,52 @@ +/*--------------------------------*- 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.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Cv 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.water b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.water new file mode 100644 index 0000000000..47a8599387 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/constant/thermophysicalProperties.water @@ -0,0 +1,52 @@ +/*--------------------------------*- 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.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18; + } + equationOfState + { + rho 1000; + } + thermodynamics + { + Cv 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/blockMeshDict b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/blockMeshDict new file mode 100644 index 0000000000..013fa5230c --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/blockMeshDict @@ -0,0 +1,48 @@ +/*--------------------------------*- 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 1; + +vertices +( + (0 0 0 ) + (10 0 0 ) + (10 10 0 ) + (0 10 0 ) + (0 0 10) + (10 0 10) + (10 10 10) + (0 10 10) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/controlDict b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/controlDict new file mode 100644 index 0000000000..a7360e5800 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/controlDict @@ -0,0 +1,85 @@ +/*--------------------------------*- 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 multiphaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 6; + +deltaT 0.01; + +writeControl runTime; + +writeInterval 6; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + numberDensity + { + type sizeDistribution; + functionObjectLibs ("libmultiphaseEulerFoamFunctionObjects.so"); + + writeControl outputTime; + writeInterval 1; + + populationBalance bubbles; + functionType number; + coordinateType volume; + densityFunction yes; + } + + moments + { + type sizeDistribution; + functionObjectLibs ("libmultiphaseEulerFoamFunctionObjects.so"); + + writeControl runTime; + writeInterval 0.1; + + populationBalance bubbles; + functionType moments; + coordinateType volume; + maxOrder 1; + } +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSchemes b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSchemes new file mode 100644 index 0000000000..e2a4d63623 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSchemes @@ -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; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*)" Gauss vanLeer; + "div\(phir,alpha.*,alpha.*)" Gauss vanLeer; + "div\(phir,alpha.*)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,(k|epsilon|omega|f).*\)" Gauss limitedLinear 1; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSolution b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSolution new file mode 100644 index 0000000000..9064c12792 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/system/fvSolution @@ -0,0 +1,69 @@ +/*--------------------------------*- 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 +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 1; + } + + bubbles + { + nCorr 1; + tolerance 1e-4; + scale false; + } + + p_rgh + { + solver PCG; + preconditioner none; + tolerance 1e-8; + relTol 0; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "f.*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 2; + nCorrectors 1; + + pRefCell 0; + pRefValue 1e5; +} + +relaxationFactors +{} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs new file mode 100755 index 0000000000..57d77f2823 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/populationBalance/drift/validation/createGraphs @@ -0,0 +1,45 @@ +#!/bin/sh + +if ! which gnuplot > /dev/null 2>&1 +then + echo 'gnuplot not found - skipping graph creation' >&2 + exit 1 +fi + +gnuplot< /dev/null 2>&1 +then + echo 'gnuplot not found - skipping graph creation' >&2 + exit 1 +fi + +gnuplot< ea(const rhoThermo& thermo) + { + tmp tEa = thermo.he() + thermo.hc(); + + if (thermo.he().name() == thermo.phasePropertyName("h")) + { + tEa.ref() -= thermo.p()/thermo.rho(); + } + + return tEa; + } + } +#}; + +codeRead +#{ + volScalarField* dMass = + new volScalarField + ( + IOobject("dMass", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimMass/dimVolume, 0) + ); + volScalarField* dMassGas = new volScalarField("dMass.steam", *dMass); + volScalarField* mass0Gas = new volScalarField("mass0.steam", *dMass); + volScalarField* dMassLiq = new volScalarField("dMass.water", *dMass); + volScalarField* mass0Liq = new volScalarField("mass0.water", *dMass); + volScalarField* dEnergy = + new volScalarField + ( + IOobject("dEnergy", mesh().time().timeName(), mesh()), + mesh(), + dimensionedScalar(dimEnergy/dimVolume, 0) + ); + volScalarField* dEnergyLiq = new volScalarField("dEnergy.water", *dEnergy); + volScalarField* energy0Liq = new volScalarField("energy0.water", *dEnergy); + volScalarField* dEnergyGas = new volScalarField("dEnergy.steam", *dEnergy); + volScalarField* energy0Gas = new volScalarField("energy0.steam", *dEnergy); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.steam"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.water"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.steam"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.water"); + + *mass0Gas = alphaGas*thermoGas.rho(); + *mass0Liq = alphaLiq*thermoLiq.rho(); + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + *energy0Gas = alphaGas*thermoGas.rho()*ea(thermoGas); + *energy0Liq = alphaLiq*thermoLiq.rho()*ea(thermoLiq); + + dMass->store(); + dMassGas->store(); + mass0Gas->store(); + dMassLiq->store(); + mass0Liq->store(); + dEnergy->store(); + dEnergyGas->store(); + energy0Gas->store(); + dEnergyLiq->store(); + energy0Liq->store(); +#}; + +codeExecute +#{ + volScalarField& dMass = + mesh().lookupObjectRef("dMass"); + volScalarField& dMassGas = + mesh().lookupObjectRef("dMass.steam"); + const volScalarField& mass0Gas = + mesh().lookupObject("mass0.steam"); + volScalarField& dMassLiq = + mesh().lookupObjectRef("dMass.water"); + const volScalarField& mass0Liq = + mesh().lookupObject("mass0.water"); + + volScalarField& dEnergy = + mesh().lookupObjectRef("dEnergy"); + volScalarField& dEnergyGas = + mesh().lookupObjectRef("dEnergy.steam"); + const volScalarField& energy0Gas = + mesh().lookupObject("energy0.steam"); + volScalarField& dEnergyLiq = + mesh().lookupObjectRef("dEnergy.water"); + const volScalarField& energy0Liq = + mesh().lookupObject("energy0.water"); + + const volScalarField& alphaGas = + mesh().lookupObject("alpha.steam"); + const volScalarField& alphaLiq = + mesh().lookupObject("alpha.water"); + const rhoThermo& thermoGas = + mesh().lookupObject("thermophysicalProperties.steam"); + const rhoThermo& thermoLiq = + mesh().lookupObject("thermophysicalProperties.water"); + + dMassGas = alphaGas*thermoGas.rho() - mass0Gas; + dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; + dMass = dMassGas + dMassLiq; + + // !!! Note that this is only a valid measure of energy + // conservation because the case is of fixed volume and has no + // kinetic energy + dEnergyGas = alphaGas*thermoGas.rho()*ea(thermoGas) - energy0Gas; + dEnergyLiq = alphaLiq*thermoLiq.rho()*ea(thermoLiq) - energy0Liq; + dEnergy = dEnergyGas + dEnergyLiq; +#}; + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/controlDict b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/controlDict new file mode 100644 index 0000000000..8e1a28e4dc --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/controlDict @@ -0,0 +1,60 @@ +/*--------------------------------*- 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 multiphaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 0.025; + +writeControl runTime; + +writeInterval 4; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + #includeFunc continuity + #includeFunc plot +} + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSchemes b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSchemes new file mode 100644 index 0000000000..5a9fc1f07e --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSchemes @@ -0,0 +1,62 @@ +/*--------------------------------*- 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; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSolution b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSolution new file mode 100644 index 0000000000..1b7652ed2d --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/fvSolution @@ -0,0 +1,73 @@ +/*--------------------------------*- 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 +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver PCG; + preconditioner none; + tolerance 1e-11; + relTol 0.001; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|e|h|Yi).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 1; + residualAlpha 0; + } +} + +PIMPLE +{ + nOuterCorrectors 5; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 1e5; +} + +relaxationFactors +{ + fields + { + thermalPhaseChange:dmdtf 1; + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/plot b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/plot new file mode 100644 index 0000000000..544735ba80 --- /dev/null +++ b/test/multiphase/multiphaseEulerFoam/thermal/waterEvaporation/system/plot @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ + +libs ("libsampling.so"); + +type probes; + +writeControl timeStep; +writeInterval 1; + +fields +( + air.steam + alpha.steam + alpha.water + H2O.steam + p + T.steam + T.water + Tf.steamAndWater + dMass.steam + dMass.water + dMass + dEnergy.steam + dEnergy.water + dEnergy +); + +probeLocations ((0 0 0)); + +// ************************************************************************* //