diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 3d2c18e6684fa8a570f5a5b3f23ff80489bd3809..b58df5402e39ac354eadf4f075ca861156d595b9 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "psiThermo.H" +#include "rhoThermo.H" #include "RASModel.H" #include "radiationModel.H" #include "simpleControl.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index bb7a65cb1d28ac920674974f91563447637874e1..ffbf0059161793005bff91d76c7f28d69d0e72f6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -1,10 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<psiThermo> pThermo + autoPtr<rhoThermo> pThermo ( - psiThermo::New(mesh) + rhoThermo::New(mesh) ); - psiThermo& thermo = pThermo(); + rhoThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); volScalarField rho diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..51232bf0bec20f7dfead229401a45bc5ca2ec706 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/EEqn.H @@ -0,0 +1,34 @@ +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix EEqn + ( + fvm::ddt(rho, he) + fvm::div(phi, he) + + fvc::ddt(rho, K) + fvc::div(phi, K) + + ( + he.name() == "e" + ? fvc::div + ( + fvc::absolute(phi/fvc::interpolate(rho), U), + p, + "div(phiv,p)" + ) + : -dpdt + ) + - fvm::laplacian(alphaEff, he) + == + radiation->Sh(thermo) + + fvOptions(rho, he) + ); + + EEqn.relax(); + + fvOptions.constrain(EEqn); + + EEqn.solve(); + + fvOptions.correct(he); + + thermo.correct(); + radiation->correct(); +} diff --git a/applications/solvers/heatTransfer/thermoFoam/Make/files b/applications/solvers/heatTransfer/thermoFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..825ed0cba8ac5e0819ccb568cc7541d5f8085262 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/Make/files @@ -0,0 +1,3 @@ +thermoFoam.C + +EXE = $(FOAM_APPBIN)/thermoFoam diff --git a/applications/solvers/heatTransfer/thermoFoam/Make/options b/applications/solvers/heatTransfer/thermoFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..14bd0d4d24e9b7a22d0c57a8686ea26bd394c681 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/Make/options @@ -0,0 +1,24 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lsampling \ + -lmeshTools \ + -lfvOptions \ + -lfluidThermophysicalModels \ + -lradiationModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels diff --git a/applications/solvers/heatTransfer/thermoFoam/createFields.H b/applications/solvers/heatTransfer/thermoFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..ffa6c3f3b52113c56d4bc5329c218a1c57f25162 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/createFields.H @@ -0,0 +1,54 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh)); + rhoThermo& thermo = pThermo(); + thermo.validate(args.executable(), "h", "e"); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + thermo.rho() + ); + + volScalarField& p = thermo.p(); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + #include "setAlphaEff.H" + + Info<< "Creating field dpdt\n" << endl; + volScalarField dpdt + ( + IOobject + ( + "dpdt", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) + ); + + Info<< "Creating field kinetic energy K\n" << endl; + volScalarField K("K", 0.5*magSqr(U)); diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H new file mode 100644 index 0000000000000000000000000000000000000000..90b475794b6340365f969f978d14d52811b60d4c --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -0,0 +1,93 @@ + Info<< "Creating turbulence model\n" << endl; + tmp<volScalarField> talphaEff; + + IOobject turbulenceHeader + ( + "turbulenceProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + IOobject RASHeader + ( + "RASProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + IOobject LESHeader + ( + "LESProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ); + + if (turbulenceHeader.headerOk()) + { + autoPtr<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (RASHeader.headerOk()) + { + autoPtr<compressible::RASModel> turbulence + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (LESHeader.headerOk()) + { + autoPtr<compressible::LESModel> turbulence + ( + compressible::LESModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else + { + talphaEff = tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "alphaEff", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0) + ) + ); + } + + const volScalarField& alphaEff = talphaEff(); diff --git a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..f5f88232d2c1fbd9a7bd8fe6d431a99020b848d6 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Application + thermoFoam + +Description + Evolves the thermodynamics on a forzen flow field + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "rhoThermo.H" +#include "turbulenceModel.H" +#include "RASModel.H" +#include "LESModel.H" +#include "radiationModel.H" +#include "fvIOoptionList.H" +#include "simpleControl.H" +#include "pimpleControl.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "createFvOptions.H" + #include "createRadiationModel.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nEvolving thermodynamics\n" << endl; + + if (mesh.solutionDict().found("SIMPLE")) + { + simpleControl simple(mesh); + + while (simple.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + while (simple.correctNonOrthogonal()) + { + #include "EEqn.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + runTime.write(); + } + } + else + { + pimpleControl pimple(mesh); + + while (runTime.run()) + { + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + while (pimple.correctNonOrthogonal()) + { + #include "EEqn.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + runTime.write(); + } + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 0f2981ab4c1f723977c143543a9dc22fd2710109..2689ed5ab6574ac4a65e57fefa8406fe8f79abe5 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 fa204ce58f0fdee1455d5339c34ad633135d2ac3..a195aa677494fd08d28d714bb6a33f6e02f3f7de 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 45bc766761a0270ce9458fa1648b2cdb3d105c51..cf608d0a6ab498e18bbd55fae57409bc9e9738fb 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.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) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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/cavitatingDyMFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H index a4e9e0b40f6c77500d7b55adad6daa8d399c3279..3c4cbb0d32e48f0ff38415408ec669119b4f9f03 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H @@ -4,8 +4,8 @@ p = ( rho - - (1.0 - gamma)*rhol0 - - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat + - gamma2*rhol0 + - ((gamma*psiv + gamma2*psil) - psi)*pSat )/psi; } @@ -57,8 +57,8 @@ p = ( rho - - (1.0 - gamma)*rhol0 - - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat + - gamma2*rhol0 + - ((gamma*psiv + gamma2*psil) - psi)*pSat )/psi; p.correctBoundaryConditions(); diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 256a58d95339b7bb657d697fcef46223a1d38acc..73e9577029b89c186478b4a211cbff054f69d5e6 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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/continuityErrs.H b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H index c5e93c7efb3d537892e22228143b8103e9ce3a21..ce618ee40f2c3a04bf660d08c385389ecdebd570 100644 --- a/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H +++ b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H @@ -1,5 +1,5 @@ { - volScalarField thermoRho = psi*p + (1.0 - gamma)*rhol0; + volScalarField thermoRho = psi*p + gamma2*rhol0; dimensionedScalar totalMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H index dbacf1dbd3f1c416bffccc6e2c3b5e7f67d4baf0..8958dc3c5ed261572dd3a34ee118de9038bb7cc0 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createFields.H +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -44,11 +44,13 @@ Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phiv, "gamma"); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma"); volScalarField& gamma(twoPhaseProperties.alpha1()); gamma.oldTime(); + volScalarField& gamma2(twoPhaseProperties.alpha2()); + Info<< "Creating compressibilityModel\n" << endl; autoPtr<barotropicCompressibilityModel> psiModel = barotropicCompressibilityModel::New @@ -62,8 +64,8 @@ rho == max ( psi*p - + (1.0 - gamma)*rhol0 - + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + + gamma2*rhol0 + + ((gamma*psiv + gamma2*psil) - psi)*pSat, rhoMin ); diff --git a/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H b/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H index b259ddd3222ff00fe49a83854a1bcae1e84ba240..4edda7336de09a5e212dbded85bcc70c2ddee6dc 100644 --- a/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H +++ b/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H @@ -1,5 +1,6 @@ { gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0)); + gamma2 = 1.0 - gamma; Info<< "max-min gamma: " << max(gamma).value() << " " << min(gamma).value() << endl; diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index ea35f79fa14c505d87f62be95f2bab9fd1c56bf9..b2c7d953b5368b2b46adb91223c06d9ceab4242d 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -4,8 +4,8 @@ p = ( rho - - (1.0 - gamma)*rhol0 - - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat + - gamma2*rhol0 + - ((gamma*psiv + gamma2*psil) - psi)*pSat )/psi; } @@ -49,8 +49,8 @@ rho == max ( psi*p - + (1.0 - gamma)*rhol0 - + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + + gamma2*rhol0 + + ((gamma*psiv + gamma2*psil) - psi)*pSat, rhoMin ); @@ -59,8 +59,8 @@ p = ( rho - - (1.0 - gamma)*rhol0 - - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat + - gamma2*rhol0 + - ((gamma*psiv + gamma2*psil) - psi)*pSat )/psi; p.correctBoundaryConditions(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index 2f4544cb4c0a192b4a83d7f39729bed83de3a23e..aa0f3c01c6ba74c8d0cd77ee40e09214002110f6 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wclean libso phaseEquationsOfState +wclean libso twoPhaseMixtureThermo wclean wclean compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index d372dbe7304ca6e36168eb979318cdd21293f439..a93da26cddb8cbeb7421c7bf086ef7ef86241fc4 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -2,8 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso phaseEquationsOfState -wmake libso twoPhaseThermo +wmake libso twoPhaseMixtureThermo wmake wmake compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index a6a130754a20800314f89a91ac4ae1a5dbf556d7..147bf40e5b33b4ad18c248fa683c027547fbc220 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -1,20 +1,18 @@ EXE_INC = \ - -ItwoPhaseThermo \ + -ItwoPhaseMixtureThermo \ -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 \ + -ltwoPhaseMixtureThermo \ -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 d5183d5c4e9aee2f84882b39b1dce1736b4e5fcf..92a2bd64d8f5d5b1317e54f80370ae06d87e46b1 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 1c216a8bf7668894e57f08e4e80169c50b5fbfd9..8fc397e8020c8d6c0786192d39dc386d57c0af4f 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 48c21dfee59ebc6d83fd04bc213f36c2e5cd89df..3ee1e97f92e640bb2a4dc21ba8034d646db71f34 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -1,29 +1,25 @@ EXE_INC = \ -I.. \ - -I../twoPhaseThermo \ + -I../twoPhaseMixtureThermo \ -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 \ + -ltwoPhaseMixtureThermo \ -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/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index 3cb787d144ef9369a5ded2416de6469ba43c3333..27d3b87cd1d676f267f5bf811ea297dc3a7cf2e2 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -43,7 +43,7 @@ Description #include "subCycle.H" #include "interfaceProperties.H" #include "twoPhaseMixture.H" -#include "twoPhaseThermo.H" +#include "twoPhaseMixtureThermo.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 85cab52cdb22999435645e3442e4afcaa2744fd8..3148382ad2e23cb2ddc774dd7064b8bc28ce8c38 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -41,7 +41,7 @@ Description #include "rhoThermo.H" #include "interfaceProperties.H" #include "twoPhaseMixture.H" -#include "twoPhaseThermo.H" +#include "twoPhaseMixtureThermo.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index e31e4c34bf94f221be73b269e4f1641e74d6e065..102d4d57a99a8bfa111eaca227399c27d2066935 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -28,43 +28,33 @@ #include "createPhi.H" - Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + Info<< "Constructing twoPhaseMixtureThermo\n" << endl; + twoPhaseMixtureThermo twoPhaseProperties(mesh); volScalarField& alpha1(twoPhaseProperties.alpha1()); - - Info<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name() - << nl << endl; - volScalarField alpha2 - ( - "alpha" + twoPhaseProperties.phase2Name(), - scalar(1) - alpha1 - ); + volScalarField& alpha2(twoPhaseProperties.alpha2()); Info<< "Reading thermophysical properties\n" << endl; - twoPhaseThermo thermo(mesh, alpha1, alpha2); - - 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& 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 + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + alpha1*rho1 + alpha2*rho2 + ); dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); @@ -97,10 +87,10 @@ // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); - // Construct incompressible turbulence model - autoPtr<incompressible::turbulenceModel> turbulence + // Construct compressible turbulence model + autoPtr<compressible::turbulenceModel> 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 dba9058f30bcf16faffe99c04c470285bf51c537..71745c0168b7bd70b0e8aa6d8ca376c92ab0bdfd 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 e6e260c74a68a195bde00195048386638e1c11f7..0000000000000000000000000000000000000000 --- 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 0ec11392098bd862e78e2790e25cf1f49ec557fd..0000000000000000000000000000000000000000 --- 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 82a195dca955430147ad60e125aeb61721a83a7c..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#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::volScalarField> -Foam::phaseEquationsOfState::adiabaticPerfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - 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::volScalarField> -Foam::phaseEquationsOfState::adiabaticPerfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - 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 54b6705dd9e1597cf6c37bbbaa02bef1ed5c9492..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#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::volScalarField> Foam::phaseEquationsOfState::constant::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - rho_ - ) - ); -} - - -Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::constant::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - 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 5cfe44c26e4546d5f6f19803fdaf63dd98eb5cc6..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -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<volScalarField> rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp<volScalarField> 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 3680735a1bccfa2d61f1dc1abe980ee4db2a8e42..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#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::volScalarField> Foam::phaseEquationsOfState::linear::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi_*p - ) - ); -} - - -Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::linear::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - 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 d357bb3ec08884a45571588abb6353907bcc49c5..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -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<volScalarField> rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp<volScalarField> 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 6a148d8d689a77c28b511265ce55255c0e34b725..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#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::volScalarField> Foam::phaseEquationsOfState::perfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi(p, T)*p - ) - ); -} - - -Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::perfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp<Foam::volScalarField> - ( - 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 b854f1d84fb6b7ed6a2d7c1ae399f7fa1c9eeaef..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -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<volScalarField> rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp<volScalarField> 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 3d9a842a9f31e171e5901c3ac5322f7d4bf1372a..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "phaseEquationOfState.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::phaseEquationOfState> 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 45a5079d0d98671696515eb1deed507b3cfcf881..0000000000000000000000000000000000000000 --- 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 <http://www.gnu.org/licenses/>. - -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<phaseEquationOfState> New - ( - const dictionary& dict - ); - - - // Member Functions - - //- Return the phase density - virtual tmp<volScalarField> rho - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; - - //- Return the phase compressibility - virtual tmp<volScalarField> psi - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..1cd0a09577c241265ce500c16b0df145a4aa3b2c --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files @@ -0,0 +1,3 @@ +twoPhaseMixtureThermo.C + +LIB = $(FOAM_LIBBIN)/libtwoPhaseMixtureThermo diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options similarity index 67% rename from applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options rename to applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options index eab8cce15dde3c729b68afecb9510af3bb5967e1..e2c67263b8ed2e6cfa28f05d87603cc525677e28 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options @@ -1,8 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ -lfluidThermophysicalModels \ -lspecie \ + -ltwoPhaseProperties \ -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..d81f5ccb1f249ff004711bfaeef3ca9bf4049ae0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -0,0 +1,335 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "twoPhaseMixtureThermo.H" +#include "gradientEnergyFvPatchScalarField.H" +#include "mixedEnergyFvPatchScalarField.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(twoPhaseMixtureThermo, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo +( + const fvMesh& mesh +) +: + psiThermo(mesh, word::null), + twoPhaseMixture(mesh, *this), + thermo1_(NULL), + thermo2_(NULL) +{ + { + volScalarField T1("T" + phase1Name(), T_); + T1.write(); + } + + { + volScalarField T2("T" + phase2Name(), T_); + T2.write(); + } + + thermo1_ = rhoThermo::New(mesh, phase1Name()); + thermo2_ = rhoThermo::New(mesh, phase2Name()); + + thermo1_->validate(phase1Name(), "e"); + thermo2_->validate(phase2Name(), "e"); + + correct(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::twoPhaseMixtureThermo::~twoPhaseMixtureThermo() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::twoPhaseMixtureThermo::correct() +{ + thermo1_->he() = thermo1_->he(p_, T_); + thermo1_->correct(); + + thermo2_->he() = thermo2_->he(p_, T_); + thermo2_->correct(); + + psi_ = alpha1()*thermo1_->psi() + alpha2()*thermo2_->psi(); + mu_ = alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu(); + alpha_ = alpha1()*thermo1_->alpha() + alpha2()*thermo2_->alpha(); +} + + +bool Foam::twoPhaseMixtureThermo::incompressible() const +{ + return thermo1_->incompressible() && thermo2_->incompressible(); +} + + +bool Foam::twoPhaseMixtureThermo::isochoric() const +{ + return thermo1_->isochoric() && thermo2_->isochoric(); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::he +( + const volScalarField& p, + const volScalarField& T +) const +{ + return alpha1()*thermo1_->he(p, T) + alpha2()*thermo2_->he(p, T); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::he +( + const scalarField& p, + const scalarField& T, + const labelList& cells +) const +{ + return + scalarField(alpha1(), cells)*thermo1_->he(p, T, cells) + + scalarField(alpha2(), cells)*thermo2_->he(p, T, cells); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::he +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::hc() const +{ + return alpha1()*thermo1_->hc() + alpha2()*thermo2_->hc(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::THE +( + const scalarField& h, + const scalarField& p, + const scalarField& T0, + const labelList& cells +) const +{ + notImplemented("twoPhaseMixtureThermo::THE(...)"); + return T0; +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::THE +( + const scalarField& h, + const scalarField& p, + const scalarField& T0, + const label patchi +) const +{ + notImplemented("twoPhaseMixtureThermo::THE(...)"); + return T0; +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cp() const +{ + return alpha1()*thermo1_->Cp() + alpha2()*thermo2_->Cp(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cp +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cv() const +{ + return alpha1()*thermo1_->Cv() + alpha2()*thermo2_->Cv(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cv +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::gamma() const +{ + return alpha1()*thermo1_->gamma() + alpha2()*thermo2_->gamma(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::gamma +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cpv() const +{ + return alpha1()*thermo1_->Cpv() + alpha2()*thermo2_->Cpv(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cpv +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::CpByCpv() const +{ + return + alpha1()*thermo1_->CpByCpv() + + alpha2()*thermo2_->CpByCpv(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::CpByCpv +( + const scalarField& p, + const scalarField& T, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::kappa() const +{ + return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa(); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappa +( + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi) + + alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::kappaEff +( + const volScalarField& alphat +) const +{ + return + alpha1()*thermo1_->kappaEff(alphat) + + alpha2()*thermo2_->kappaEff(alphat); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappaEff +( + const scalarField& alphat, + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi) + ; +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::alphaEff +( + const volScalarField& alphat +) const +{ + return + alpha1()*thermo1_->alphaEff(alphat) + + alpha2()*thermo2_->alphaEff(alphat); +} + + +Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::alphaEff +( + const scalarField& alphat, + const label patchi +) const +{ + return + 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/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H similarity index 89% rename from applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H rename to applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index cfbada321b36206a2736abe7c789673c0e564ab3..b2e636a4c471ac92b490aa58f1084b72c6dc3888 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -22,21 +22,23 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::twoPhaseThermo + Foam::twoPhaseMixtureThermo Description SourceFiles - twoPhaseThermoI.H - twoPhaseThermo.C - twoPhaseThermoIO.C + twoPhaseMixtureThermoI.H + twoPhaseMixtureThermo.C + twoPhaseMixtureThermoIO.C \*---------------------------------------------------------------------------*/ -#ifndef twoPhaseThermo_H -#define twoPhaseThermo_H +#ifndef twoPhaseMixtureThermo_H +#define twoPhaseMixtureThermo_H #include "rhoThermo.H" +#include "psiThermo.H" +#include "twoPhaseMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,57 +46,40 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class twoPhaseThermo Declaration + Class twoPhaseMixtureThermo Declaration \*---------------------------------------------------------------------------*/ -class twoPhaseThermo +class twoPhaseMixtureThermo : - public rhoThermo + public psiThermo, + public twoPhaseMixture { // Private data - //- Name of phase 1 - word phaseName1_; - - //- Name of phase 2 - word phaseName2_; - - //- Phase-fraction of phase 1 - const volScalarField& alpha1_; - - //- Phase-fraction of phase2 - const volScalarField& alpha2_; - //- Thermo-package of phase 1 autoPtr<rhoThermo> thermo1_; //- Thermo-package of phase 2 autoPtr<rhoThermo> thermo2_; - //- Energy field - volScalarField he_; - public: //- Runtime type information - TypeName("twoPhaseThermo"); + TypeName("twoPhaseMixtureThermo"); // Constructors - //- Construct from mesh and phase fractions - twoPhaseThermo + //- Construct from mesh + twoPhaseMixtureThermo ( - const fvMesh&, - const volScalarField& alpha1, - const volScalarField& alpha2, - const word& phaseName=word::null + const fvMesh& mesh ); //- Destructor - virtual ~twoPhaseThermo(); + virtual ~twoPhaseMixtureThermo(); // Member Functions @@ -127,13 +112,15 @@ public: // Non-const access allowed for transport equations virtual volScalarField& he() { - return he_; + notImplemented("twoPhaseMixtureThermo::he()"); + return thermo1_->he(); } //- Enthalpy/Internal energy [J/kg] virtual const volScalarField& he() const { - return he_; + notImplemented("twoPhaseMixtureThermo::he() const"); + return thermo1_->he(); } //- Enthalpy/Internal energy diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/files b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/files deleted file mode 100644 index 64771e2f6ea0a4eadf36fc495f8e38129e289a9b..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -twoPhaseThermo.C - -LIB = $(FOAM_LIBBIN)/libtwoPhaseThermo diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C deleted file mode 100644 index e600ee328892cb85e12ab35e79f9e1b6d78ffb3c..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseThermo/twoPhaseThermo.C +++ /dev/null @@ -1,365 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "twoPhaseThermo.H" -#include "gradientEnergyFvPatchScalarField.H" -#include "mixedEnergyFvPatchScalarField.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(twoPhaseThermo, 0); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::twoPhaseThermo::twoPhaseThermo -( - const fvMesh& mesh, - const volScalarField& alpha1, - const volScalarField& alpha2, - const word& phaseName -) -: - rhoThermo(mesh, phaseName), - phaseName1_("1"), - phaseName2_("2"), - alpha1_(alpha1), - alpha2_(alpha2), - thermo1_(rhoThermo::New(mesh, phaseName1_)), - thermo2_(rhoThermo::New(mesh, phaseName2_)), - he_ - ( - IOobject - ( - phasePropertyName - ( - "he" - ), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimEnergy/dimMass, - heBoundaryTypes(), - heBoundaryBaseTypes() - ) -{ - thermo1_->validate("phaseModel 1", "e"); - thermo2_->validate("phaseModel 2", "e"); - - rho_ = alpha1_*thermo1_->rho() + alpha2_*thermo2_->rho(); - - he_ = - ( - alpha1_*thermo1_->rho()*thermo1_->he() - + alpha2_*thermo2_->rho()*thermo2_->he() - )/rho_; - - volScalarField::GeometricBoundaryField& hbf = he_.boundaryField(); - - forAll(hbf, patchi) - { - if (isA<gradientEnergyFvPatchScalarField>(hbf[patchi])) - { - refCast<gradientEnergyFvPatchScalarField>(hbf[patchi]).gradient() - = hbf[patchi].fvPatchField::snGrad(); - } - else if (isA<mixedEnergyFvPatchScalarField>(hbf[patchi])) - { - refCast<mixedEnergyFvPatchScalarField>(hbf[patchi]).refGrad() - = hbf[patchi].fvPatchField::snGrad(); - } - } - - correct(); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::twoPhaseThermo::~twoPhaseThermo() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::twoPhaseThermo::correct() -{ - thermo1_->he() = thermo1_->he(p_, T_); - thermo1_->correct(); - - thermo2_->he() = thermo2_->he(p_, T_); - thermo2_->correct(); - - psi_ = alpha1_*thermo1_->psi() + alpha2_*thermo2_->psi(); - mu_ = alpha1_*thermo1_->mu() + alpha2_*thermo2_->mu(); - alpha_ = alpha1_*thermo1_->alpha() + alpha2_*thermo2_->alpha(); -} - - -bool Foam::twoPhaseThermo::incompressible() const -{ - return thermo1_->incompressible() && thermo2_->incompressible(); -} - - -bool Foam::twoPhaseThermo::isochoric() const -{ - return thermo1_->isochoric() && thermo2_->isochoric(); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::he -( - const volScalarField& p, - const volScalarField& T -) const -{ - return alpha1_*thermo1_->he(p, T) + alpha2_*thermo2_->he(p, T); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he -( - const scalarField& p, - const scalarField& T, - const labelList& cells -) const -{ - return - scalarField(alpha1_, cells)*thermo1_->he(p, T, cells) - + scalarField(alpha2_, cells)*thermo2_->he(p, T, cells); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->he(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->he(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::hc() const -{ - return alpha1_*thermo1_->hc() + alpha2_*thermo2_->hc(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::THE -( - const scalarField& h, - const scalarField& p, - const scalarField& T0, - const labelList& cells -) const -{ - notImplemented("Foam::twoPhaseThermo::THE"); - return T0; -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::THE -( - const scalarField& h, - const scalarField& p, - const scalarField& T0, - const label patchi -) const -{ - notImplemented("Foam::twoPhaseThermo::THE"); - return T0; -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cp() const -{ - return alpha1_*thermo1_->Cp() + alpha2_*thermo2_->Cp(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cp -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->Cp(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->Cp(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cv() const -{ - return alpha1_*thermo1_->Cv() + alpha2_*thermo2_->Cv(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cv -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->Cv(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->Cv(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::gamma() const -{ - return alpha1_*thermo1_->gamma() + alpha2_*thermo2_->gamma(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::gamma -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->gamma(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->gamma(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cpv() const -{ - return alpha1_*thermo1_->Cpv() + alpha2_*thermo2_->Cpv(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cpv -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::CpByCpv() const -{ - return alpha1_*thermo1_->CpByCpv() + alpha2_*thermo2_->CpByCpv(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::CpByCpv -( - const scalarField& p, - const scalarField& T, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappa() const -{ - return alpha1_*thermo1_->kappa() + alpha2_*thermo2_->kappa(); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappa -( - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->kappa(patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->kappa(patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappaEff -( - const volScalarField& alphat -) const -{ - return - alpha1_*thermo1_->kappaEff(alphat) - + alpha2_*thermo2_->kappaEff(alphat); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappaEff -( - const scalarField& alphat, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi); -} - - -Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::alphaEff -( - const volScalarField& alphat -) const -{ - return - alpha1_*thermo1_->alphaEff(alphat) - + alpha2_*thermo2_->alphaEff(alphat); -} - - -Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::alphaEff -( - const scalarField& alphat, - const label patchi -) const -{ - return - alpha1_.boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi) - + alpha2_.boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 7580c3f9ac17fee77f35432ace060fd65c4470c2..3d1b93f429c460c6987f6260dc3a492d8b8f0926 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 b5c7b88e4f82a4f201b9b7e397402c11a2cd8fb9..6c173b8fd1ac0df3d64e1bd7a7de78a95621a733 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/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index 5f5ac824b8aacfdd77227f03bdcba07026870939..faae19767035025223dbd22b6be483d7dc6d6ace 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H @@ -18,7 +18,7 @@ ) + fvc::flux ( - -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), + -fvc::flux(-phir, alpha2, alpharScheme), alpha1, alpharScheme ) @@ -27,6 +27,7 @@ MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0); //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); + alpha2 = 1.0 - alpha1; rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; } diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index 6c82f940499ea39567db1e400274832dfa354b0f..57c78027a471f712cf06e17486b62fcd05cd3014 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -23,4 +23,4 @@ else #include "alphaEqn.H" } -rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; +rho == alpha1*rho1 + alpha2*rho2; diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 99cc1dd8bd62bd46a76fcb44f3ff89b5a83d822c..b819068ddd53f56d6af4456906466158eace7f51 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 b5c7b88e4f82a4f201b9b7e397402c11a2cd8fb9..6c173b8fd1ac0df3d64e1bd7a7de78a95621a733 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 b87380d8a1e515abe6dc6a27d643ef0f21d1e43b..4ea908240dd90ce5a457b165fe5316c92ef800a9 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/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index b96dcf898daaeaec279adcce7ac3f5916623089a..a2720e20eeec598b64ac4e783e175670069f98da 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -18,7 +18,7 @@ ) + fvc::flux ( - -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), + -fvc::flux(-phir, alpha2, alpharScheme), alpha1, alpharScheme ) @@ -26,6 +26,7 @@ MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); + alpha2 = 1.0 - alpha1; rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; } diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index 6c82f940499ea39567db1e400274832dfa354b0f..57c78027a471f712cf06e17486b62fcd05cd3014 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -23,4 +23,4 @@ else #include "alphaEqn.H" } -rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; +rho == alpha1*rho1 + alpha2*rho2; diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index df1edf04e1e4c1ef7f1cf802d4645bbe2c0ca122..f0d18098483634633a10f2c7ffb9068a06f91cb6 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -30,9 +30,10 @@ Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); volScalarField& alpha1(twoPhaseProperties.alpha1()); + volScalarField& alpha2(twoPhaseProperties.alpha2()); const dimensionedScalar& rho1 = twoPhaseProperties.rho1(); const dimensionedScalar& rho2 = twoPhaseProperties.rho2(); @@ -48,7 +49,7 @@ mesh, IOobject::READ_IF_PRESENT ), - alpha1*rho1 + (scalar(1) - alpha1)*rho2, + alpha1*rho1 + alpha2*rho2, alpha1.boundaryField().types() ); rho.oldTime(); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options index 4fa14dd6d22655aa1fe2a693c0055c1c9ca0662f..c8d0b93e4d0df93507bd254f20d83117584ebfab 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 1a9d210e23dd3df76df9c29f3b6e977a34d482ef..fa16f17141fa5b78af74044c339b792a90072798 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 53cc2719b93810902900bb6316a7d2a493fc6782..51f082b6165a6b494066241e7a988877eab86dd2 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 6c54b4454b840f8e0829378dedcbd0357cd67192..7630bc9b51402b10e84fb36d5aca8b27eb913bd1 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 b5c7b88e4f82a4f201b9b7e397402c11a2cd8fb9..6c173b8fd1ac0df3d64e1bd7a7de78a95621a733 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 ea1a15b03222b823fc93eed6ca22bfff3978bed4..39c81c7a8dc9fb58cc2bda021b6ed73177803688 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 5416a161a866fc1d66bd7b320079c1b5c7266fad..2d2a968f168efd946d74b673f5b52d35d422c7ac 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 f1e8feec003e46603286ec3dfe3ea47a8a8ca069..08728c8f926b94c29e68b2c78ea8d89d310fbcba 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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 3a7c4c7a53d3c01a44836d9d215e1aed4ed5cf26..c08eba939067edd6151c61816c6ac510b2f25ffc 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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 fdfe30d5e7e831a1d4230dc28863878f517a95a5..fc81d080d3e4211b00c5b9da76d2cff28c8763e8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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 6e20519ec98d90ae8f38ba26587a05c72e39374c..9a33b331cce534d63faa886aa957f9fad8e48cc6 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/alphaDiffusionEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H index 139646e43c6023c1486e3ee53dfdb0a14c63e158..6bc5953a4a6424f3bd28406e6f09ed88a8a30680 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H @@ -12,7 +12,8 @@ alpha1Eqn.solve(); + alpha2 = 1.0 - alpha1; rhoPhi += alpha1Eqn.flux()*(rho1 - rho2); } -rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; +rho = alpha1*rho1 + alpha2*rho2; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H index 6c82f940499ea39567db1e400274832dfa354b0f..57c78027a471f712cf06e17486b62fcd05cd3014 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H @@ -23,4 +23,4 @@ else #include "alphaEqn.H" } -rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; +rho == alpha1*rho1 + alpha2*rho2; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index 0d01b9a9e5ed82abc4a0420ece0ca464830b7b97..18b686f4f8afcfdcbf92f61f2e4f7c3a54d26893 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -29,9 +29,10 @@ #include "createPhi.H" Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); volScalarField& alpha1(twoPhaseProperties.alpha1()); + volScalarField& alpha2(twoPhaseProperties.alpha2()); const dimensionedScalar& rho1 = twoPhaseProperties.rho1(); const dimensionedScalar& rho2 = twoPhaseProperties.rho2(); @@ -42,7 +43,7 @@ dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab")); // Need to store rho for ddt(rho, U) - volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2); + volScalarField rho("rho", alpha1*rho1 + alpha2*rho2); rho.oldTime(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 6113aba01f1b42c4cda46109d3724f93fa4fdbda..8c51a402ee377d49a61b1429fbcfc4c7ddb34afc 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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 6fa4104188a79deb511308fe1cf34d9e80243768..43f0c24cb535928cd2280c59b22338245ddebd46 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/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C index 2f56ee07dea1f13086c13c4c1c33c266c102b183..f844195ae9356dea066207712b364dea3c7c0584 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,11 +42,20 @@ int main(int argc, char *argv[]) argList::validArgs.append("CHEMKINThermodynamicsFile"); argList::validArgs.append("FOAMChemistryFile"); argList::validArgs.append("FOAMThermodynamicsFile"); + + argList::addBoolOption + ( + "newFormat", + "read Chemkin thermo file in new format" + ); + argList args(argc, argv); + bool newFormat = args.optionFound("newFormat"); + speciesTable species; - chemkinReader cr(args[1], species, args[2]); + chemkinReader cr(args[1], species, args[2], newFormat); OFstream reactionsFile(args[3]); reactionsFile diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 27ad49aea859fac9b08a5abaed3711c06195a049..be510764fd5cade17fdfbe5f81a27020790a24a5 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -219,7 +219,7 @@ case ThirdParty: case Gcc++0x: case Gcc46: case Gcc46++0x: - set gcc_version=gcc-4.6.2 + set gcc_version=gcc-4.6.1 set gmp_version=gmp-5.0.4 set mpfr_version=mpfr-3.1.0 set mpc_version=mpc-0.9 @@ -238,17 +238,6 @@ case ThirdParty: set mpfr_version=mpfr-2.4.2 set mpc_version=mpc-0.8.1 breaksw - case Gcc44: - case Gcc44++0x: - set gcc_version=gcc-4.4.3 - set gmp_version=gmp-5.0.1 - set mpfr_version=mpfr-2.4.2 - breaksw - case Gcc43: - set gcc_version=gcc-4.3.3 - set gmp_version=gmp-4.2.4 - set mpfr_version=mpfr-2.4.1 - breaksw case Clang: # using clang - not gcc setenv WM_CC 'clang' diff --git a/etc/config/settings.sh b/etc/config/settings.sh index ad336dd871e0492cadfe1d3053de13d1857f4533..12d6f4b9004d13dbe48f3636234b14eef19b6cb0 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -240,12 +240,6 @@ fi case "${foamCompiler}" in OpenFOAM | ThirdParty) case "$WM_COMPILER" in - Gcc463) - gcc_version=gcc-4.6.3 - gmp_version=gmp-5.0.2 - mpfr_version=mpfr-3.0.1 - mpc_version=mpc-0.9 - ;; Gcc | Gcc++0x | Gcc46 | Gcc46++0x) gcc_version=gcc-4.6.1 gmp_version=gmp-5.0.4 @@ -264,16 +258,6 @@ OpenFOAM | ThirdParty) mpfr_version=mpfr-2.4.2 mpc_version=mpc-0.8.1 ;; - Gcc44 | Gcc44++0x) - gcc_version=gcc-4.4.3 - gmp_version=gmp-5.0.1 - mpfr_version=mpfr-2.4.2 - ;; - Gcc43) - gcc_version=gcc-4.3.3 - gmp_version=gmp-4.2.4 - mpfr_version=mpfr-2.4.1 - ;; Clang) # using clang - not gcc export WM_CC='clang' diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C index d207981fca2f4c4fb604390fad6137fd4bf2a183..5da9b8a19de35c99c505b506279af1af0bd3a98e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C @@ -52,6 +52,13 @@ Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir() const } +template<class Type> +Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::lockFile() const +{ + return fileName(baseDir()/(lockName + ".lock")); +} + + template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::createLockFile() const { @@ -65,7 +72,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::createLockFile() const Info<< type() << ": creating lock file" << endl; } - OFstream os(baseDir()/(lockName + ".lock")); + OFstream os(lockFile()); os << "waiting"; os.flush(); } @@ -84,7 +91,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::removeLockFile() const Info<< type() << ": removing lock file" << endl; } - rm(baseDir()/(lockName + ".lock")); + rm(lockFile()); } @@ -153,15 +160,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeAndWait os.flush(); } - const fileName lockFile(baseDir()/(lockName + ".lock")); - // remove lock file, signalling external source to execute removeLockFile(); if (log_) { - Info<< type() << ": beginning wait for lock file " << lockFile + Info<< type() << ": beginning wait for lock file " << lockFile() << endl; } @@ -189,13 +194,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeAndWait << " s" << abort(FatalError); } - IFstream is(lockFile); + IFstream is(lockFile()); if (is.good()) { if (log_) { - Info<< type() << ": found lock file " << lockFile << endl; + Info<< type() << ": found lock file " << lockFile() << endl; } found = true; @@ -438,8 +443,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::write(Ostream& os) const os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl; os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT << nl; - os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT - << nl; + os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl; os.writeKeyword("calcFrequency") << calcFrequency_ << token::END_STATEMENT << nl; os.writeKeyword("log") << log_ << token::END_STATEMENT << nl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H index 229d9bad6c33ebc16ae98faaff17b84eb3f27681..50376e097de456e9123a04202db210801cca4e1e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H @@ -47,7 +47,7 @@ Description $FOAM_CASE/comms/patchName/data.out - The lock file is then removed, instructing the exterbal source to take + The lock file is then removed, instructing the external source to take control of the program execution. When ready, the external program should create the return values, e.g. to file @@ -62,9 +62,9 @@ Description \table Property | Description | Required | Default value commsDir | communications folder | yes | - fileName | data transfer file name | yes | + fileName | transfer file name | yes | waitInterval | interval [s] between file checks | no | 1 - timeOut | time after which error invoked | no | 100*waitInterval + timeOut | time after which error invoked [s] |no |100*waitInterval calcFrequency | calculation frequency | no | 1 log | log program control | no | no \endtable @@ -137,6 +137,9 @@ protected: //- Return the file path to the base communications folder fileName baseDir() const; + //- Return the file path to the lock file + fileName lockFile() const; + //- Create lock file void createLockFile() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index be67f1829268a8dd7519f182512d64179bcdca32..68acada6cadd4ea245508d9e707cc652878bae4e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -372,8 +372,14 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration } // lists of parcels mass and distance from initial injection point - List<scalar> mass(nParcel, 0.0); - List<scalar> dist(nParcel, 0.0); + List<List<scalar> > procMass(Pstream::nProcs()); + List<List<scalar> > procDist(Pstream::nProcs()); + + List<scalar>& mass = procMass[Pstream::myProcNo()]; + List<scalar>& dist = procDist[Pstream::myProcNo()]; + + mass.setSize(nParcel); + dist.setSize(nParcel); label i = 0; scalar mSum = 0.0; @@ -392,75 +398,86 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration // calculate total mass across all processors reduce(mSum, sumOp<scalar>()); + Pstream::gatherList(procMass); + Pstream::gatherList(procDist); - // flatten the mass list - List<scalar> allMass(nParcelSum, 0.0); - SubList<scalar> - ( - allMass, - globalParcels.localSize(Pstream::myProcNo()), - globalParcels.offset(Pstream::myProcNo()) - ).assign(mass); - - // flatten the distance list - SortableList<scalar> allDist(nParcelSum, 0.0); - SubList<scalar> - ( - allDist, - globalParcels.localSize(Pstream::myProcNo()), - globalParcels.offset(Pstream::myProcNo()) - ).assign(dist); - - // sort allDist distances into ascending order - // note: allMass masses are left unsorted - allDist.sort(); - - if (nParcelSum > 1) + if (Pstream::master()) { - const scalar mLimit = fraction*mSum; - const labelList& indices = allDist.indices(); - - if (mLimit > (mSum - allMass[indices.last()])) + // flatten the mass lists + List<scalar> allMass(nParcelSum, 0.0); + SortableList<scalar> allDist(nParcelSum, 0.0); + for (label procI = 0; procI < Pstream::nProcs(); procI++) { - distance = allDist.last(); - } - else - { - // assuming that 'fraction' is generally closer to 1 than 0, loop - // through in reverse distance order - const scalar mThreshold = (1.0 - fraction)*mSum; - scalar mCurrent = 0.0; - label i0 = 0; + SubList<scalar> + ( + allMass, + globalParcels.localSize(procI), + globalParcels.offset(procI) + ).assign(procMass[procI]); - forAllReverse(indices, i) - { - label indI = indices[i]; + // flatten the distance list + SubList<scalar> + ( + allDist, + globalParcels.localSize(procI), + globalParcels.offset(procI) + ).assign(procDist[procI]); + } - mCurrent += allMass[indI]; + // sort allDist distances into ascending order + // note: allMass masses are left unsorted + allDist.sort(); - if (mCurrent > mThreshold) - { - i0 = i; - break; - } - } + if (nParcelSum > 1) + { + const scalar mLimit = fraction*mSum; + const labelList& indices = allDist.indices(); - if (i0 == indices.size() - 1) + if (mLimit > (mSum - allMass[indices.last()])) { distance = allDist.last(); } else { - // linearly interpolate to determine distance - scalar alpha = (mCurrent - mThreshold)/allMass[indices[i0]]; - distance = allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]); + // assuming that 'fraction' is generally closer to 1 than 0, + // loop through in reverse distance order + const scalar mThreshold = (1.0 - fraction)*mSum; + scalar mCurrent = 0.0; + label i0 = 0; + + forAllReverse(indices, i) + { + label indI = indices[i]; + + mCurrent += allMass[indI]; + + if (mCurrent > mThreshold) + { + i0 = i; + break; + } + } + + if (i0 == indices.size() - 1) + { + distance = allDist.last(); + } + else + { + // linearly interpolate to determine distance + scalar alpha = (mCurrent - mThreshold)/allMass[indices[i0]]; + distance = + allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]); + } } } + else + { + distance = allDist.first(); + } } - else - { - distance = allDist.first(); - } + + Pstream::scatter(distance); return distance; } diff --git a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C index 039e3fb2533849e36872836efe3c5d19d55a6de6..a502eb02fd6c206d351dca7f41348f3dc397b423 100644 --- a/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C +++ b/src/meshTools/coordinateSystems/coordinateRotation/axesRotation.C @@ -171,12 +171,7 @@ Foam::tmp<Foam::vectorField> Foam::axesRotation::transform const vectorField& st ) const { - notImplemented - ( - "tmp<vectorField> Foam::axesRotation:: " - "transform(const vectorField& st) const" - ); - return tmp<vectorField>(NULL); + return (R_ & st); } @@ -185,12 +180,7 @@ Foam::tmp<Foam::vectorField> Foam::axesRotation::invTransform const vectorField& st ) const { - notImplemented - ( - "tmp<vectorField> Foam::axesRotation::" - "invTransform(const vectorField& st) const" - ); - return tmp<vectorField>(NULL); + return (Rtr_ & st); } diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index 9a2f655624042f151c2dc57c4e4a4ca30c287df2..ad392c506bdef7e6c6b91aabf992118a9d0683e6 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -146,6 +146,7 @@ Foam::scalarTransport::scalarTransport active_(true), phiName_("phi"), UName_("U"), + rhoName_("rho"), DT_(0.0), userDT_(false), resetOnStartUp_(false), @@ -192,6 +193,7 @@ void Foam::scalarTransport::read(const dictionary& dict) phiName_ = dict.lookupOrDefault<word>("phiName", "phi"); UName_ = dict.lookupOrDefault<word>("UName", "U"); + rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho"); userDT_ = false; if (dict.readIfPresent("DT", DT_)) @@ -237,24 +239,59 @@ void Foam::scalarTransport::execute() relaxCoeff = mesh_.equationRelaxationFactor(schemeVar); } - // solve - for (label i = 0; i <= nCorr_; i++) + if (phi.dimensions() == dimMass/dimTime) { - fvScalarMatrix TEqn - ( - fvm::ddt(T_) - + fvm::div(phi, T_, divScheme) - - fvm::laplacian(DT, T_, laplacianScheme) - == - fvOptions_(T_) - ); + const volScalarField& rho = + mesh_.lookupObject<volScalarField>(rhoName_); + + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(rho, T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(rho, T_) + ); + + TEqn.relax(relaxCoeff); + + fvOptions_.constrain(TEqn); + + TEqn.solve(mesh_.solverDict(schemeVar)); + } + } + else if (phi.dimensions() == dimVolume/dimTime) + { + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + fvOptions_(T_) + ); - TEqn.relax(relaxCoeff); + TEqn.relax(relaxCoeff); - fvOptions_.constrain(TEqn); + fvOptions_.constrain(TEqn); - TEqn.solve(mesh_.solverDict(UName_)); + TEqn.solve(mesh_.solverDict(schemeVar)); + } } + else + { + FatalErrorIn("void Foam::scalarTransport::execute()") + << "Incompatible dimensions for phi: " << phi.dimensions() << nl + << "Dimensions should be " << dimMass/dimTime << " or " + << dimVolume/dimTime << endl; + } + Info<< endl; } diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index fdeecdf3604e4ce6d6e5f5c035ed8a8e883abd9b..a58ed2268049379831ceaff4c1042434300d6f52 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -90,6 +90,9 @@ class scalarTransport //- Name of velocity field (optional) word UName_; + //- Name of density field (optional) + word rhoName_; + //- Diffusion coefficient (optional) scalar DT_; diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index c54293f22b2295402f77d31dbc28c9183f119380..83fe6ae2c44b8df0b8398bf6a3770b90c5241c24 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.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) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,13 +105,13 @@ kappa() const { case FLUID: { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = this->db().lookupObject<compressible::turbulenceModel> ( "turbulenceModel" ); - return model.kappaEff(patch().index()); + return turbModel.kappaEff(patch().index()); } break; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index 678300a172ca945e6da19b0cea0377a753de995e..6db89e7a69e732a957455696770a62f24bfbfc90 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -439,20 +439,25 @@ bool finishReaction = false; <readThermoSpecieName>{thermoSpecieName} { string specieString(foamSpecieString(YYText())); - // Old format - size_t spacePos = specieString.find(' '); - if (spacePos != string::npos) + if (newFormat_) { - currentSpecieName = specieString(0, spacePos); + specieString.replaceAll(" ", "_"); + size_t strEnd = specieString.find_last_not_of('_'); + currentSpecieName = specieString.substr(0, strEnd + 1); } else { - currentSpecieName = specieString; + size_t spacePos = specieString.find(' '); + if (spacePos != string::npos) + { + currentSpecieName = specieString(0, spacePos); + } + else + { + currentSpecieName = specieString; + } } - // New format - // specieString.replaceAll(" ", "_"); - // size_t strEnd = specieString.find_last_not_of('_'); - // currentSpecieName = specieString.substr(0, strEnd + 1); + BEGIN(readThermoDate); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index 5ee2a03ac3da93eda3043e7c6ccd96948a99b327..63dd057f3d9f5ea52d3f85b016563e866fec64aa 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -862,13 +862,15 @@ Foam::chemkinReader::chemkinReader ( const fileName& CHEMKINFileName, speciesTable& species, - const fileName& thermoFileName + const fileName& thermoFileName, + const bool newFormat ) : lineNo_(1), specieNames_(10), speciesTable_(species), - reactions_(speciesTable_, speciesThermo_) + reactions_(speciesTable_, speciesThermo_), + newFormat_(newFormat) { read(CHEMKINFileName, thermoFileName); } @@ -883,8 +885,14 @@ Foam::chemkinReader::chemkinReader lineNo_(1), specieNames_(10), speciesTable_(species), - reactions_(speciesTable_, speciesThermo_) + reactions_(speciesTable_, speciesThermo_), + newFormat_(thermoDict.lookupOrDefault("newFormat", false)) { + if (newFormat_) + { + Info<< "Reading CHEMKIN thermo data in new file format" << endl; + } + fileName chemkinFile(fileName(thermoDict.lookup("CHEMKINFile")).expand()); fileName thermoFile = fileName::null; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index 4cd84f59a507b93d2aa3fcc5b3f35dfdc213a881..ad1c50abd8589c33190e9f0ffcf9f60d2485ed1f 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,7 @@ SourceFiles #include "chemistryReader.H" #include "fileName.H" #include "typeInfo.H" +#include "Switch.H" #include "HashPtrTable.H" #include "ReactionList.H" #include "DynamicList.H" @@ -207,6 +208,9 @@ private: //- List of the reactions ReactionList<gasHThermoPhysics> reactions_; + //- Flag to indicate that file is in new format + Switch newFormat_; + // Private Member Functions @@ -319,7 +323,8 @@ public: ( const fileName& chemkinFile, speciesTable& species, - const fileName& thermoFileName = fileName::null + const fileName& thermoFileName = fileName::null, + const bool newFormat = false ); //- Construct by getting the CHEMKIN III file name from dictionary diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index 04934ca950cf559da6bdf6fdbb9fc35245fb7e23..bffb8999eb15a88192323d6cb1d0082eaf1d026a 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -81,7 +81,7 @@ public: (mesh, phaseName) ); - // Declare run-time constructor selection tables + // Declare run-time constructor selection tables declareRunTimeSelectionTable ( autoPtr, diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C new file mode 100644 index 0000000000000000000000000000000000000000..5d35425ccce01b1c0fdf7af3ceab64902fe78ef3 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "adiabaticPerfectFluid.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Specie> +Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid(Istream& is) +: + Specie(is), + p0_(readScalar(is)), + rho0_(readScalar(is)), + gamma_(readScalar(is)), + B_(readScalar(is)) +{ + is.check + ( + "adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid(Istream& is)" + ); +} + + +template<class Specie> +Foam::adiabaticPerfectFluid<Specie>::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<class Specie> +void Foam::adiabaticPerfectFluid<Specie>::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<class Specie> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const adiabaticPerfectFluid<Specie>& pf +) +{ + os << static_cast<const Specie&>(pf) + << token::SPACE << pf.R_ + << token::SPACE << pf.rho0_ + << token::SPACE << pf.gamma_ + << token::SPACE << pf.B_; + + os.check + ( + "Ostream& operator<<(Ostream&, const adiabaticPerfectFluid<Specie>&)" + ); + + 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 0000000000000000000000000000000000000000..6ebd728fa8c27ea2c00eb3fb73183eced2e3599d --- /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 <http://www.gnu.org/licenses/>. + +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 Specie> class adiabaticPerfectFluid; + +template<class Specie> +inline adiabaticPerfectFluid<Specie> operator+ +( + const adiabaticPerfectFluid<Specie>&, + const adiabaticPerfectFluid<Specie>& +); + +template<class Specie> +inline adiabaticPerfectFluid<Specie> operator- +( + const adiabaticPerfectFluid<Specie>&, + const adiabaticPerfectFluid<Specie>& +); + +template<class Specie> +inline adiabaticPerfectFluid<Specie> operator* +( + const scalar, + const adiabaticPerfectFluid<Specie>& +); + +template<class Specie> +inline adiabaticPerfectFluid<Specie> operator== +( + const adiabaticPerfectFluid<Specie>&, + const adiabaticPerfectFluid<Specie>& +); + +template<class Specie> +Ostream& operator<< +( + Ostream&, + const adiabaticPerfectFluid<Specie>& +); + + +/*---------------------------------------------------------------------------*\ + Class adiabaticPerfectFluid Declaration +\*---------------------------------------------------------------------------*/ + +template<class Specie> +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<adiabaticPerfectFluid> clone() const; + + // Selector from Istream + inline static autoPtr<adiabaticPerfectFluid> New(Istream& is); + + // Selector from dictionary + inline static autoPtr<adiabaticPerfectFluid> 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+ <Specie> + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator- <Specie> + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator* <Specie> + ( + const scalar s, + const adiabaticPerfectFluid& + ); + + friend adiabaticPerfectFluid operator== <Specie> + ( + const adiabaticPerfectFluid&, + const adiabaticPerfectFluid& + ); + + + // Ostream Operator + + friend Ostream& operator<< <Specie> + ( + 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 0000000000000000000000000000000000000000..4521e719460ac2409551a0ec99581189302dec45 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "adiabaticPerfectFluid.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Specie> +inline Foam::adiabaticPerfectFluid<Specie>::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<class Specie> +inline Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid +( + const word& name, + const adiabaticPerfectFluid<Specie>& pf +) +: + Specie(name, pf), + p0_(pf.p0_), + rho0_(pf.rho0_), + gamma_(pf.gamma_), + B_(pf.B_) +{} + + +template<class Specie> +inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> > +Foam::adiabaticPerfectFluid<Specie>::clone() const +{ + return autoPtr<adiabaticPerfectFluid<Specie> > + ( + new adiabaticPerfectFluid<Specie>(*this) + ); +} + + +template<class Specie> +inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> > +Foam::adiabaticPerfectFluid<Specie>::New(Istream& is) +{ + return autoPtr<adiabaticPerfectFluid<Specie> > + ( + new adiabaticPerfectFluid<Specie>(is) + ); +} + + +template<class Specie> +inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> > +Foam::adiabaticPerfectFluid<Specie>::New +( + const dictionary& dict +) +{ + return autoPtr<adiabaticPerfectFluid<Specie> > + ( + new adiabaticPerfectFluid<Specie>(dict) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::rho +( + scalar p, + scalar +) const +{ + return rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_); +} + + +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::psi +( + scalar p, + scalar +) const +{ + return + (rho0_/(gamma_*(p0_ + B_))) + *pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0); +} + + +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Z(scalar, scalar) const +{ + return 1.0; +} + + +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::cpMcv +( + scalar, + scalar +) const +{ + return 0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Specie> +inline void Foam::adiabaticPerfectFluid<Specie>::operator+= +( + const adiabaticPerfectFluid<Specie>& 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<class Specie> +inline void Foam::adiabaticPerfectFluid<Specie>::operator-= +( + const adiabaticPerfectFluid<Specie>& 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<class Specie> +inline void Foam::adiabaticPerfectFluid<Specie>::operator*=(const scalar s) +{ + Specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class Specie> +inline Foam::adiabaticPerfectFluid<Specie> Foam::operator+ +( + const adiabaticPerfectFluid<Specie>& pf1, + const adiabaticPerfectFluid<Specie>& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst<Specie> + ( + static_cast<const Specie&>(pf1) + + static_cast<const Specie&>(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<class Specie> +inline Foam::adiabaticPerfectFluid<Specie> Foam::operator- +( + const adiabaticPerfectFluid<Specie>& pf1, + const adiabaticPerfectFluid<Specie>& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst<Specie> + ( + static_cast<const Specie&>(pf1) + - static_cast<const Specie&>(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<class Specie> +inline Foam::adiabaticPerfectFluid<Specie> Foam::operator* +( + const scalar s, + const adiabaticPerfectFluid<Specie>& pf +) +{ + return adiabaticPerfectFluid<Specie> + ( + s*static_cast<const Specie&>(pf), + pf.p0_, + pf.rho0_, + pf.gamma_, + pf.B_ + ); +} + + +template<class Specie> +inline Foam::adiabaticPerfectFluid<Specie> Foam::operator== +( + const adiabaticPerfectFluid<Specie>& pf1, + const adiabaticPerfectFluid<Specie>& 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 0000000000000000000000000000000000000000..562bdecf2bd96838c961d5afff058b9d36b5a9a7 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "linear.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Specie> +Foam::linear<Specie>::linear(Istream& is) +: + Specie(is), + psi_(readScalar(is)), + rho0_(readScalar(is)) +{ + is.check("linear<Specie>::linear(Istream& is)"); +} + + +template<class Specie> +Foam::linear<Specie>::linear(const dictionary& dict) +: + Specie(dict), + psi_(readScalar(dict.subDict("equationOfState").lookup("psi"))), + rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Specie> +void Foam::linear<Specie>::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<class Specie> +Foam::Ostream& Foam::operator<<(Ostream& os, const linear<Specie>& pf) +{ + os << static_cast<const Specie&>(pf) + << token::SPACE << pf.psi_ + << token::SPACE << pf.rho0_; + + os.check("Ostream& operator<<(Ostream&, const linear<Specie>&)"); + 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 0000000000000000000000000000000000000000..8876ce3f28d6228f99c992364bdc9670d29021c7 --- /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 <http://www.gnu.org/licenses/>. + +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 Specie> class linear; + +template<class Specie> +inline linear<Specie> operator+ +( + const linear<Specie>&, + const linear<Specie>& +); + +template<class Specie> +inline linear<Specie> operator- +( + const linear<Specie>&, + const linear<Specie>& +); + +template<class Specie> +inline linear<Specie> operator* +( + const scalar, + const linear<Specie>& +); + +template<class Specie> +inline linear<Specie> operator== +( + const linear<Specie>&, + const linear<Specie>& +); + +template<class Specie> +Ostream& operator<< +( + Ostream&, + const linear<Specie>& +); + + +/*---------------------------------------------------------------------------*\ + Class linear Declaration +\*---------------------------------------------------------------------------*/ + +template<class Specie> +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<linear> clone() const; + + // Selector from Istream + inline static autoPtr<linear> New(Istream& is); + + // Selector from dictionary + inline static autoPtr<linear> 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+ <Specie> + ( + const linear&, + const linear& + ); + + friend linear operator- <Specie> + ( + const linear&, + const linear& + ); + + friend linear operator* <Specie> + ( + const scalar s, + const linear& + ); + + friend linear operator== <Specie> + ( + const linear&, + const linear& + ); + + + // Ostream Operator + + friend Ostream& operator<< <Specie> + ( + 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 0000000000000000000000000000000000000000..ea05aa6333810aac4a6d140c95d659fceda2e9e5 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "linear.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Specie> +inline Foam::linear<Specie>::linear +( + const Specie& sp, + const scalar psi, + const scalar rho0 +) +: + Specie(sp), + psi_(psi), + rho0_(rho0) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Specie> +inline Foam::linear<Specie>::linear +( + const word& name, + const linear<Specie>& pf +) +: + Specie(name, pf), + psi_(pf.psi_), + rho0_(pf.rho0_) +{} + + +template<class Specie> +inline Foam::autoPtr<Foam::linear<Specie> > +Foam::linear<Specie>::clone() const +{ + return autoPtr<linear<Specie> >(new linear<Specie>(*this)); +} + + +template<class Specie> +inline Foam::autoPtr<Foam::linear<Specie> > +Foam::linear<Specie>::New(Istream& is) +{ + return autoPtr<linear<Specie> >(new linear<Specie>(is)); +} + + +template<class Specie> +inline Foam::autoPtr<Foam::linear<Specie> > +Foam::linear<Specie>::New +( + const dictionary& dict +) +{ + return autoPtr<linear<Specie> >(new linear<Specie>(dict)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::rho(scalar p, scalar T) const +{ + return rho0_ + psi_*p; +} + + +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::psi(scalar, scalar T) const +{ + return psi_; +} + + +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::Z(scalar, scalar) const +{ + return 1.0; +} + + +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::cpMcv(scalar, scalar) const +{ + return 0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Specie> +inline void Foam::linear<Specie>::operator+= +( + const linear<Specie>& 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<class Specie> +inline void Foam::linear<Specie>::operator-= +( + const linear<Specie>& 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<class Specie> +inline void Foam::linear<Specie>::operator*=(const scalar s) +{ + Specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class Specie> +inline Foam::linear<Specie> Foam::operator+ +( + const linear<Specie>& pf1, + const linear<Specie>& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst<Specie> + ( + static_cast<const Specie&>(pf1) + + static_cast<const Specie&>(pf2), + molr1*pf1.psi_ + molr2*pf2.psi_, + molr1*pf1.rho0_ + molr2*pf2.rho0_ + ); +} + + +template<class Specie> +inline Foam::linear<Specie> Foam::operator- +( + const linear<Specie>& pf1, + const linear<Specie>& pf2 +) +{ + scalar nMoles = pf1.nMoles() + pf2.nMoles(); + scalar molr1 = pf1.nMoles()/nMoles; + scalar molr2 = pf2.nMoles()/nMoles; + + return rhoConst<Specie> + ( + static_cast<const Specie&>(pf1) + - static_cast<const Specie&>(pf2), + molr1*pf1.psi_ - molr2*pf2.psi_, + molr1*pf1.rho0_ - molr2*pf2.rho0_ + ); +} + + +template<class Specie> +inline Foam::linear<Specie> Foam::operator* +( + const scalar s, + const linear<Specie>& pf +) +{ + return linear<Specie> + ( + s*static_cast<const Specie&>(pf), + pf.psi_, + pf.rho0_ + ); +} + + +template<class Specie> +inline Foam::linear<Specie> Foam::operator== +( + const linear<Specie>& pf1, + const linear<Specie>& pf2 +) +{ + return pf2 - pf1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.C b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.C index 844f293e2dd580a904cc9fa93ba877dfd8d0df5a..612fc6f9eb0bab8e4263b3e8746c6a7c20f611d5 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.C +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ template<class Specie> Foam::perfectFluid<Specie>::perfectFluid(Istream& is) : Specie(is), + R_(readScalar(is)), rho0_(readScalar(is)) { is.check("perfectFluid<Specie>::perfectFluid(Istream& is)"); @@ -42,6 +43,7 @@ template<class Specie> Foam::perfectFluid<Specie>::perfectFluid(const dictionary& dict) : Specie(dict), + R_(readScalar(dict.subDict("equationOfState").lookup("R"))), rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0"))) {} @@ -54,6 +56,7 @@ void Foam::perfectFluid<Specie>::write(Ostream& os) const Specie::write(os); dictionary dict("equationOfState"); + dict.add("R", R_); dict.add("rho0", rho0_); os << indent << dict.dictName() << dict; @@ -66,6 +69,7 @@ template<class Specie> Foam::Ostream& Foam::operator<<(Ostream& os, const perfectFluid<Specie>& pf) { os << static_cast<const Specie&>(pf) + << token::SPACE << pf.R_ << token::SPACE << pf.rho0_; os.check("Ostream& operator<<(Ostream&, const perfectFluid<Specie>&)"); diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H index 76cf80c4a8fd504ad52bcef4f0f4a55653c20dda..9229fd34a4111b4f5e73345e6e892e4af0fb8f2c 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.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) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,15 +94,24 @@ class perfectFluid { // Private data + //- Fluid constant + scalar R_; + //- The reference density scalar rho0_; + public: // Constructors //- Construct from components - inline perfectFluid(const Specie& sp, const scalar rho0); + inline perfectFluid + ( + const Specie& sp, + const scalar R, + const scalar rho0 + ); //- Construct from Istream perfectFluid(Istream&); @@ -140,6 +149,9 @@ public: //- Is the equation of state is isochoric i.e. rho = const static const bool isochoric = false; + //- Return fluid constant [J/(kg K)] + inline scalar R() const; + //- Return density [kg/m^3] inline scalar rho(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H index 21fc092fe2adca3d3875247001d26cacb61309da..c21d6885f9002e5e7177075a0f2bbedae923f870 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.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) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,10 +31,12 @@ template<class Specie> inline Foam::perfectFluid<Specie>::perfectFluid ( const Specie& sp, + const scalar R, const scalar rho0 ) : Specie(sp), + R_(R), rho0_(rho0) {} @@ -49,6 +51,7 @@ inline Foam::perfectFluid<Specie>::perfectFluid ) : Specie(name, pf), + R_(pf.R_), rho0_(pf.rho0_) {} @@ -82,6 +85,13 @@ Foam::perfectFluid<Specie>::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class Specie> +inline Foam::scalar Foam::perfectFluid<Specie>::R() const +{ + return R_; +} + + template<class Specie> inline Foam::scalar Foam::perfectFluid<Specie>::rho(scalar p, scalar T) const { @@ -106,7 +116,7 @@ inline Foam::scalar Foam::perfectFluid<Specie>::Z(scalar, scalar) const template<class Specie> inline Foam::scalar Foam::perfectFluid<Specie>::cpMcv(scalar, scalar) const { - return this->RR; + return 0; } @@ -125,6 +135,7 @@ inline void Foam::perfectFluid<Specie>::operator+= molr1 /= this->nMoles(); scalar molr2 = pf.nMoles()/this->nMoles(); + R_ = 1.0/(molr1/R_ + molr2/pf.R_); rho0_ = molr1*rho0_ + molr2*pf.rho0_; } @@ -142,6 +153,7 @@ inline void Foam::perfectFluid<Specie>::operator-= molr1 /= this->nMoles(); scalar molr2 = pf.nMoles()/this->nMoles(); + R_ = 1.0/(molr1/R_ - molr2/pf.R_); rho0_ = molr1*rho0_ - molr2*pf.rho0_; } @@ -170,6 +182,7 @@ inline Foam::perfectFluid<Specie> Foam::operator+ ( static_cast<const Specie&>(pf1) + static_cast<const Specie&>(pf2), + 1.0/(molr1/pf1.R_ + molr2/pf2.R_), molr1*pf1.rho0_ + molr2*pf2.rho0_ ); } @@ -190,6 +203,7 @@ inline Foam::perfectFluid<Specie> Foam::operator- ( static_cast<const Specie&>(pf1) - static_cast<const Specie&>(pf2), + 1.0/(molr1/pf1.R_ - molr2/pf2.R_), molr1*pf1.rho0_ - molr2*pf2.rho0_ ); } @@ -202,7 +216,12 @@ inline Foam::perfectFluid<Specie> Foam::operator* const perfectFluid<Specie>& pf ) { - return perfectFluid<Specie>(s*static_cast<const Specie&>(pf), pf.rho0_); + return perfectFluid<Specie> + ( + s*static_cast<const Specie&>(pf), + pf.R_, + pf.rho0_ + ); } diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake index 21078c07fdf2b36d0bb5935e76376588f5dd714a..60db98b2d8130e2d2b1437516cd1d7e2086735d5 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 898a3c648ced0ae9d42af3f69203343561ca2f0d..76baf5df2415e130c435a2d9fd6f851d7378f140 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 a412632ebb87b7a78b4466b6d94fedc04f71922d..2ae73705d2b300114e7e5e8f145aa8c6bbaac37d 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 82% rename from src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C rename to src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C index 4ec3ce72f85dc8b19a6392c4111eaf05b0247dfb..98046c9b76f028ba8a65b41fc4f934d0c50760f6 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -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,24 +50,23 @@ void Foam::twoPhaseMixture::calcNu() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::twoPhaseMixture::twoPhaseMixture +Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture ( const volVectorField& U, const surfaceScalarField& phi, - const word& alpha1Name + const word& alpha1Name, + const word& alpha2Name ) : 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 ) @@ -77,7 +76,7 @@ Foam::twoPhaseMixture::twoPhaseMixture viscosityModel::New ( "nu2", - subDict(phase2Name_), + subDict(phase2Name_ == "2" ? "phase2": phase2Name_), U, phi ) @@ -89,19 +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() - ), - nu_ ( IOobject @@ -121,7 +107,8 @@ Foam::twoPhaseMixture::twoPhaseMixture // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const +Foam::tmp<Foam::volScalarField> +Foam::incompressibleTwoPhaseMixture::mu() const { const volScalarField limitedAlpha1 ( @@ -140,7 +127,8 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const } -Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const +Foam::tmp<Foam::surfaceScalarField> +Foam::incompressibleTwoPhaseMixture::muf() const { const surfaceScalarField alpha1f ( @@ -159,7 +147,8 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const } -Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::nuf() const +Foam::tmp<Foam::surfaceScalarField> +Foam::incompressibleTwoPhaseMixture::nuf() const { const surfaceScalarField alpha1f ( @@ -180,7 +169,7 @@ Foam::tmp<Foam::surfaceScalarField> 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 79% rename from src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H rename to src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H index 025d95f7011b609c3fd3bb0bc914216b74bdaeb4..8dad6483201d619c4bda92678ab5badd5423a3ca 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,23 +22,23 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 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<viscosityModel> nuModel1_; autoPtr<viscosityModel> nuModel2_; @@ -69,8 +67,6 @@ protected: const volVectorField& U_; const surfaceScalarField& phi_; - volScalarField alpha1_; - volScalarField nu_; @@ -85,43 +81,22 @@ public: // Constructors //- Construct from components - twoPhaseMixture + incompressibleTwoPhaseMixture ( const volVectorField& U, const surfaceScalarField& phi, - const word& alpha1Name = "alpha1" + const word& alpha1Name = "alpha1", + const word& alpha2Name = "alpha2" ); //- 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 const-access to phase1 viscosityModel const viscosityModel& nuModel1() const { diff --git a/src/transportModels/interfaceProperties/Make/options b/src/transportModels/interfaceProperties/Make/options index d8c038aad0cd10357720a95d41b13553cffe687d..4636e2654026e44807dd6995606a7c409c28100d 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 647a00e2ba05d7a9b005fe9fcb0f9a917fe00349..e7f6e04872b725dc2f2783b404e20ad5b484aa3e 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 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 73c962d77f85de6bd9ea6c53af21e41048cc65f5..f183641e461fe1495c87ae07fd0e361a5c813c43 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index 6d1f65fe73f0c42feabea6a470be8093302116b8..95f51483fca0ea909b10347cc46be656209a68a9 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C index 9c84ba823a8499e657f74485d73ddde89f1a3db0..ea35d3999cfc23af7cd1d7d1ab1ae94f0726acec 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H index 70fcd6ed8c59c2cc5e06067bdb4c1bc10c0b4bbb..02eaf6b352cf30b024c26a9057561693539b64f2 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C index ee0d3b9aafca6d72d5996898318285c303de6218..b4a9db0062ae45939796add46cf81e95353f9c5a 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H index b3768be38bcee8974d0b9a8b8bcfc97e91def854..488a7ed93af28bdd45b4c76e5c42f77aab7f6f97 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C index 265f235e44abaa3fcd928e1a22f3cb1bf1b37b91..d014b1c6fcd997b8f44814186f88da599d7f7fc0 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H index d52f4c821e706d28a79c5f1e97a666cf621cd1c6..de96a69eea1c2defeaf000a3438dcc75d45a79a8 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C rename to src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C index 61bd4d09c10bc48cbb9d06c85689f908bdb2ca00..e6e6ea2c10612c0c1a3a82c39c51fd484f9e1535 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H similarity index 98% rename from src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H rename to src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H index 6186c621925d5685d482584ffc33feffb0086d77..2b9c00c0c1efed654c33bdbf5e686a883493b035 100644 --- a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License 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 41ed49322b2a8c5dea3003a96969670e56408240..7b95752f370e941080c937ed016b528c2b66e089 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" + ), -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + alpha1_ + ( + IOobject + ( + dict.found("phases") ? word("alpha" + phase1Name_) : alpha1Name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ), -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 49f5218e4928119b189a16ad63b896d5c5dfd293..668c4f2cfd2161ba1987e2c6f5abfe51f62b354c 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 <http://www.gnu.org/licenses/>. 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 - - //- Reference pressure - dimensionedScalar p0_; +protected: - //- Reference density - dimensionedScalar rho0_; + // Protected data - //- The isentropic exponent - dimensionedScalar gamma_; + word phase1Name_; + word phase2Name_; - //- 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<volScalarField> rho - ( - const volScalarField& p, - const volScalarField& T - ) const; - - tmp<volScalarField> psi - ( - const volScalarField& p, - const volScalarField& T - ) const; + 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_; + } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace phaseEquationsOfState } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 8bfa031882b1cdb9c1834f7ed15ac56483b69780..6780860b8719a6ba1bd71cda939aa704e5d9d782 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -233,8 +233,7 @@ public: //- Return the effective turbulent temperature diffusivity for a patch virtual tmp<scalarField> kappaEff(const label patchI) const { - return - thermo().kappaEff(alphat()().boundaryField()[patchI], patchI); + return thermo().kappaEff(alphat(patchI), patchI); } //- Return the effective turbulent thermal diffusivity @@ -246,8 +245,7 @@ public: //- Return the effective turbulent thermal diffusivity for a patch virtual tmp<scalarField> alphaEff(const label patchI) const { - return - thermo().alphaEff(alphat()().boundaryField()[patchI], patchI); + return thermo().alphaEff(alphat(patchI), patchI); } //- Solve the turbulence equations and correct the turbulence viscosity diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 14448ca71c8da21e63bc17d3348041afb45f48b6..d3cab304ab581e6102ae427d75e1442db69dba30 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,13 +92,13 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa { case BASICTHERMO: { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = mesh.lookupObject<compressible::turbulenceModel> ( "turbulenceModel" ); - return model.kappaEff(patch_.index()); + return turbModel.kappaEff(patch_.index()); break; } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index f05919061eddd7b26a924da8772bea5786dc2b99..e966e7295428f2caceb92b63ca27f3223a06085c 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -200,23 +200,23 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs() const mappedPatchBase& mpp = refCast<const mappedPatchBase>(patch().patch()); - const label patchI = patch().index(); + const label patchi = patch().index(); - const label nbrPatchI = mpp.samplePolyPatch().index(); + const label nbrPatchi = mpp.samplePolyPatch().index(); if (baffleActivated_) { - const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchI]; + const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi]; - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = db().template lookupObject<compressible::turbulenceModel> ( "turbulenceModel" ); - // local properties - const scalarField kappaw = model.kappaEff()().boundaryField()[patchI]; + + const scalarField kappaw(turbModel.kappaEff(patchi)); const fvPatchScalarField& Tp = patch().template lookupPatchField<volScalarField, scalar>(TName_); @@ -229,17 +229,12 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs() // nbr properties - scalarField nbrKappaw = - model.kappaEff()().boundaryField()[nbrPatchI]; - mpp.map().distribute(nbrKappaw); + const scalarField nbrKappaw(turbModel.kappaEff(nbrPatchi)); const fvPatchScalarField& nbrTw = - model.thermo().T().boundaryField()[nbrPatchI]; + turbModel.thermo().T().boundaryField()[nbrPatchi]; - scalarField nbrQDot - ( - model.kappaEff()().boundaryField()[nbrPatchI]*nbrTw.snGrad() - ); + scalarField nbrQDot(nbrKappaw*nbrTw.snGrad()); mpp.map().distribute(nbrQDot); const thermalBaffle1DFvPatchScalarField& nbrField = @@ -255,11 +250,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs() nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_); mpp.map().distribute(nbrTp); - scalarField nbrh - ( - nbrPatch.deltaCoeffs() - *model.kappaEff()().boundaryField()[nbrPatchI] - ); + scalarField nbrh(nbrPatch.deltaCoeffs()*nbrKappaw); mpp.map().distribute(nbrh); diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index 87d283b29ab8d318cb625269052367e219f5a3a2..ab7c3ef21b63ec751a9bba7ff795c7276c137da0 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -212,6 +212,12 @@ public: //- Return the turbulence thermal diffusivity virtual tmp<volScalarField> alphat() const = 0; + //- Return the turbulence thermal diffusivity for a patch + virtual tmp<scalarField> alphat(const label patchI) const + { + return alphat()().boundaryField()[patchI]; + } + //- Return the effective turbulence temperature diffusivity virtual tmp<volScalarField> kappaEff() const = 0; diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C index 7207e3d7ac02ac7b3c1a812fce39925e5da72db5..08855fa7fb85c32612e5bfbf8f6903f6be39bb6f 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,25 +70,25 @@ void Foam::porousBafflePressureFvPatchField<Foam::scalar>::updateCoeffs() if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0)) { - const incompressible::turbulenceModel& model = + const incompressible::turbulenceModel& turbModel = db().lookupObject<incompressible::turbulenceModel> ( "turbulenceModel" ); - const scalarField nuEffw = model.nuEff()().boundaryField()[patchI]; + const scalarField nuEffw = turbModel.nuEff()().boundaryField()[patchI]; jump_ = -sign(Un)*(I_*nuEffw + D_*0.5*magUn*length_)*magUn; } else { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = db().lookupObject<compressible::turbulenceModel> ( "turbulenceModel" ); - const scalarField muEffw = model.muEff()().boundaryField()[patchI]; + const scalarField muEffw = turbModel.muEff()().boundaryField()[patchI]; const scalarField rhow = patch().lookupPatchField<volScalarField, scalar>("rho"); diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions index b150d51b8f0bd76a38f2c675609965072624ec03..66a2b807520ffe5ac1c89c4d752d42c2f0638ac2 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvOptions @@ -33,8 +33,14 @@ porosity1 coordinateSystem { - e1 (0.70710678 0.70710678 0); - e3 (0 0 1); + type cartesian; + origin (0 0 0); + coordinateRotation + { + type axesRotation; + e1 (0.70710678 0.70710678 0); + e3 (0 0 1); + } } } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index c5e80f8d1a3715a2600d25caa26d4fb32be862cf..a6e206d5256b2bd365ca802844aaedffd1c81b50 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -54,10 +54,17 @@ geometry scale (1.0 1.0 2.1); transform { - type cartesian; - origin (2 2 0); - e1 (1 0 0); - e3 (0 0 1); + coordinateSystem + { + type cartesian; + origin (2 2 0); + coordinateRotation + { + type axesRotation; + e1 (1 0 0); + e3 (0 0 1); + } + } } } herring @@ -66,10 +73,17 @@ geometry scale (1.0 1.0 2.1); transform { - type cartesian; - origin (3.5 3 0); - e1 (1 0 0); - e3 (0 0 1); + coordinateSystem + { + type cartesian; + origin (3.5 3 0); + coordinateRotation + { + type axesRotation; + e1 (1 0 0); + e3 (0 0 1); + } + } } } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties index 5ba8a553e166d823df34a7093c9c7523fce744f0..95579e34cb51bd580ceb7debb125ff47a8c7a6aa 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution index d30cdf20b496e354128a273418811f504df1abed..b19527e0cecdb50be8f3a026bb41a7b4ba686900 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution @@ -42,16 +42,16 @@ solvers SIMPLE { - momentumPredictor yes; + momentumPredictor no; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; residualControl { - p_rgh 1e-2; - U 1e-3; - h 1e-3; + p_rgh 1e-4; + U 1e-4; + h 1e-4; // possibly check turbulence fields "(k|epsilon|omega)" 1e-3; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties index 5ba8a553e166d823df34a7093c9c7523fce744f0..95579e34cb51bd580ceb7debb125ff47a8c7a6aa 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties index 7964a240aea24312d6d4b1a1e7957de22fe8e85b..ab678e4d8862b1080531600e7fc902e2144afbc4 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties index 7964a240aea24312d6d4b1a1e7957de22fe8e85b..ab678e4d8862b1080531600e7fc902e2144afbc4 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties index 4c4cce2da77acfd5f526551b39ace115ed1f1917..55b50fd4b41f02830fd3438ff782ce59ec709996 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties @@ -15,11 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// thermoType hePsiThermo<pureMixture<const<hConst<perfectGas<specie>>,sensibleEnthalpy>>>; - thermoType { - type hePsiThermo; + type heRhoThermo; mixture pureMixture; transport const; thermo hConst; diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions index 475ac8e04026f46bd037d6bde5a6ece872345137..e0562a385109a6b6e25313a6189c55ea842a4723 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions @@ -51,8 +51,14 @@ porosityBlockage coordinateSystem { - e1 (0 1 0); - e2 (0 0 1); + type cartesian; + origin (0 0 0); + coordinateRotation + { + type axesRotation; + e1 (0 1 0); + e2 (0 0 1); + } } } } diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties index deb5491013c05aed54633d71e45a00b846466bd8..ea16d954f1b6ac9f838e400fb3c901e68d253a6e 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/chemistryProperties @@ -21,7 +21,7 @@ chemistryType chemistryThermo psi; } -chemistry off; +chemistry on; initialChemicalTimeStep 1e-07; diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties index 8f326f366756a02663e3cfeaed1ea4a0f4e5ce2d..f7b1cae9b7e231c48821bf9f85a80971d1bc85a9 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties @@ -15,9 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustion>; +combustionModel PaSR<psiChemistryCombustion>; -active false; +active yes; PaSRCoeffs { diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties index b0ac29548bc09dd4224d2bb7dadbb7c0552f65e2..ebae047d0b2c937d4449fb44388eb763070cec25 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/thermophysicalProperties @@ -28,7 +28,9 @@ thermoType CHEMKINFile "$FOAM_CASE/chemkin/chem.inp"; -CHEMKINThermoFile "~OpenFOAM/thermoData/therm.dat"; +CHEMKINThermoFile "$FOAM_CASE/chemkin/therm.dat"; + +newFormat yes; inertSpecie N2; diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict index 89dc909c58b7dc17c22478a8b6de6c2b35a0d03c..7c512bc41b8db80e2d80b87af07e7c6fa7150838 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object controlDict; diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/T.org similarity index 97% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/T.org index e5ac2eeb27e347dab629027bf93918e211179ee3..ce47bfaefcfa1a98ef1d8e640c3e1ac012478a14 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/T.org +++ b/tutorials/multiphase/compressibleInterFoam/laminar/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/0/U b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/U similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/U rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/U diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/alphawater.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/alphawater.org similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/alphawater.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/alphawater.org diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/p.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/p.org new file mode 100644 index 0000000000000000000000000000000000000000..1e603613afa78464d8eb6271352e9887d5615e39 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/p.org @@ -0,0 +1,35 @@ +/*--------------------------------*- 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 volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + walls + { + type calculated; + value uniform 1e5; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p_rgh.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/p_rgh.org similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p_rgh.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/0/p_rgh.org diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean similarity index 67% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean index d6e8dce5df4d6bb1480f3d9a86ae4abb36ea0fff..8821d7e1cc12328cac82fd5fbcfeb2cd2198e4ef 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean @@ -3,4 +3,4 @@ cd ${0%/*} || exit 1 # run from this directory foamCleanTutorials cases rm -rf processor* -rm -rf 0/p_rgh.gz 0/alphawater.gz 0/T.gz +rm -rf 0/p_rgh.gz 0/p.gz 0/alphawater.gz 0/T*.gz diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun similarity index 96% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun index 76547516b77f0ec8beb17b5b56f9419008d1c5b2..ac803d715f9a0b56c58f68b1c496093fbee21d3d 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun @@ -10,6 +10,7 @@ application=`getApplication` runApplication blockMesh cp 0/alphawater.org 0/alphawater cp 0/p_rgh.org 0/p_rgh +cp 0/p.org 0/p cp 0/T.org 0/T runApplication setFields runApplication $application diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/LESProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/LESProperties similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/LESProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/LESProperties diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/g b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/g similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/g rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/g diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/polyMesh/blockMeshDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/polyMesh/blockMeshDict diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/polyMesh/boundary b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/polyMesh/boundary similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/polyMesh/boundary rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/polyMesh/boundary diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties similarity index 88% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties index 3c26cf1692ad357236bb940734e078d27d8d1ac3..9c14314414d80ca417142445651da9b4b1b5ce69 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/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/thermophysicalProperties2 b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalPropertiesair similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties2 rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalPropertiesair diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties1 b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalPropertieswater similarity index 96% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties1 rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalPropertieswater index 57295cafbddae1ebb95e37c40b4281620431352b..1ffcbddad7b44c5aecf0266ac4d48835674b0344 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/thermophysicalProperties1 +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalPropertieswater @@ -31,10 +31,11 @@ mixture specie { nMoles 1; - molWeight 28.9; //2.77; + molWeight 18.0; } equationOfState { + R 3000; rho0 1027; } thermodynamics diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/turbulenceProperties similarity index 97% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/turbulenceProperties index a925d3cc2b28640b5aebf7779f6a9008e77b09fc..c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/turbulenceProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/turbulenceProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType LESModel; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/controlDict diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes similarity index 96% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes index 0c204f053f8dad1f6c9cf2ebace5172c11f77ea5..469090b5e0c522c21d90d80958ba88389a249b6d 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/laminar/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/depthCharge2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict similarity index 95% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict index 88198a4d2492d2a3aea2da05522422006700024a..f312b4e9725624b24c148066d9685f03d42e2a9f 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/setFieldsDict @@ -19,6 +19,7 @@ defaultFieldValues ( volScalarFieldValue alphawater 1 volScalarFieldValue p_rgh 1e5 + volScalarFieldValue p 1e5 volScalarFieldValue T 300 ); @@ -32,6 +33,7 @@ regions ( volScalarFieldValue alphawater 0 volScalarFieldValue p_rgh 1e6 + volScalarFieldValue p 1e6 volScalarFieldValue T 578 ); } diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/T.org similarity index 92% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/T.org index b40cb08478605737ff4cac5ebc6bf0cef6004ac7..ce47bfaefcfa1a98ef1d8e640c3e1ac012478a14 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/T.org +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/T.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object alpha1; + object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -24,6 +24,11 @@ boundaryField { type zeroGradient; } + + defaultFaces + { + type empty; + } } // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/U b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/U similarity index 94% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/U rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/U index d37b2aea30e93c01cec35a4a5e005d7cc6e151ab..f267a870fcbaa90279da2fa20989a83329804a6a 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/U +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/U @@ -25,6 +25,10 @@ boundaryField type fixedValue; value uniform (0 0 0); } + frontAndBack + { + type empty; + } } // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/alphawater.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/alphawater.org similarity index 94% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/alphawater.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/alphawater.org index 62be61f403a247c589ce0dfd45bc84e54eaeb536..d90b720092af3d27f74cf6ca3cb23723735c73da 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/alphawater.org +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/alphawater.org @@ -24,6 +24,11 @@ boundaryField { type zeroGradient; } + + defaultFaces + { + type empty; + } } // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p.org new file mode 100644 index 0000000000000000000000000000000000000000..1e603613afa78464d8eb6271352e9887d5615e39 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p.org @@ -0,0 +1,35 @@ +/*--------------------------------*- 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 volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + walls + { + type calculated; + value uniform 1e5; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p_rgh.org similarity index 94% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p_rgh.org index 0394387374d5ef9bb77528165e097f872381d9a4..396d380daddd7bc4e4a3c9d427a5226c6c3f44af 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/0/p_rgh.org @@ -25,6 +25,11 @@ boundaryField type fixedFluxPressure; value uniform 1e5; } + + defaultFaces + { + type empty; + } } // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean similarity index 74% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean index 539c7721669d0975387894caa2ffcd81d6927fae..3ec07f62c5ce06923cbfba8158a68fa1c3cdc6f1 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean @@ -3,6 +3,6 @@ cd ${0%/*} || exit 1 # run from this directory foamCleanTutorials cases rm -rf processor* -rm -rf 0/p_rgh 0/p_rgh.gz 0/alphawater 0/alphawater.gz 0/T.gz +rm -rf 0/p_rgh.gz 0/p.gz 0/alphawater.gz 0/T.gz # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun similarity index 96% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun index 0941ac4aa1aaff404b79022685eec6717e2ed8aa..11b84a3251a97ea8539fe65034448bf77d3ebb6a 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun @@ -10,6 +10,7 @@ application=`getApplication` runApplication blockMesh cp 0/alphawater.org 0/alphawater cp 0/p_rgh.org 0/p_rgh +cp 0/p.org 0/p cp 0/T.org 0/T runApplication setFields runApplication decomposePar diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/LESProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/LESProperties similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/LESProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/LESProperties diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/g b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/g similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/g rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/g diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/polyMesh/blockMeshDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/polyMesh/blockMeshDict diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/polyMesh/boundary b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/polyMesh/boundary similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/polyMesh/boundary rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/polyMesh/boundary diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalProperties similarity index 80% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalProperties index 78f85f47a2d7fd6c44c040653766d237404fba31..9c14314414d80ca417142445651da9b4b1b5ce69 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/transportProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalProperties @@ -11,29 +11,14 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 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/laminar/depthCharge3D/constant/thermophysicalPropertiesair b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalPropertiesair new file mode 100644 index 0000000000000000000000000000000000000000..e61009c10be927d2af1b6981cc75ad368e85d5c3 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalPropertiesair @@ -0,0 +1,49 @@ +/*--------------------------------*- 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 thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalPropertieswater b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalPropertieswater new file mode 100644 index 0000000000000000000000000000000000000000..1ffcbddad7b44c5aecf0266ac4d48835674b0344 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalPropertieswater @@ -0,0 +1,54 @@ +/*--------------------------------*- 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 thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectFluid; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 18.0; + } + equationOfState + { + R 3000; + rho0 1027; + } + thermodynamics + { + Cp 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/transportProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/transportProperties similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/constant/transportProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/transportProperties diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/turbulenceProperties similarity index 97% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/turbulenceProperties index a925d3cc2b28640b5aebf7779f6a9008e77b09fc..c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/constant/turbulenceProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/turbulenceProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType LESModel; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/controlDict similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/controlDict diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/decomposeParDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/decomposeParDict similarity index 100% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/decomposeParDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/decomposeParDict diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes similarity index 94% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes index 903d94d30c6e6ac6ecc85e0d048a668f7d3cb220..469090b5e0c522c21d90d80958ba88389a249b6d 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/laminar/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/laminar/depthCharge3D/system/fvSolution similarity index 99% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution index 461897454640df6743233c416536bbb89b0fa6a0..9066c1c700c4ba078eae024acd15d76d07f45f55 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution @@ -39,7 +39,7 @@ solvers maxIter 100; } - "(rho|rhoFinal)" + ".*(rho|rhoFinal)" { solver diagonal; } diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict similarity index 95% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict rename to tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict index ec31deae034f52a0bcee92507698a43d1acd06de..dc90a362c06eab75ce1c892c6f693f67b817d413 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/setFieldsDict @@ -19,6 +19,7 @@ defaultFieldValues ( volScalarFieldValue alphawater 1 volScalarFieldValue p_rgh 1e5 + volScalarFieldValue p 1e5 volScalarFieldValue T 300 ); @@ -32,6 +33,7 @@ regions ( volScalarFieldValue alphawater 0 volScalarFieldValue p_rgh 1e6 + volScalarFieldValue p 1e6 volScalarFieldValue T 578 ); } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater index 672b24a98b365f170f3f2567723294befd79a06e..43cb59fafa8cd01f32e04a281bdd6405770cca06 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 672b24a98b365f170f3f2567723294befd79a06e..43cb59fafa8cd01f32e04a281bdd6405770cca06 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 {