From d53245c833fd70633ac72533f9dba0b6334a4abd Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 7 Feb 2013 12:31:00 +0000 Subject: [PATCH] Multiphase: Update all solvers to accommodate the split between twoPhaseMixture and incompressibleTwoPhaseMixture --- .../multiphase/cavitatingFoam/Make/options | 1 + .../cavitatingDyMFoam/Make/options | 1 + .../cavitatingDyMFoam/cavitatingDyMFoam.C | 2 +- .../cavitatingFoam/cavitatingFoam.C | 2 +- .../multiphase/cavitatingFoam/createFields.H | 2 +- .../compressibleInterFoam/Make/options | 14 +- .../multiphase/compressibleInterFoam/TEqn.H | 10 +- .../multiphase/compressibleInterFoam/UEqn.H | 2 +- .../compressibleInterDyMFoam/Make/options | 24 +- .../compressibleInterFoam/createFields.H | 49 ++-- .../multiphase/compressibleInterFoam/pEqn.H | 8 +- .../phaseEquationsOfState/Make/files | 8 - .../phaseEquationsOfState/Make/options | 6 - .../adiabaticPerfectFluid.C | 124 -------- .../phaseEquationsOfState/constant/constant.C | 120 -------- .../phaseEquationsOfState/constant/constant.H | 106 ------- .../phaseEquationsOfState/linear/linear.C | 120 -------- .../phaseEquationsOfState/linear/linear.H | 109 ------- .../perfectFluid/perfectFluid.C | 119 -------- .../perfectFluid/perfectFluid.H | 109 ------- .../newPhaseEquationOfState.C | 60 ---- .../phaseEquationOfState.H | 127 -------- .../twoPhaseThermo/Make/options | 5 +- .../twoPhaseThermo/twoPhaseThermo.C | 88 +++--- .../twoPhaseThermo/twoPhaseThermo.H | 10 +- .../interFoam/LTSInterFoam/LTSInterFoam.C | 2 +- .../interFoam/LTSInterFoam/Make/options | 3 +- .../interFoam/MRFInterFoam/MRFInterFoam.C | 2 +- .../interFoam/MRFInterFoam/Make/options | 3 +- .../solvers/multiphase/interFoam/Make/options | 3 +- .../multiphase/interFoam/createFields.H | 2 +- .../interFoam/interDyMFoam/Make/options | 3 +- .../interFoam/interDyMFoam/interDyMFoam.C | 2 +- .../solvers/multiphase/interFoam/interFoam.C | 2 +- .../interFoam/interMixingFoam/Make/options | 5 +- .../interFoam/porousInterFoam/Make/options | 3 +- .../porousInterFoam/porousInterFoam.C | 2 +- .../interPhaseChangeFoam/Make/options | 3 +- .../newPhaseChangeTwoPhaseMixture.C | 2 +- .../phaseChangeTwoPhaseMixture.C | 4 +- .../phaseChangeTwoPhaseMixture.H | 4 +- .../twoLiquidMixingFoam/Make/options | 3 +- .../twoLiquidMixingFoam/createFields.H | 2 +- .../twoLiquidMixingFoam/twoLiquidMixingFoam.C | 2 +- .../foamDebugSwitches/Make/options | 2 +- .../adiabaticPerfectFluid.C | 102 +++++++ .../adiabaticPerfectFluid.H | 247 ++++++++++++++++ .../adiabaticPerfectFluidI.H | 271 ++++++++++++++++++ .../specie/equationOfState/linear/linear.C | 80 ++++++ .../specie/equationOfState/linear/linear.H | 232 +++++++++++++++ .../specie/equationOfState/linear/linearI.H | 232 +++++++++++++++ src/transportModels/Allwmake | 5 +- src/transportModels/incompressible/Make/files | 2 +- .../incompressible/Make/options | 2 + ...ture.C => incompressibleTwoPhaseMixture.C} | 49 +--- ...ture.H => incompressibleTwoPhaseMixture.H} | 63 +--- .../interfaceProperties/Make/options | 2 +- .../Make/files | 4 +- .../Make/options | 0 .../alphaContactAngleFvPatchScalarField.C | 0 .../alphaContactAngleFvPatchScalarField.H | 0 ...stantAlphaContactAngleFvPatchScalarField.C | 0 ...stantAlphaContactAngleFvPatchScalarField.H | 0 ...namicAlphaContactAngleFvPatchScalarField.C | 0 ...namicAlphaContactAngleFvPatchScalarField.H | 0 ...ryingAlphaContactAngleFvPatchScalarField.C | 0 ...ryingAlphaContactAngleFvPatchScalarField.H | 0 .../alphaFixedPressureFvPatchScalarField.C | 0 .../alphaFixedPressureFvPatchScalarField.H | 0 .../twoPhaseMixture/twoPhaseMixture.C | 58 ++-- .../twoPhaseMixture/twoPhaseMixture.H | 96 ++++--- .../les/depthCharge2D/0/T.org | 2 +- .../constant/thermophysicalProperties | 5 + .../constant/transportProperties | 39 --- .../constant/turbulenceProperties | 2 +- .../les/depthCharge2D/system/fvSchemes | 2 +- .../les/depthCharge3D/0/T.org | 2 +- .../constant/turbulenceProperties | 2 +- .../les/depthCharge3D/system/fvSchemes | 3 +- .../les/depthCharge3D/system/fvSolution | 2 +- .../constant/thermophysicalPropertieswater | 3 +- .../constant/thermophysicalProperties2 | 3 +- 82 files changed, 1447 insertions(+), 1343 deletions(-) delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.H delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.H delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.H delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/newPhaseEquationOfState.C delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H create mode 100644 src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C create mode 100644 src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H create mode 100644 src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H create mode 100644 src/thermophysicalModels/specie/equationOfState/linear/linear.C create mode 100644 src/thermophysicalModels/specie/equationOfState/linear/linear.H create mode 100644 src/thermophysicalModels/specie/equationOfState/linear/linearI.H rename src/transportModels/incompressible/incompressibleTwoPhaseMixture/{twoPhaseMixture.C => incompressibleTwoPhaseMixture.C} (80%) rename src/transportModels/incompressible/incompressibleTwoPhaseMixture/{twoPhaseMixture.H => incompressibleTwoPhaseMixture.H} (77%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/Make/files (83%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/Make/options (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C (100%) rename src/transportModels/{twoPhaseInterfaceProperties => twoPhaseProperties}/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H (100%) rename applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.C => src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.C (56%) rename applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H => src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.H (56%) delete mode 100644 tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 0f2981ab4c..2689ed5ab6 100644 --- a/applications/solvers/multiphase/cavitatingFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options index fa204ce58f..a195aa6774 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I.. \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C index 45bc766761..f7688bb910 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C @@ -35,7 +35,7 @@ Description #include "fvCFD.H" #include "dynamicFvMesh.H" #include "barotropicCompressibilityModel.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 256a58d953..f2557b090e 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -34,7 +34,7 @@ Description #include "fvCFD.H" #include "barotropicCompressibilityModel.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H index c724140650..8958dc3c5e 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createFields.H +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -44,7 +44,7 @@ Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phiv, "gamma"); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma"); volScalarField& gamma(twoPhaseProperties.alpha1()); gamma.oldTime(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index a6a130754a..a5738d03dc 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -1,20 +1,18 @@ EXE_INC = \ -ItwoPhaseThermo \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -ltwoPhaseThermo \ -lfluidThermophysicalModels \ -lspecie \ + -ltwoPhaseProperties \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ - -lincompressibleTransportModels \ - -lincompressibleTurbulenceModel \ - -lincompressibleRASModels \ - -lincompressibleLESModels \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H index d5183d5c4e..92a2bd64d8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H @@ -3,12 +3,16 @@ ( fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - - fvm::laplacian(thermo.alphaEff(rho*turbulence->nut()), T) + - fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T) + ( p*fvc::div(phi) + fvc::ddt(rho, K) + fvc::div(rhoPhi, K) - )*(alpha1/thermo.thermo1().Cv() + alpha2/thermo.thermo2().Cv()) + ) + *( + alpha1/twoPhaseProperties.thermo1().Cv() + + alpha2/twoPhaseProperties.thermo2().Cv() + ) ); - thermo.correct(); + twoPhaseProperties.correct(); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index 1c216a8bf7..8fc397e802 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -2,7 +2,7 @@ ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - + turbulence->divDevRhoReff(rho, U) + + turbulence->divDevRhoReff(U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options index 48c21dfee5..661a30dc18 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -2,28 +2,24 @@ EXE_INC = \ -I.. \ -I../twoPhaseThermo \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I../phaseEquationsOfState/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -ltwoPhaseThermo \ -lfluidThermophysicalModels \ -lspecie \ + -ltwoPhaseProperties \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ - -lincompressibleTransportModels \ - -lphaseEquationsOfState \ - -lincompressibleTurbulenceModel \ - -lincompressibleRASModels \ - -lincompressibleLESModels \ - -lfiniteVolume \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ -ldynamicMesh \ -lmeshTools \ - -ldynamicFvMesh + -ldynamicFvMesh \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index 4b7b4a07bc..a650b435ef 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -28,36 +28,33 @@ #include "createPhi.H" - Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + Info<< "Constructing twoPhaseThermo\n" << endl; + twoPhaseThermo twoPhaseProperties(mesh); volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha2(twoPhaseProperties.alpha2()); Info<< "Reading thermophysical properties\n" << endl; - twoPhaseThermo thermo(twoPhaseProperties); + volScalarField& p = twoPhaseProperties.p(); + volScalarField& T = twoPhaseProperties.T(); + const volScalarField& rho1 = twoPhaseProperties.thermo1().rho(); + const volScalarField& psi1 = twoPhaseProperties.thermo1().psi(); + const volScalarField& rho2 = twoPhaseProperties.thermo2().rho(); + const volScalarField& psi2 = twoPhaseProperties.thermo2().psi(); - volScalarField& rho = thermo.rho(); - volScalarField& p = thermo.p(); - volScalarField& T = thermo.T(); - const volScalarField& rho1 = thermo.thermo1().rho(); - const volScalarField& psi1 = thermo.thermo1().psi(); - const volScalarField& rho2 = thermo.thermo2().rho(); - const volScalarField& psi2 = thermo.thermo2().psi(); - - // volScalarField rho - // ( - // IOobject - // ( - // "rho", - // runTime.timeName(), - // mesh, - // IOobject::READ_IF_PRESENT, - // IOobject::AUTO_WRITE - // ), - // alpha1*rho1 + alpha2*rho2 - // ); + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + alpha1*rho1 + alpha2*rho2 + ); dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); @@ -90,10 +87,10 @@ // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); - // Construct incompressible turbulence model - autoPtr turbulence + // Construct compressible turbulence model + autoPtr turbulence ( - incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) + compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties) ); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index dba9058f30..71745c0168 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -47,7 +47,7 @@ // Thermodynamic density needs to be updated by psi*d(p) after the // pressure solution - done in 2 parts. Part 1: - //thermo.rho() -= psi*p_rgh; + //twoPhaseProperties.rho() -= psi*p_rgh; while (pimple.correctNonOrthogonal()) { @@ -70,7 +70,7 @@ if (pimple.finalNonOrthogonalIter()) { // Second part of thermodynamic density update - //thermo.rho() += psi*p_rgh; + //twoPhaseProperties.rho() += psi*p_rgh; dgdt = ( @@ -88,14 +88,14 @@ p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); - // thermo.correct(); + // twoPhaseProperties.correct(); Info<< "max(U) " << max(mag(U)).value() << endl; Info<< "min(p_rgh) " << min(p_rgh).value() << endl; K = 0.5*magSqr(U); - if (thermo.dpdt()) + if (twoPhaseProperties.dpdt()) { dpdt = fvc::ddt(p); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files deleted file mode 100644 index e6e260c74a..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files +++ /dev/null @@ -1,8 +0,0 @@ -phaseEquationOfState/phaseEquationOfState.C -phaseEquationOfState/newPhaseEquationOfState.C -constant/constant.C -linear/linear.C -perfectFluid/perfectFluid.C -adiabaticPerfectFluid/adiabaticPerfectFluid.C - -LIB = $(FOAM_LIBBIN)/libphaseEquationsOfState diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options deleted file mode 100644 index 0ec1139209..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options +++ /dev/null @@ -1,6 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude - -LIB_LIBS = \ - -lincompressibleTransportModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C deleted file mode 100644 index 82a195dca9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "adiabaticPerfectFluid.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(adiabaticPerfectFluid, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - adiabaticPerfectFluid, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::adiabaticPerfectFluid::adiabaticPerfectFluid -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - p0_("p0", dimPressure, dict.lookup("p0")), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - gamma_("gamma", dimless, dict.lookup("gamma")), - B_("B", dimPressure, dict.lookup("B")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::adiabaticPerfectFluid::~adiabaticPerfectFluid() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp -Foam::phaseEquationsOfState::adiabaticPerfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_) - ) - ); -} - - -Foam::tmp -Foam::phaseEquationsOfState::adiabaticPerfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - (rho0_/(gamma_*(p0_ + B_))) - *pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C deleted file mode 100644 index 54b6705dd9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "constant.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(constant, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - constant, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::constant::constant -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho_("rho", dimDensity, dict.lookup("rho")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::constant::~constant() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::constant::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - rho_ - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::constant::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - dimensionedScalar("psi", dimDensity/dimPressure, 0) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.H b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.H deleted file mode 100644 index 5cfe44c26e..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.H +++ /dev/null @@ -1,106 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::phaseEquationsOfState::constant - -Description - Constant phase density model. - -SourceFiles - constant.C - -\*---------------------------------------------------------------------------*/ - -#ifndef constant_H -#define constant_H - -#include "phaseEquationOfState.H" -#include "dimensionedTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - -/*---------------------------------------------------------------------------*\ - Class constant Declaration -\*---------------------------------------------------------------------------*/ - -class constant -: - public phaseEquationOfState -{ - // Private data - - //- The constant density of the phase - dimensionedScalar rho_; - - -public: - - //- Runtime type information - TypeName("constant"); - - - // Constructors - - //- Construct from components - constant - ( - const dictionary& dict - ); - - - //- Destructor - virtual ~constant(); - - - // Member Functions - - tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace phaseEquationsOfState -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C deleted file mode 100644 index 3680735a1b..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "linear.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(linear, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - linear, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::linear::linear -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - psi_("psi", dimDensity/dimPressure, dict.lookup("psi")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::linear::~linear() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::linear::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi_*p - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::linear::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - psi_ - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.H b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.H deleted file mode 100644 index d357bb3ec0..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.H +++ /dev/null @@ -1,109 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::phaseEquationsOfState::linear - -Description - Linear phase density model. - -SourceFiles - linear.C - -\*---------------------------------------------------------------------------*/ - -#ifndef linear_H -#define linear_H - -#include "phaseEquationOfState.H" -#include "dimensionedTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - -/*---------------------------------------------------------------------------*\ - Class linear Declaration -\*---------------------------------------------------------------------------*/ - -class linear -: - public phaseEquationOfState -{ - // Private data - - //- The reference density of the phase - dimensionedScalar rho0_; - - //- The constant compressibility of the phase - dimensionedScalar psi_; - - -public: - - //- Runtime type information - TypeName("linear"); - - - // Constructors - - //- Construct from components - linear - ( - const dictionary& dict - ); - - - //- Destructor - virtual ~linear(); - - - // Member Functions - - tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace phaseEquationsOfState -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C deleted file mode 100644 index 6a148d8d68..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C +++ /dev/null @@ -1,119 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "perfectFluid.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(perfectFluid, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - perfectFluid, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::perfectFluid::perfectFluid -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - R_("R", dimensionSet(0, 2, -2, -1, 0), dict.lookup("R")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::perfectFluid::~perfectFluid() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::perfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi(p, T)*p - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::perfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - 1.0/(R_*T) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.H b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.H deleted file mode 100644 index b854f1d84f..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.H +++ /dev/null @@ -1,109 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::phaseEquationsOfState::perfectFluid - -Description - PerfectFluid phase density model. - -SourceFiles - perfectFluid.C - -\*---------------------------------------------------------------------------*/ - -#ifndef perfectFluid_H -#define perfectFluid_H - -#include "phaseEquationOfState.H" -#include "dimensionedTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - -/*---------------------------------------------------------------------------*\ - Class perfectFluid Declaration -\*---------------------------------------------------------------------------*/ - -class perfectFluid -: - public phaseEquationOfState -{ - // Private data - - //- The reference density of the phase - dimensionedScalar rho0_; - - //- The fluid constant of the phase - dimensionedScalar R_; - - -public: - - //- Runtime type information - TypeName("perfectFluid"); - - - // Constructors - - //- Construct from components - perfectFluid - ( - const dictionary& dict - ); - - - //- Destructor - virtual ~perfectFluid(); - - - // Member Functions - - tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace phaseEquationsOfState -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/newPhaseEquationOfState.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/newPhaseEquationOfState.C deleted file mode 100644 index 3d9a842a9f..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/newPhaseEquationOfState.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "phaseEquationOfState.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::phaseEquationOfState::New -( - const dictionary& dict -) -{ - word phaseEquationOfStateType - ( - dict.subDict("equationOfState").lookup("type") - ); - - Info<< "Selecting phaseEquationOfState " - << phaseEquationOfStateType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(phaseEquationOfStateType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("phaseEquationOfState::New") - << "Unknown phaseEquationOfStateType type " - << phaseEquationOfStateType << endl << endl - << "Valid phaseEquationOfState types are : " << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return cstrIter()(dict.subDict("equationOfState")); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H deleted file mode 100644 index 45a5079d0d..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H +++ /dev/null @@ -1,127 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::phaseEquationOfState - -Description - A2stract base-class for dispersed-phase particle diameter models. - -SourceFiles - phaseEquationOfState.C - newDiameterModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef phaseEquationOfState_H -#define phaseEquationOfState_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "dictionary.H" -#include "volFieldsFwd.H" -#include "runTimeSelectionTables.H" - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class phaseEquationOfState Declaration -\*---------------------------------------------------------------------------*/ - -class phaseEquationOfState -{ -protected: - - // Protected data - - const dictionary& dict_; - - -public: - - //- Runtime type information - TypeName("phaseEquationOfState"); - - - // Declare runtime construction - - declareRunTimeSelectionTable - ( - autoPtr, - phaseEquationOfState, - dictionary, - ( - const dictionary& dict - ), - (dict) - ); - - - // Constructors - - phaseEquationOfState - ( - const dictionary& dict - ); - - - //- Destructor - virtual ~phaseEquationOfState(); - - - // Selectors - - static autoPtr New - ( - const dictionary& dict - ); - - - // Member Functions - - //- Return the phase density - virtual tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; - - //- Return the phase compressibility - virtual tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options index 3f7f51cce5..e2c67263b8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options @@ -1,11 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ -lfluidThermophysicalModels \ -lspecie \ - -lincompressibleTransportModels \ + -ltwoPhaseProperties \ -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C index c9455875e5..e1842b88fd 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C @@ -39,18 +39,16 @@ namespace Foam Foam::twoPhaseThermo::twoPhaseThermo ( - const twoPhaseMixture& twoPhaseProperties + const fvMesh& mesh ) : - rhoThermo(twoPhaseProperties.alpha1().mesh(), word::null), - tpm_(twoPhaseProperties), - thermo1_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase1Name())), - thermo2_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase2Name())) + psiThermo(mesh, word::null), + twoPhaseMixture(mesh, *this), + thermo1_(rhoThermo::New(mesh, phase1Name())), + thermo2_(rhoThermo::New(mesh, phase2Name())) { - thermo1_->validate(tpm_.phase1Name(), "e"); - thermo2_->validate(tpm_.phase2Name(), "e"); - - rho_ = tpm_.alpha1()*thermo1_->rho() + tpm_.alpha2()*thermo2_->rho(); + thermo1_->validate(phase1Name(), "e"); + thermo2_->validate(phase2Name(), "e"); correct(); } @@ -72,9 +70,9 @@ void Foam::twoPhaseThermo::correct() thermo2_->he() = thermo2_->he(p_, T_); thermo2_->correct(); - psi_ = tpm_.alpha1()*thermo1_->psi() + tpm_.alpha2()*thermo2_->psi(); - mu_ = tpm_.alpha1()*thermo1_->mu() + tpm_.alpha2()*thermo2_->mu(); - alpha_ = tpm_.alpha1()*thermo1_->alpha() + tpm_.alpha2()*thermo2_->alpha(); + psi_ = alpha1()*thermo1_->psi() + alpha2()*thermo2_->psi(); + mu_ = alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu(); + alpha_ = alpha1()*thermo1_->alpha() + alpha2()*thermo2_->alpha(); } @@ -96,7 +94,7 @@ Foam::tmp Foam::twoPhaseThermo::he const volScalarField& T ) const { - return tpm_.alpha1()*thermo1_->he(p, T) + tpm_.alpha2()*thermo2_->he(p, T); + return alpha1()*thermo1_->he(p, T) + alpha2()*thermo2_->he(p, T); } @@ -108,8 +106,8 @@ Foam::tmp Foam::twoPhaseThermo::he ) const { return - scalarField(tpm_.alpha1(), cells)*thermo1_->he(p, T, cells) - + scalarField(tpm_.alpha2(), cells)*thermo2_->he(p, T, cells); + scalarField(alpha1(), cells)*thermo1_->he(p, T, cells) + + scalarField(alpha2(), cells)*thermo2_->he(p, T, cells); } @@ -121,14 +119,14 @@ Foam::tmp Foam::twoPhaseThermo::he ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::hc() const { - return tpm_.alpha1()*thermo1_->hc() + tpm_.alpha2()*thermo2_->hc(); + return alpha1()*thermo1_->hc() + alpha2()*thermo2_->hc(); } @@ -160,7 +158,7 @@ Foam::tmp Foam::twoPhaseThermo::THE Foam::tmp Foam::twoPhaseThermo::Cp() const { - return tpm_.alpha1()*thermo1_->Cp() + tpm_.alpha2()*thermo2_->Cp(); + return alpha1()*thermo1_->Cp() + alpha2()*thermo2_->Cp(); } @@ -172,14 +170,14 @@ Foam::tmp Foam::twoPhaseThermo::Cp ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::Cv() const { - return tpm_.alpha1()*thermo1_->Cv() + tpm_.alpha2()*thermo2_->Cv(); + return alpha1()*thermo1_->Cv() + alpha2()*thermo2_->Cv(); } @@ -191,14 +189,14 @@ Foam::tmp Foam::twoPhaseThermo::Cv ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::gamma() const { - return tpm_.alpha1()*thermo1_->gamma() + tpm_.alpha2()*thermo2_->gamma(); + return alpha1()*thermo1_->gamma() + alpha2()*thermo2_->gamma(); } @@ -210,14 +208,14 @@ Foam::tmp Foam::twoPhaseThermo::gamma ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::Cpv() const { - return tpm_.alpha1()*thermo1_->Cpv() + tpm_.alpha2()*thermo2_->Cpv(); + return alpha1()*thermo1_->Cpv() + alpha2()*thermo2_->Cpv(); } @@ -229,16 +227,16 @@ Foam::tmp Foam::twoPhaseThermo::Cpv ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::CpByCpv() const { return - tpm_.alpha1()*thermo1_->CpByCpv() - + tpm_.alpha2()*thermo2_->CpByCpv(); + alpha1()*thermo1_->CpByCpv() + + alpha2()*thermo2_->CpByCpv(); } @@ -250,14 +248,14 @@ Foam::tmp Foam::twoPhaseThermo::CpByCpv ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi); } Foam::tmp Foam::twoPhaseThermo::kappa() const { - return tpm_.alpha1()*thermo1_->kappa() + tpm_.alpha2()*thermo2_->kappa(); + return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa(); } @@ -267,8 +265,8 @@ Foam::tmp Foam::twoPhaseThermo::kappa ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi); + alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi) + + alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi); } @@ -278,8 +276,8 @@ Foam::tmp Foam::twoPhaseThermo::kappaEff ) const { return - tpm_.alpha1()*thermo1_->kappaEff(alphat) - + tpm_.alpha2()*thermo2_->kappaEff(alphat); + alpha1()*thermo1_->kappaEff(alphat) + + alpha2()*thermo2_->kappaEff(alphat); } @@ -290,8 +288,8 @@ Foam::tmp Foam::twoPhaseThermo::kappaEff ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi) + alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi) ; } @@ -302,8 +300,8 @@ Foam::tmp Foam::twoPhaseThermo::alphaEff ) const { return - tpm_.alpha1()*thermo1_->alphaEff(alphat) - + tpm_.alpha2()*thermo2_->alphaEff(alphat); + alpha1()*thermo1_->alphaEff(alphat) + + alpha2()*thermo2_->alphaEff(alphat); } @@ -314,8 +312,8 @@ Foam::tmp Foam::twoPhaseThermo::alphaEff ) const { return - tpm_.alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi) - + tpm_.alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi) + alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi) ; } diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H index d3582801b7..24966273c6 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H @@ -37,6 +37,7 @@ SourceFiles #define twoPhaseThermo_H #include "rhoThermo.H" +#include "psiThermo.H" #include "twoPhaseMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,12 +51,11 @@ namespace Foam class twoPhaseThermo : - public rhoThermo + public psiThermo, + public twoPhaseMixture { // Private data - const twoPhaseMixture& tpm_; - //- Thermo-package of phase 1 autoPtr thermo1_; @@ -71,10 +71,10 @@ public: // Constructors - //- Construct from mesh and phase fractions + //- Construct from mesh twoPhaseThermo ( - const twoPhaseMixture& twoPhaseProperties + const fvMesh& mesh ); diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 7580c3f9ac..3d1b93f429 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -41,7 +41,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "fvcSmooth.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options b/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options index b5c7b88e4f..6c173b8fd1 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I.. \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -11,7 +12,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 99cc1dd8bd..b819068ddd 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -40,7 +40,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "IOMRFZoneList.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options index b5c7b88e4f..6c173b8fd1 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I.. \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -11,7 +12,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index b87380d8a1..4ea908240d 100644 --- a/applications/solvers/multiphase/interFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -10,7 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index c607c68548..f0d1809848 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -30,7 +30,7 @@ Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha2(twoPhaseProperties.alpha2()); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options index 4fa14dd6d2..c8d0b93e4d 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I.. \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -13,7 +14,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 1a9d210e23..fa16f17141 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -37,7 +37,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" #include "fvIOoptionList.H" diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 53cc2719b9..51f082b616 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -41,7 +41,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" #include "fvIOoptionList.H" diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options b/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options index 6c54b4454b..7630bc9b51 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options @@ -1,9 +1,10 @@ EXE_INC = \ -I.. \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -IincompressibleThreePhaseMixture \ -IthreePhaseInterfaceProperties \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels \ @@ -12,7 +13,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options index b5c7b88e4f..6c173b8fd1 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I.. \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -11,7 +12,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index ea1a15b032..39c81c7a8d 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -42,7 +42,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "IOporosityModelList.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options index 5416a161a8..2d2a968f16 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -8,7 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index f1e8feec00..cd276d4203 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "phaseChangeTwoPhaseMixture.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index 3a7c4c7a53..2ff6e34587 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture const word& alpha1Name ) : - twoPhaseMixture(U, phi, alpha1Name), + incompressibleTwoPhaseMixture(U, phi, alpha1Name), phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")), pSat_(lookup("pSat")) {} @@ -76,7 +76,7 @@ Foam::phaseChangeTwoPhaseMixture::vDotP() const bool Foam::phaseChangeTwoPhaseMixture::read() { - if (twoPhaseMixture::read()) + if (incompressibleTwoPhaseMixture::read()) { phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); lookup("pSat") >> pSat_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H index fdfe30d5e7..04dde03657 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -35,7 +35,7 @@ SourceFiles #ifndef phaseChangeTwoPhaseMixture_H #define phaseChangeTwoPhaseMixture_H -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "typeInfo.H" #include "runTimeSelectionTables.H" #include "volFields.H" @@ -54,7 +54,7 @@ namespace Foam class phaseChangeTwoPhaseMixture : - public twoPhaseMixture + public incompressibleTwoPhaseMixture { protected: diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index 6e20519ec9..9a33b331cc 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I../interFoam \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -7,7 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index e98f06e74e..18b686f4f8 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -29,7 +29,7 @@ #include "createPhi.H" Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha2(twoPhaseProperties.alpha2()); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 6113aba01f..bb883e2549 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -34,7 +34,7 @@ Description #include "fvCFD.H" #include "MULES.H" #include "subCycle.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 6fa4104188..43f0c24cb5 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -63,5 +63,5 @@ EXE_LIBS = \ -lthermophysicalFunctions \ -ltopoChangerFvMesh \ -ltriSurface \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lutilityFunctionObjects diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C new file mode 100644 index 0000000000..5d35425ccc --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "adiabaticPerfectFluid.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::adiabaticPerfectFluid::adiabaticPerfectFluid(Istream& is) +: + Specie(is), + p0_(readScalar(is)), + rho0_(readScalar(is)), + gamma_(readScalar(is)), + B_(readScalar(is)) +{ + is.check + ( + "adiabaticPerfectFluid::adiabaticPerfectFluid(Istream& is)" + ); +} + + +template +Foam::adiabaticPerfectFluid::adiabaticPerfectFluid +( + const dictionary& dict +) +: + Specie(dict), + p0_(readScalar(dict.subDict("equationOfState").lookup("p0"))), + rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0"))), + gamma_(readScalar(dict.subDict("equationOfState").lookup("gamma"))), + B_(readScalar(dict.subDict("equationOfState").lookup("B"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::adiabaticPerfectFluid::write(Ostream& os) const +{ + Specie::write(os); + + dictionary dict("equationOfState"); + dict.add("p0", p0_); + dict.add("rho0", rho0_); + dict.add("gamma", gamma_); + dict.add("B", B_); + + os << indent << dict.dictName() << dict; +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const adiabaticPerfectFluid& pf +) +{ + os << static_cast(pf) + << token::SPACE << pf.R_ + << token::SPACE << pf.rho0_ + << token::SPACE << pf.gamma_ + << token::SPACE << pf.B_; + + os.check + ( + "Ostream& operator<<(Ostream&, const adiabaticPerfectFluid&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H new file mode 100644 index 0000000000..6ebd728fa8 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H @@ -0,0 +1,247 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::adiabaticPerfectFluid + +Description + AdiabaticPerfect gas equation of state. + +SourceFiles + adiabaticPerfectFluidI.H + adiabaticPerfectFluid.C + +\*---------------------------------------------------------------------------*/ + +#ifndef adiabaticPerfectFluid_H +#define adiabaticPerfectFluid_H + +#include "autoPtr.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template class adiabaticPerfectFluid; + +template +inline adiabaticPerfectFluid operator+ +( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& +); + +template +inline adiabaticPerfectFluid operator- +( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& +); + +template +inline adiabaticPerfectFluid operator* +( + const scalar, + const adiabaticPerfectFluid& +); + +template +inline adiabaticPerfectFluid operator== +( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& +); + +template +Ostream& operator<< +( + Ostream&, + const adiabaticPerfectFluid& +); + + +/*---------------------------------------------------------------------------*\ + Class adiabaticPerfectFluid Declaration +\*---------------------------------------------------------------------------*/ + +template +class adiabaticPerfectFluid +: + public Specie +{ + // Private data + + //- Reference pressure + scalar p0_; + + //- Reference density + scalar rho0_; + + //- The isentropic exponent + scalar gamma_; + + //- Pressure offset for a stiffened gas + scalar B_; + + +public: + + // Constructors + + //- Construct from components + inline adiabaticPerfectFluid + ( + const Specie& sp, + const scalar p0, + const scalar rho0, + const scalar gamma, + const scalar B + ); + + //- Construct from Istream + adiabaticPerfectFluid(Istream&); + + //- Construct from dictionary + adiabaticPerfectFluid(const dictionary& dict); + + //- Construct as named copy + inline adiabaticPerfectFluid + ( + const word& name, + const adiabaticPerfectFluid& + ); + + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + // Selector from dictionary + inline static autoPtr New + ( + const dictionary& dict + ); + + + // Member functions + + //- Return the instantiated type name + static word typeName() + { + return "adiabaticPerfectFluid<" + word(Specie::typeName_()) + '>'; + } + + + // Fundamental properties + + //- Is the equation of state is incompressible i.e. rho != f(p) + static const bool incompressible = false; + + //- Is the equation of state is isochoric i.e. rho = const + static const bool isochoric = false; + + //- Return density [kg/m^3] + inline scalar rho(scalar p, scalar T) const; + + //- Return compressibility rho/p [s^2/m^2] + inline scalar psi(scalar p, scalar T) const; + + //- Return compression factor [] + inline scalar Z(scalar p, scalar T) const; + + //- Return (cp - cv) [J/(kmol K] + inline scalar cpMcv(scalar p, scalar T) const; + + + // IO + + //- Write to Ostream + void write(Ostream& os) const; + + + // Member operators + + inline void operator+=(const adiabaticPerfectFluid&); + inline void operator-=(const adiabaticPerfectFluid&); + + inline void operator*=(const scalar); + + + // Friend operators + + friend adiabaticPerfectFluid operator+ + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator- + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator* + ( + const scalar s, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator== + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const adiabaticPerfectFluid& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "adiabaticPerfectFluidI.H" + +#ifdef NoRepository +# include "adiabaticPerfectFluid.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H new file mode 100644 index 0000000000..4521e71946 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H @@ -0,0 +1,271 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "adiabaticPerfectFluid.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +inline Foam::adiabaticPerfectFluid::adiabaticPerfectFluid +( + const Specie& sp, + const scalar p0, + const scalar rho0, + const scalar gamma, + const scalar B +) +: + Specie(sp), + p0_(p0), + rho0_(rho0), + gamma_(gamma), + B_(B) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::adiabaticPerfectFluid::adiabaticPerfectFluid +( + const word& name, + const adiabaticPerfectFluid& pf +) +: + Specie(name, pf), + p0_(pf.p0_), + rho0_(pf.rho0_), + gamma_(pf.gamma_), + B_(pf.B_) +{} + + +template +inline Foam::autoPtr > +Foam::adiabaticPerfectFluid::clone() const +{ + return autoPtr > + ( + new adiabaticPerfectFluid(*this) + ); +} + + +template +inline Foam::autoPtr > +Foam::adiabaticPerfectFluid::New(Istream& is) +{ + return autoPtr > + ( + new adiabaticPerfectFluid(is) + ); +} + + +template +inline Foam::autoPtr > +Foam::adiabaticPerfectFluid::New +( + const dictionary& dict +) +{ + return autoPtr > + ( + new adiabaticPerfectFluid(dict) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::adiabaticPerfectFluid::rho +( + scalar p, + scalar +) const +{ + return rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_); +} + + +template +inline Foam::scalar Foam::adiabaticPerfectFluid::psi +( + scalar p, + scalar +) const +{ + return + (rho0_/(gamma_*(p0_ + B_))) + *pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0); +} + + +template +inline Foam::scalar Foam::adiabaticPerfectFluid::Z(scalar, scalar) const +{ + return 1.0; +} + + +template +inline Foam::scalar Foam::adiabaticPerfectFluid::cpMcv +( + scalar, + scalar +) const +{ + return 0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline void Foam::adiabaticPerfectFluid::operator+= +( + const adiabaticPerfectFluid& pf +) +{ + scalar molr1 = this->nMoles(); + + Specie::operator+=(pf); + + molr1 /= this->nMoles(); + scalar molr2 = pf.nMoles()/this->nMoles(); + + p0_ = molr1*p0_ + molr2*pf.p0_; + rho0_ = molr1*rho0_ + molr2*pf.rho0_; + gamma_ = molr1*gamma_ + molr2*pf.gamma_; + B_ = molr1*B_ + molr2*pf.B_; +} + + +template +inline void Foam::adiabaticPerfectFluid::operator-= +( + const adiabaticPerfectFluid& pf +) +{ + scalar molr1 = this->nMoles(); + + Specie::operator-=(pf); + + molr1 /= this->nMoles(); + scalar molr2 = pf.nMoles()/this->nMoles(); + + p0_ = molr1*p0_ - molr2*pf.p0_; + rho0_ = molr1*rho0_ - molr2*pf.rho0_; + gamma_ = molr1*gamma_ - molr2*pf.gamma_; + B_ = molr1*B_ - molr2*pf.B_; +} + + +template +inline void Foam::adiabaticPerfectFluid::operator*=(const scalar s) +{ + Specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +inline Foam::adiabaticPerfectFluid Foam::operator+ +( + const adiabaticPerfectFluid& pf1, + const adiabaticPerfectFluid& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst + ( + static_cast(pf1) + + static_cast(pf2), + molr1*pf1.p0_ + molr2*pf2.p0_, + molr1*pf1.rho0_ + molr2*pf2.rho0_, + molr1*pf1.gamma_ + molr2*pf2.gamma_, + molr1*pf1.B_ + molr2*pf2.B_ + ); +} + + +template +inline Foam::adiabaticPerfectFluid Foam::operator- +( + const adiabaticPerfectFluid& pf1, + const adiabaticPerfectFluid& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst + ( + static_cast(pf1) + - static_cast(pf2), + molr1*pf1.p0_ - molr2*pf2.p0_, + molr1*pf1.rho0_ - molr2*pf2.rho0_, + molr1*pf1.gamma_ - molr2*pf2.gamma_, + molr1*pf1.B_ - molr2*pf2.B_ + ); +} + + +template +inline Foam::adiabaticPerfectFluid Foam::operator* +( + const scalar s, + const adiabaticPerfectFluid& pf +) +{ + return adiabaticPerfectFluid + ( + s*static_cast(pf), + pf.p0_, + pf.rho0_, + pf.gamma_, + pf.B_ + ); +} + + +template +inline Foam::adiabaticPerfectFluid Foam::operator== +( + const adiabaticPerfectFluid& pf1, + const adiabaticPerfectFluid& pf2 +) +{ + return pf2 - pf1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linear.C b/src/thermophysicalModels/specie/equationOfState/linear/linear.C new file mode 100644 index 0000000000..562bdecf2b --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/linear/linear.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "linear.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::linear::linear(Istream& is) +: + Specie(is), + psi_(readScalar(is)), + rho0_(readScalar(is)) +{ + is.check("linear::linear(Istream& is)"); +} + + +template +Foam::linear::linear(const dictionary& dict) +: + Specie(dict), + psi_(readScalar(dict.subDict("equationOfState").lookup("psi"))), + rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::linear::write(Ostream& os) const +{ + Specie::write(os); + + dictionary dict("equationOfState"); + dict.add("psi", psi_); + dict.add("rho0", rho0_); + + os << indent << dict.dictName() << dict; +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<<(Ostream& os, const linear& pf) +{ + os << static_cast(pf) + << token::SPACE << pf.psi_ + << token::SPACE << pf.rho0_; + + os.check("Ostream& operator<<(Ostream&, const linear&)"); + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linear.H b/src/thermophysicalModels/specie/equationOfState/linear/linear.H new file mode 100644 index 0000000000..8876ce3f28 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/linear/linear.H @@ -0,0 +1,232 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::linear + +Description + Perfect gas equation of state. + +SourceFiles + linearI.H + linear.C + +\*---------------------------------------------------------------------------*/ + +#ifndef linear_H +#define linear_H + +#include "autoPtr.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template class linear; + +template +inline linear operator+ +( + const linear&, + const linear& +); + +template +inline linear operator- +( + const linear&, + const linear& +); + +template +inline linear operator* +( + const scalar, + const linear& +); + +template +inline linear operator== +( + const linear&, + const linear& +); + +template +Ostream& operator<< +( + Ostream&, + const linear& +); + + +/*---------------------------------------------------------------------------*\ + Class linear Declaration +\*---------------------------------------------------------------------------*/ + +template +class linear +: + public Specie +{ + // Private data + + //- Compressibility + scalar psi_; + + //- The reference density + scalar rho0_; + + +public: + + // Constructors + + //- Construct from components + inline linear + ( + const Specie& sp, + const scalar psi, + const scalar rho0 + ); + + //- Construct from Istream + linear(Istream&); + + //- Construct from dictionary + linear(const dictionary& dict); + + //- Construct as named copy + inline linear(const word& name, const linear&); + + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + // Selector from dictionary + inline static autoPtr New(const dictionary& dict); + + + // Member functions + + //- Return the instantiated type name + static word typeName() + { + return "linear<" + word(Specie::typeName_()) + '>'; + } + + + // Fundamental properties + + //- Is the equation of state is incompressible i.e. rho != f(p) + static const bool incompressible = false; + + //- Is the equation of state is isochoric i.e. rho = const + static const bool isochoric = false; + + //- Return density [kg/m^3] + inline scalar rho(scalar p, scalar T) const; + + //- Return compressibility rho/p [s^2/m^2] + inline scalar psi(scalar p, scalar T) const; + + //- Return compression factor [] + inline scalar Z(scalar p, scalar T) const; + + //- Return (cp - cv) [J/(kmol K] + inline scalar cpMcv(scalar p, scalar T) const; + + + // IO + + //- Write to Ostream + void write(Ostream& os) const; + + + // Member operators + + inline void operator+=(const linear&); + inline void operator-=(const linear&); + + inline void operator*=(const scalar); + + + // Friend operators + + friend linear operator+ + ( + const linear&, + const linear& + ); + + friend linear operator- + ( + const linear&, + const linear& + ); + + friend linear operator* + ( + const scalar s, + const linear& + ); + + friend linear operator== + ( + const linear&, + const linear& + ); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const linear& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "linearI.H" + +#ifdef NoRepository +# include "linear.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H new file mode 100644 index 0000000000..ea05aa6333 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H @@ -0,0 +1,232 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "linear.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +inline Foam::linear::linear +( + const Specie& sp, + const scalar psi, + const scalar rho0 +) +: + Specie(sp), + psi_(psi), + rho0_(rho0) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::linear::linear +( + const word& name, + const linear& pf +) +: + Specie(name, pf), + psi_(pf.psi_), + rho0_(pf.rho0_) +{} + + +template +inline Foam::autoPtr > +Foam::linear::clone() const +{ + return autoPtr >(new linear(*this)); +} + + +template +inline Foam::autoPtr > +Foam::linear::New(Istream& is) +{ + return autoPtr >(new linear(is)); +} + + +template +inline Foam::autoPtr > +Foam::linear::New +( + const dictionary& dict +) +{ + return autoPtr >(new linear(dict)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::linear::rho(scalar p, scalar T) const +{ + return rho0_ + psi_*p; +} + + +template +inline Foam::scalar Foam::linear::psi(scalar, scalar T) const +{ + return psi_; +} + + +template +inline Foam::scalar Foam::linear::Z(scalar, scalar) const +{ + return 1.0; +} + + +template +inline Foam::scalar Foam::linear::cpMcv(scalar, scalar) const +{ + return 0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline void Foam::linear::operator+= +( + const linear& pf +) +{ + scalar molr1 = this->nMoles(); + + Specie::operator+=(pf); + + molr1 /= this->nMoles(); + scalar molr2 = pf.nMoles()/this->nMoles(); + + psi_ = molr1*psi_ + molr2*pf.psi_; + rho0_ = molr1*rho0_ + molr2*pf.rho0_; +} + + +template +inline void Foam::linear::operator-= +( + const linear& pf +) +{ + scalar molr1 = this->nMoles(); + + Specie::operator-=(pf); + + molr1 /= this->nMoles(); + scalar molr2 = pf.nMoles()/this->nMoles(); + + psi_ = molr1*psi_ - molr2*pf.psi_; + rho0_ = molr1*rho0_ - molr2*pf.rho0_; +} + + +template +inline void Foam::linear::operator*=(const scalar s) +{ + Specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +inline Foam::linear Foam::operator+ +( + const linear& pf1, + const linear& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst + ( + static_cast(pf1) + + static_cast(pf2), + molr1*pf1.psi_ + molr2*pf2.psi_, + molr1*pf1.rho0_ + molr2*pf2.rho0_ + ); +} + + +template +inline Foam::linear Foam::operator- +( + const linear& pf1, + const linear& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst + ( + static_cast(pf1) + - static_cast(pf2), + molr1*pf1.psi_ - molr2*pf2.psi_, + molr1*pf1.rho0_ - molr2*pf2.rho0_ + ); +} + + +template +inline Foam::linear Foam::operator* +( + const scalar s, + const linear& pf +) +{ + return linear + ( + s*static_cast(pf), + pf.psi_, + pf.rho0_ + ); +} + + +template +inline Foam::linear Foam::operator== +( + const linear& pf1, + const linear& pf2 +) +{ + return pf2 - pf1; +} + + +// ************************************************************************* // diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake index 21078c07fd..60db98b2d8 100755 --- a/src/transportModels/Allwmake +++ b/src/transportModels/Allwmake @@ -3,9 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} set -x -wmake $makeType incompressible wmake $makeType interfaceProperties -wmake $makeType twoPhaseInterfaceProperties -# wmake $makeType compressible +wmake $makeType twoPhaseProperties +wmake $makeType incompressible # ----------------------------------------------------------------- end-of-file diff --git a/src/transportModels/incompressible/Make/files b/src/transportModels/incompressible/Make/files index 898a3c648c..76baf5df24 100644 --- a/src/transportModels/incompressible/Make/files +++ b/src/transportModels/incompressible/Make/files @@ -9,6 +9,6 @@ viscosityModels/HerschelBulkley/HerschelBulkley.C transportModel/transportModel.C singlePhaseTransportModel/singlePhaseTransportModel.C -incompressibleTwoPhaseMixture/twoPhaseMixture.C +incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C LIB = $(FOAM_LIBBIN)/libincompressibleTransportModels diff --git a/src/transportModels/incompressible/Make/options b/src/transportModels/incompressible/Make/options index a412632ebb..2ae73705d2 100644 --- a/src/transportModels/incompressible/Make/options +++ b/src/transportModels/incompressible/Make/options @@ -1,6 +1,8 @@ EXE_INC = \ -I.. \ + -I../twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ + -ltwoPhaseProperties \ -lfiniteVolume diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C similarity index 80% rename from src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C rename to src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C index 7ff4e9d2ce..98046c9b76 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "addToRunTimeSelectionTable.H" #include "surfaceFields.H" #include "fvc.H" @@ -32,7 +32,7 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // //- Calculate and return the laminar viscosity -void Foam::twoPhaseMixture::calcNu() +void Foam::incompressibleTwoPhaseMixture::calcNu() { nuModel1_->correct(); nuModel2_->correct(); @@ -50,7 +50,7 @@ void Foam::twoPhaseMixture::calcNu() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::twoPhaseMixture::twoPhaseMixture +Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture ( const volVectorField& U, const surfaceScalarField& phi, @@ -59,16 +59,14 @@ Foam::twoPhaseMixture::twoPhaseMixture ) : transportModel(U, phi), - - phase1Name_(found("phases") ? wordList(lookup("phases"))[0] : "phase1"), - phase2Name_(found("phases") ? wordList(lookup("phases"))[1] : "phase2"), + twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name), nuModel1_ ( viscosityModel::New ( "nu1", - subDict(phase1Name_), + subDict(phase1Name_ == "1" ? "phase1": phase1Name_), U, phi ) @@ -78,7 +76,7 @@ Foam::twoPhaseMixture::twoPhaseMixture viscosityModel::New ( "nu2", - subDict(phase2Name_), + subDict(phase2Name_ == "2" ? "phase2": phase2Name_), U, phi ) @@ -90,30 +88,6 @@ Foam::twoPhaseMixture::twoPhaseMixture U_(U), phi_(phi), - alpha1_ - ( - IOobject - ( - found("phases") ? word("alpha" + phase1Name_) : alpha1Name, - U_.time().timeName(), - U_.db(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - U_.mesh() - ), - - alpha2_ - ( - IOobject - ( - found("phases") ? word("alpha" + phase2Name_) : alpha2Name, - U_.time().timeName(), - U_.db() - ), - 1.0 - alpha1_ - ), - nu_ ( IOobject @@ -133,7 +107,8 @@ Foam::twoPhaseMixture::twoPhaseMixture // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::tmp Foam::twoPhaseMixture::mu() const +Foam::tmp +Foam::incompressibleTwoPhaseMixture::mu() const { const volScalarField limitedAlpha1 ( @@ -152,7 +127,8 @@ Foam::tmp Foam::twoPhaseMixture::mu() const } -Foam::tmp Foam::twoPhaseMixture::muf() const +Foam::tmp +Foam::incompressibleTwoPhaseMixture::muf() const { const surfaceScalarField alpha1f ( @@ -171,7 +147,8 @@ Foam::tmp Foam::twoPhaseMixture::muf() const } -Foam::tmp Foam::twoPhaseMixture::nuf() const +Foam::tmp +Foam::incompressibleTwoPhaseMixture::nuf() const { const surfaceScalarField alpha1f ( @@ -192,7 +169,7 @@ Foam::tmp Foam::twoPhaseMixture::nuf() const } -bool Foam::twoPhaseMixture::read() +bool Foam::incompressibleTwoPhaseMixture::read() { if (transportModel::read()) { diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H similarity index 77% rename from src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H rename to src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H index 7dca526d67..8dad648320 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H @@ -22,23 +22,23 @@ License along with OpenFOAM. If not, see . Class - Foam::twoPhaseMixture + Foam::incompressibleTwoPhaseMixture Description A two-phase incompressible transportModel SourceFiles - twoPhaseMixture.C + incompressibleTwoPhaseMixture.C \*---------------------------------------------------------------------------*/ -#ifndef twoPhaseMixture_H -#define twoPhaseMixture_H +#ifndef incompressibleTwoPhaseMixture_H +#define incompressibleTwoPhaseMixture_H #include "incompressible/transportModel/transportModel.H" #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H" -#include "dimensionedScalar.H" -#include "volFields.H" +#include "twoPhaseMixture.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,20 +46,18 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class twoPhaseMixture Declaration + Class incompressibleTwoPhaseMixture Declaration \*---------------------------------------------------------------------------*/ -class twoPhaseMixture +class incompressibleTwoPhaseMixture : - public transportModel + public transportModel, + public twoPhaseMixture { protected: // Protected data - word phase1Name_; - word phase2Name_; - autoPtr nuModel1_; autoPtr nuModel2_; @@ -69,9 +67,6 @@ protected: const volVectorField& U_; const surfaceScalarField& phi_; - volScalarField alpha1_; - volScalarField alpha2_; - volScalarField nu_; @@ -86,7 +81,7 @@ public: // Constructors //- Construct from components - twoPhaseMixture + incompressibleTwoPhaseMixture ( const volVectorField& U, const surfaceScalarField& phi, @@ -96,46 +91,12 @@ public: //- Destructor - ~twoPhaseMixture() + virtual ~incompressibleTwoPhaseMixture() {} // Member Functions - const word phase1Name() const - { - return phase1Name_; - } - - const word phase2Name() const - { - return phase2Name_; - } - - //- Return the phase-fraction of phase 1 - const volScalarField& alpha1() const - { - return alpha1_; - } - - //- Return the phase-fraction of phase 1 - volScalarField& alpha1() - { - return alpha1_; - } - - //- Return the phase-fraction of phase 2 - const volScalarField& alpha2() const - { - return alpha2_; - } - - //- Return the phase-fraction of phase 2 - volScalarField& alpha2() - { - return alpha2_; - } - //- Return const-access to phase1 viscosityModel const viscosityModel& nuModel1() const { diff --git a/src/transportModels/interfaceProperties/Make/options b/src/transportModels/interfaceProperties/Make/options index d8c038aad0..4636e26540 100644 --- a/src/transportModels/interfaceProperties/Make/options +++ b/src/transportModels/interfaceProperties/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = -lfiniteVolume diff --git a/src/transportModels/twoPhaseInterfaceProperties/Make/files b/src/transportModels/twoPhaseProperties/Make/files similarity index 83% rename from src/transportModels/twoPhaseInterfaceProperties/Make/files rename to src/transportModels/twoPhaseProperties/Make/files index 647a00e2ba..e7f6e04872 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/Make/files +++ b/src/transportModels/twoPhaseProperties/Make/files @@ -1,7 +1,9 @@ +twoPhaseMixture/twoPhaseMixture.C + alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C -LIB = $(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties +LIB = $(FOAM_LIBBIN)/libtwoPhaseProperties diff --git a/src/transportModels/twoPhaseInterfaceProperties/Make/options b/src/transportModels/twoPhaseProperties/Make/options similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/Make/options rename to src/transportModels/twoPhaseProperties/Make/options diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H similarity index 100% rename from src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.C b/src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.C similarity index 56% rename from applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.C rename to src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.C index 41ed49322b..7b95752f37 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.C +++ b/src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,31 +23,55 @@ License \*---------------------------------------------------------------------------*/ -#include "phaseEquationOfState.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(phaseEquationOfState, 0); - defineRunTimeSelectionTable(phaseEquationOfState, dictionary); -} +#include "twoPhaseMixture.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::phaseEquationOfState::phaseEquationOfState +Foam::twoPhaseMixture::twoPhaseMixture ( - const dictionary& dict + const fvMesh& mesh, + const dictionary& dict, + const word& alpha1Name, + const word& alpha2Name ) : - dict_(dict) -{} + phase1Name_ + ( + dict.found("phases") + ? wordList(dict.lookup("phases"))[0] + : "1" + ), + phase2Name_ + ( + dict.found("phases") + ? wordList(dict.lookup("phases"))[1] + : "2" + ), + alpha1_ + ( + IOobject + ( + dict.found("phases") ? word("alpha" + phase1Name_) : alpha1Name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ), -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationOfState::~phaseEquationOfState() + alpha2_ + ( + IOobject + ( + dict.found("phases") ? word("alpha" + phase2Name_) : alpha2Name, + mesh.time().timeName(), + mesh + ), + 1.0 - alpha1_ + ) {} diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H b/src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.H similarity index 56% rename from applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H rename to src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.H index 49f5218e49..668c4f2cfd 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H +++ b/src/transportModels/twoPhaseProperties/twoPhaseMixture/twoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,90 +22,102 @@ License along with OpenFOAM. If not, see . Class - Foam::phaseEquationsOfState::adiabaticPerfectFluid + Foam::twoPhaseMixture Description - AdiabaticPerfectFluid phase density model. + A two-phase mixture model SourceFiles - adiabaticPerfectFluid.C + twoPhaseMixture.C \*---------------------------------------------------------------------------*/ -#ifndef adiabaticPerfectFluid_H -#define adiabaticPerfectFluid_H +#ifndef twoPhaseMixture_H +#define twoPhaseMixture_H -#include "phaseEquationOfState.H" -#include "dimensionedTypes.H" +#include "volFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace phaseEquationsOfState -{ /*---------------------------------------------------------------------------*\ - Class adiabaticPerfectFluid Declaration + Class twoPhaseMixture Declaration \*---------------------------------------------------------------------------*/ -class adiabaticPerfectFluid -: - public phaseEquationOfState +class twoPhaseMixture { - // Private data +protected: - //- Reference pressure - dimensionedScalar p0_; + // Protected data - //- Reference density - dimensionedScalar rho0_; + word phase1Name_; + word phase2Name_; - //- The isentropic exponent - dimensionedScalar gamma_; - - //- Pressure offset for a stiffened gas - dimensionedScalar B_; + volScalarField alpha1_; + volScalarField alpha2_; public: - //- Runtime type information - TypeName("adiabaticPerfectFluid"); - - // Constructors //- Construct from components - adiabaticPerfectFluid + twoPhaseMixture ( - const dictionary& dict + const fvMesh& mesh, + const dictionary& dict, + const word& alpha1Name = "alpha1", + const word& alpha2Name = "alpha2" ); //- Destructor - virtual ~adiabaticPerfectFluid(); + ~twoPhaseMixture() + {} // Member Functions - tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const; + const word phase1Name() const + { + return phase1Name_; + } - tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const; + const word phase2Name() const + { + return phase2Name_; + } + + //- Return the phase-fraction of phase 1 + const volScalarField& alpha1() const + { + return alpha1_; + } + + //- Return the phase-fraction of phase 1 + volScalarField& alpha1() + { + return alpha1_; + } + + //- Return the phase-fraction of phase 2 + const volScalarField& alpha2() const + { + return alpha2_; + } + + //- Return the phase-fraction of phase 2 + volScalarField& alpha2() + { + return alpha2_; + } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace phaseEquationsOfState } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org index e5ac2eeb27..ce47bfaefc 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object alpha1; + object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties index 3c26cf1692..9c14314414 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties @@ -15,5 +15,10 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +phases (water air); + +pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000; + +sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties deleted file mode 100644 index 78f85f47a2..0000000000 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object transportProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -phases (water air); - -water -{ - transportModel Newtonian; - nu 1e-06; - rho 1000; -} - -air -{ - transportModel Newtonian; - nu 1.589e-05; - rho 1; -} - -pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000; - -sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07; - - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties index a925d3cc2b..c2c3b28a1b 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType LESModel; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes index 0c204f053f..469090b5e0 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(rho*phi,T) Gauss upwind; div(rho*phi,K) Gauss upwind; div(phi,k) Gauss vanLeer; - div((muEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org index b40cb08478..82284f267f 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object alpha1; + object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties index a925d3cc2b..c2c3b28a1b 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType LESModel; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes index 903d94d30c..469090b5e0 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes @@ -33,8 +33,9 @@ divSchemes div(phid1,p_rgh) Gauss upwind; div(phid2,p_rgh) Gauss upwind; div(rho*phi,T) Gauss upwind; + div(rho*phi,K) Gauss upwind; div(phi,k) Gauss vanLeer; - div((muEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution index 4618974546..9066c1c700 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution @@ -39,7 +39,7 @@ solvers maxIter 100; } - "(rho|rhoFinal)" + ".*(rho|rhoFinal)" { solver diagonal; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater index 672b24a98b..43cb59fafa 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater @@ -31,11 +31,12 @@ mixture specie { nMoles 1; - molWeight 28.9; + molWeight 18; } equationOfState { rho0 1027; + R 3000; } thermodynamics { diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 index 672b24a98b..43cb59fafa 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 @@ -31,11 +31,12 @@ mixture specie { nMoles 1; - molWeight 28.9; + molWeight 18; } equationOfState { rho0 1027; + R 3000; } thermodynamics {