diff --git a/README.html b/README.html index 1e96c05e6a..280e8adaf6 100644 --- a/README.html +++ b/README.html @@ -1,13 +1,13 @@ - + -OpenFOAM README for version dev +OpenFOAM README for version 2.2.0 + - + @@ -44,6 +44,12 @@ lang="en" xml:lang="en"> dt { font-weight: bold; } div.figure { padding: 0.5em; } div.figure p { text-align: center; } + div.inlinetask { + padding:10px; + border:2px solid gray; + margin:10px; + background: #ffffcc; + } textarea { overflow-x: auto; } .linenr { font-size:smaller } .code-highlighted {background-color:#ffff00;} @@ -79,27 +85,32 @@ lang="en" xml:lang="en"> -
-

OpenFOAM README for version dev

+
+ +
+ +
+

OpenFOAM README for version 2.2.0

+
-

1 About OpenFOAM

+

1 About OpenFOAM

OpenFOAM is a free, open source computational fluid dynamcis (CFD) software @@ -114,7 +125,7 @@ lang="en" xml:lang="en">

-

2 Copyright

+

2 Copyright

OpenFOAM is free software: you can redistribute it and/or modify it under the @@ -129,7 +140,7 @@ lang="en" xml:lang="en">

-

3 Download and installation instructions

+

3 Download and installation instructions

    @@ -144,17 +155,17 @@ lang="en" xml:lang="en">
-

5 Documentation

+

5 Documentation

http://www.OpenFOAM.com/docs @@ -164,7 +175,7 @@ lang="en" xml:lang="en">

-

6 Support and development contracts

+

6 Support and development contracts

http://www.OpenFOAM.com/support @@ -174,17 +185,19 @@ lang="en" xml:lang="en">

-

7 Reporting Bugs in OpenFOAM

+

7 Reporting Bugs in OpenFOAM

-
-

Date: 15th August 2011

-

Org version 7.5 with Emacs version 23

-Validate XHTML 1.0
+ +
+

Date: 11th January 2013

+

Org version 7.8.11 with Emacs version 24

+Validate XHTML 1.0 +
diff --git a/README.org b/README.org index c107d87870..bae6792242 100644 --- a/README.org +++ b/README.org @@ -1,11 +1,11 @@ # -*- mode: org; -*- # -#+TITLE: OpenFOAM README for version dev +#+TITLE: OpenFOAM README for version 2.2.0 #+AUTHOR: The OpenFOAM Foundation -#+DATE: 15th August 2011 +#+DATE: 11th January 2013 #+LINK: http://www.openfoam.org #+OPTIONS: author:nil ^:{} -# Copyright (c) 2011 OpenFOAM Foundation. +# Copyright (c) 2013 OpenFOAM Foundation. * About OpenFOAM OpenFOAM is a free, open source computational fluid dynamcis (CFD) software @@ -28,7 +28,7 @@ [[http://www.OpenFOAM.org/git.php]] * Release notes - [[http://www.OpenFOAM.com/version2.0.0]] + [[http://www.OpenFOAM.org/version2.2.0]] * Documentation [[http://www.OpenFOAM.com/docs]] diff --git a/applications/solvers/basic/potentialFoam/Make/options b/applications/solvers/basic/potentialFoam/Make/options index 725122ea1d..159afb0f46 100644 --- a/applications/solvers/basic/potentialFoam/Make/options +++ b/applications/solvers/basic/potentialFoam/Make/options @@ -1,4 +1,11 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude -EXE_LIBS = -lfiniteVolume +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lfvOptions \ + -lsampling diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index e968fa5c16..33931f051e 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.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 @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" - +#include "fvIOoptionList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,17 +49,20 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "readControls.H" #include "createFields.H" + #include "createFvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< nl << "Calculating potential flow" << endl; // Since solver contains no time loop it would never execute - // function objects so do it ourselves. + // function objects so do it ourselves runTime.functionObjects().start(); adjustPhi(phi, U, p); + fvOptions.relativeFlux(phi); + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn @@ -87,6 +90,8 @@ int main(int argc, char *argv[]) } } + fvOptions.absoluteFlux(phi); + Info<< "continuity error = " << mag(fvc::div(phi))().weightedAverage(mesh.V()).value() << endl; diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index fb61460fac..12cfba078b 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.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 @@ -116,7 +116,7 @@ void PDRkEpsilon::correct() } tmp tgradU = fvc::grad(U_); - volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU())))); + volScalarField G(GName(), mut_*(tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); // Update espsilon and G at the wall diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H index 3fb6dfe45e..7a5c717cff 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H @@ -27,7 +27,7 @@ fvScalarMatrix pDDtEqn ( fvc::ddt(rho) + fvc::div(phiHbyA) - + correction(fvm::ddt(psi, p) + fvm::div(phid, p)) + + correction(psi*fvm::ddt(p) + fvm::div(phid, p)) ); while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C index 5f25016a84..a428253421 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.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 @@ -165,7 +165,6 @@ int main(int argc, char *argv[]) mesh.movePoints(motionPtr->newPoints()); phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg; - Info<< phi.boundaryField()[0] << endl; surfaceVectorField phiUp ( diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 3d2c18e668..67df5b61e0 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Application - buoyantSimpleRadiationFoam + buoyantSimpleFoam Description Steady-state solver for buoyant, turbulent flow of compressible fluids, @@ -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 bb7a65cb1d..7cee2dc4ed 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -1,10 +1,7 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr pThermo - ( - psiThermo::New(mesh) - ); - psiThermo& thermo = pThermo(); + autoPtr pThermo(rhoThermo::New(mesh)); + rhoThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); volScalarField rho diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index 06126f0bf8..94dd40ce6b 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -11,9 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ - -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude @@ -25,6 +23,7 @@ EXE_LIBS = \ -lspecie \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ + -lcompressibleLESModels \ -lmeshTools \ -lfiniteVolume \ -lradiationModels \ diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C index 9ec57f2f92..0753cd3163 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.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 diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H index 77eda7c843..797bb765a0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.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 diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H new file mode 100644 index 0000000000..51232bf0be --- /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 0000000000..825ed0cba8 --- /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 0000000000..14bd0d4d24 --- /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 0000000000..ffa6c3f3b5 --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/createFields.H @@ -0,0 +1,54 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr 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 0000000000..90b475794b --- /dev/null +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -0,0 +1,93 @@ + Info<< "Creating turbulence model\n" << endl; + tmp 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 turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (RASHeader.headerOk()) + { + autoPtr turbulence + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else if (LESHeader.headerOk()) + { + autoPtr turbulence + ( + compressible::LESModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + talphaEff = turbulence->alphaEff(); + } + else + { + talphaEff = tmp + ( + 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 0000000000..f5f88232d2 --- /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 . + +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/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H index 117790446e..9bed803d1e 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H @@ -68,4 +68,6 @@ } } +phi.oldTime() = phi; + #include "continuityErrs.H" diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index 0f2981ab4c..5efeeb355d 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/Make/options index fa204ce58f..34590e930b 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C index 45bc766761..cf608d0a6a 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 a4e9e0b40f..3c4cbb0d32 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 256a58d953..73e9577029 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 c5e93c7efb..ce618ee40f 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 dbacf1dbd3..8958dc3c5e 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 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 b259ddd322..4edda7336d 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 ea35f79fa1..b2c7d953b5 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 2f4544cb4c..aa0f3c01c6 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 b4b7f6ffa7..a93da26cdd 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -2,7 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso phaseEquationsOfState +wmake libso twoPhaseMixtureThermo wmake wmake compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/Make/files index 0e009f09bc..de5437219c 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/files +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/files @@ -1,4 +1,3 @@ -derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C compressibleInterFoam.C EXE = $(FOAM_APPBIN)/compressibleInterFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index 48c253b213..035116d2d5 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -1,17 +1,19 @@ EXE_INC = \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -ItwoPhaseMixtureThermo \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -IphaseEquationsOfState/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -ltwoPhaseMixtureThermo \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ - -lincompressibleTransportModels \ - -lphaseEquationsOfState \ - -lincompressibleTurbulenceModel \ - -lincompressibleRASModels \ - -lincompressibleLESModels \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H index 2605ce345a..d97e8b2a35 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H @@ -1,20 +1,21 @@ { - volScalarField kByCv - ( - "kByCv", - (alpha1*k1/Cv1 + alpha2*k2/Cv2) - + (alpha1*rho1 + alpha2*rho2)*turbulence->nut() - ); - - solve + fvScalarMatrix TEqn ( fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - - fvm::laplacian(kByCv, T) - + p*fvc::div(phi)*(alpha1/Cv1 + alpha2/Cv2) + - fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T) + + ( + fvc::div(fvc::absolute(phi, U), p) + + fvc::ddt(rho, K) + fvc::div(rhoPhi, K) + ) + *( + alpha1/twoPhaseProperties.thermo1().Cv() + + alpha2/twoPhaseProperties.thermo2().Cv() + ) ); - // Update compressibilities - psi1 = eos1->psi(p, T); - psi2 = eos2->psi(p, T); + TEqn.relax(); + TEqn.solve(); + + twoPhaseProperties.correct(); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index 7cc250a66a..8fc397e802 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -2,7 +2,7 @@ ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - + turbulence->divDevRhoReff(rho, U) + + turbulence->divDevRhoReff(U) ); UEqn.relax(); @@ -22,4 +22,6 @@ ) * mesh.magSf() ) ); + + K = 0.5*magSqr(U); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options index d4d0fa9b5a..cf9a1d85ec 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -1,24 +1,26 @@ EXE_INC = \ -I.. \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I../twoPhaseMixtureThermo \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/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 = \ + -ltwoPhaseMixtureThermo \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseMixture \ + -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 acf563fc8e..27d3b87cd1 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.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 @@ -43,7 +43,7 @@ Description #include "subCycle.H" #include "interfaceProperties.H" #include "twoPhaseMixture.H" -#include "phaseEquationOfState.H" +#include "twoPhaseMixtureThermo.H" #include "turbulenceModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H index 1d7b9ca624..513ef961bd 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H @@ -56,6 +56,8 @@ phi -= pcorrEqn.flux(); } } - - #include "continuityErrs.H" } + +phi.oldTime() = phi; + +#include "continuityErrs.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 54c246f203..a42d911980 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.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 @@ -38,9 +38,10 @@ Description #include "fvCFD.H" #include "MULES.H" #include "subCycle.H" +#include "rhoThermo.H" #include "interfaceProperties.H" #include "twoPhaseMixture.H" -#include "phaseEquationOfState.H" +#include "twoPhaseMixtureThermo.H" #include "turbulenceModel.H" #include "pimpleControl.H" @@ -103,8 +104,6 @@ int main(int argc, char *argv[]) } } - rho = alpha1*rho1 + alpha2*rho2; - runTime.write(); Info<< "ExecutionTime = " diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index 1c22600170..c7289b23f9 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -28,141 +28,20 @@ #include "createPhi.H" - Info<< "Reading field T\n" << endl; - volScalarField T - ( - IOobject - ( - "T", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - p_rgh - ); - - - Info<< "Reading transportProperties\n" << endl; - twoPhaseMixture twoPhaseProperties(U, phi); + Info<< "Constructing twoPhaseMixtureThermo\n" << endl; + twoPhaseMixtureThermo twoPhaseProperties(mesh); volScalarField& alpha1(twoPhaseProperties.alpha1()); + volScalarField& alpha2(twoPhaseProperties.alpha2()); - Info<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name() - << nl << endl; - volScalarField alpha2 - ( - "alpha" + twoPhaseProperties.phase2Name(), - scalar(1) - alpha1 - ); + Info<< "Reading thermophysical properties\n" << endl; - dimensionedScalar k1 - ( - "k", - dimensionSet(1, 1, -3, -1, 0), - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase1Name() - ).lookup("k") - ); - - dimensionedScalar k2 - ( - "k", - dimensionSet(1, 1, -3, -1, 0), - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase2Name() - ).lookup("k") - ); - - dimensionedScalar Cv1 - ( - "Cv", - dimensionSet(0, 2, -2, -1, 0), - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase1Name() - ).lookup("Cv") - ); - - dimensionedScalar Cv2 - ( - "Cv", - dimensionSet(0, 2, -2, -1, 0), - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase2Name() - ).lookup("Cv") - ); - - autoPtr eos1 - ( - phaseEquationOfState::New - ( - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase1Name() - ) - ) - ); - - autoPtr eos2 - ( - phaseEquationOfState::New - ( - twoPhaseProperties.subDict - ( - twoPhaseProperties.phase2Name() - ) - ) - ); - - volScalarField psi1 - ( - IOobject - ( - "psi1", - runTime.timeName(), - mesh - ), - eos1->psi(p, T) - ); - psi1.oldTime(); - - volScalarField psi2 - ( - IOobject - ( - "psi2", - runTime.timeName(), - mesh - ), - eos2->psi(p, T) - ); - psi2.oldTime(); - - dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); - - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - volScalarField rho1("rho1", eos1->rho(p, T)); - volScalarField rho2("rho2", eos2->rho(p, T)); + volScalarField& p = twoPhaseProperties.p(); + volScalarField& T = twoPhaseProperties.T(); + volScalarField& rho1 = twoPhaseProperties.thermo1().rho(); + const volScalarField& psi1 = twoPhaseProperties.thermo1().psi(); + volScalarField& rho2 = twoPhaseProperties.thermo2().rho(); + const volScalarField& psi2 = twoPhaseProperties.thermo2().psi(); volScalarField rho ( @@ -178,6 +57,12 @@ ); + dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); + + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + surfaceScalarField ghf("ghf", g & mesh.Cf()); + // Mass flux // Initialisation does not matter because rhoPhi is reset after the // alpha1 solution before it is used in the U equation. @@ -202,8 +87,11 @@ // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); - // Construct incompressible turbulence model - autoPtr turbulence + // Construct compressible turbulence model + autoPtr turbulence ( - incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) + compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties) ); + + Info<< "Creating field kinetic energy K\n" << endl; + volScalarField K("K", 0.5*magSqr(U)); diff --git a/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C deleted file mode 100644 index e6782e8b3a..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ /dev/null @@ -1,184 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "wallHeatTransferFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(p, iF), - Tinf_(p.size(), 0.0), - alphaWall_(p.size(), 0.0) -{ - refValue() = 0.0; - refGrad() = 0.0; - valueFraction() = 0.0; -} - - -Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField -( - const wallHeatTransferFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - mixedFvPatchScalarField(ptf, p, iF, mapper), - Tinf_(ptf.Tinf_, mapper), - alphaWall_(ptf.alphaWall_, mapper) -{} - - -Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mixedFvPatchScalarField(p, iF), - Tinf_("Tinf", dict, p.size()), - alphaWall_("alphaWall", dict, p.size()) -{ - refValue() = Tinf_; - refGrad() = 0.0; - valueFraction() = 0.0; - - if (dict.found("value")) - { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); - } - else - { - evaluate(); - } -} - - -Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField -( - const wallHeatTransferFvPatchScalarField& tppsf -) -: - mixedFvPatchScalarField(tppsf), - Tinf_(tppsf.Tinf_), - alphaWall_(tppsf.alphaWall_) -{} - - -Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField -( - const wallHeatTransferFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(tppsf, iF), - Tinf_(tppsf.Tinf_), - alphaWall_(tppsf.alphaWall_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::wallHeatTransferFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - scalarField::autoMap(m); - Tinf_.autoMap(m); - alphaWall_.autoMap(m); -} - - -void Foam::wallHeatTransferFvPatchScalarField::rmap -( - const fvPatchScalarField& ptf, - const labelList& addr -) -{ - mixedFvPatchScalarField::rmap(ptf, addr); - - const wallHeatTransferFvPatchScalarField& tiptf = - refCast(ptf); - - Tinf_.rmap(tiptf.Tinf_, addr); - alphaWall_.rmap(tiptf.alphaWall_, addr); -} - - -void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchScalarField& Cpw = - patch().lookupPatchField("Cp"); - - const fvPatchScalarField& kByCpw = - patch().lookupPatchField("kByCp"); - - valueFraction() = - 1.0/ - ( - 1.0 - + Cpw*kByCpw*patch().deltaCoeffs()/alphaWall_ - ); - - mixedFvPatchScalarField::updateCoeffs(); -} - - -void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const -{ - fvPatchScalarField::write(os); - Tinf_.writeEntry("Tinf", os); - alphaWall_.writeEntry("alphaWall", os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField(fvPatchScalarField, wallHeatTransferFvPatchScalarField); -} - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H b/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H deleted file mode 100644 index cf5284a087..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H +++ /dev/null @@ -1,194 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::wallHeatTransferFvPatchScalarField - -Description - Enthalpy boundary conditions for wall heat transfer - -SourceFiles - wallHeatTransferFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef wallHeatTransferFvPatchScalarField_H -#define wallHeatTransferFvPatchScalarField_H - -#include "mixedFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class wallHeatTransferFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class wallHeatTransferFvPatchScalarField -: - public mixedFvPatchScalarField -{ - // Private data - - //- Tinf - scalarField Tinf_; - - //- alphaWall - scalarField alphaWall_; - - -public: - - //- Runtime type information - TypeName("wallHeatTransfer"); - - - // Constructors - - //- Construct from patch and internal field - wallHeatTransferFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - wallHeatTransferFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given wallHeatTransferFvPatchScalarField - // onto a new patch - wallHeatTransferFvPatchScalarField - ( - const wallHeatTransferFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - wallHeatTransferFvPatchScalarField - ( - const wallHeatTransferFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new wallHeatTransferFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - wallHeatTransferFvPatchScalarField - ( - const wallHeatTransferFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new wallHeatTransferFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Access - - //- Return Tinf - const scalarField& Tinf() const - { - return Tinf_; - } - - //- Return reference to Tinf to allow adjustment - scalarField& Tinf() - { - return Tinf_; - } - - //- Return alphaWall - const scalarField& alphaWall() const - { - return alphaWall_; - } - - //- Return reference to alphaWall to allow adjustment - scalarField& alphaWall() - { - return alphaWall_; - } - - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchScalarField&, - const labelList& - ); - - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 3197a72bee..73babb08f0 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,7 +1,4 @@ { - rho1 = eos1->rho(p, T); - rho2 = eos2->rho(p, T); - volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); @@ -29,28 +26,44 @@ tmp p_rghEqnComp1; tmp p_rghEqnComp2; - //if (transonic) - //{ - //} - //else + if (pimple.transonic()) { surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); + p_rghEqnComp1 = + fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1) + + correction + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ); + deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr()); + p_rghEqnComp1().relax(); + + p_rghEqnComp2 = + fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) + + correction + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ); + deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr()); + p_rghEqnComp2().relax(); + } + else + { p_rghEqnComp1 = fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh)) - + fvc::div(phid1, p_rgh) - - fvc::Sp(fvc::div(phid1), p_rgh); + + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1); p_rghEqnComp2 = fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh)) - + fvc::div(phid2, p_rgh) - - fvc::Sp(fvc::div(phid2), p_rgh); + + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2); } - // 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; + // Cache p_rgh prior to solve for density update + volScalarField p_rgh_0(p_rgh); while (pimple.correctNonOrthogonal()) { @@ -72,8 +85,8 @@ if (pimple.finalNonOrthogonalIter()) { - // Second part of thermodynamic density update - //thermo.rho() += psi*p_rgh; + //p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); + //p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh; dgdt = ( @@ -91,8 +104,13 @@ p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); - rho1 = eos1->rho(p, T); - rho2 = eos2->rho(p, T); + // Update densities from change in p_rgh + rho1 += psi1*(p_rgh - p_rgh_0); + rho2 += psi2*(p_rgh - p_rgh_0); + + rho = alpha1*rho1 + alpha2*rho2; + + K = 0.5*magSqr(U); Info<< "max(U) " << max(mag(U)).value() << endl; Info<< "min(p_rgh) " << min(p_rgh).value() << endl; diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files deleted file mode 100644 index e6e260c74a..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/files +++ /dev/null @@ -1,8 +0,0 @@ -phaseEquationOfState/phaseEquationOfState.C -phaseEquationOfState/newPhaseEquationOfState.C -constant/constant.C -linear/linear.C -perfectFluid/perfectFluid.C -adiabaticPerfectFluid/adiabaticPerfectFluid.C - -LIB = $(FOAM_LIBBIN)/libphaseEquationsOfState diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options deleted file mode 100644 index 0ec1139209..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/Make/options +++ /dev/null @@ -1,6 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/transportModels/incompressible/lnInclude - -LIB_LIBS = \ - -lincompressibleTransportModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C deleted file mode 100644 index 82a195dca9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.C +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "adiabaticPerfectFluid.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(adiabaticPerfectFluid, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - adiabaticPerfectFluid, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::adiabaticPerfectFluid::adiabaticPerfectFluid -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - p0_("p0", dimPressure, dict.lookup("p0")), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - gamma_("gamma", dimless, dict.lookup("gamma")), - B_("B", dimPressure, dict.lookup("B")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::adiabaticPerfectFluid::~adiabaticPerfectFluid() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp -Foam::phaseEquationsOfState::adiabaticPerfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_) - ) - ); -} - - -Foam::tmp -Foam::phaseEquationsOfState::adiabaticPerfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - (rho0_/(gamma_*(p0_ + B_))) - *pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C deleted file mode 100644 index 54b6705dd9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/constant/constant.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "constant.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(constant, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - constant, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::constant::constant -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho_("rho", dimDensity, dict.lookup("rho")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::constant::~constant() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::constant::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - rho_ - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::constant::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - dimensionedScalar("psi", dimDensity/dimPressure, 0) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C deleted file mode 100644 index 3680735a1b..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/linear/linear.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "linear.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(linear, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - linear, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::linear::linear -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - psi_("psi", dimDensity/dimPressure, dict.lookup("psi")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::linear::~linear() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::linear::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi_*p - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::linear::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - p.mesh(), - psi_ - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C deleted file mode 100644 index 6a148d8d68..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/perfectFluid/perfectFluid.C +++ /dev/null @@ -1,119 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "perfectFluid.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace phaseEquationsOfState -{ - defineTypeNameAndDebug(perfectFluid, 0); - - addToRunTimeSelectionTable - ( - phaseEquationOfState, - perfectFluid, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::perfectFluid::perfectFluid -( - const dictionary& dict -) -: - phaseEquationOfState(dict), - rho0_("rho0", dimDensity, dict.lookup("rho0")), - R_("R", dimensionSet(0, 2, -2, -1, 0), dict.lookup("R")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::phaseEquationsOfState::perfectFluid::~perfectFluid() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::phaseEquationsOfState::perfectFluid::rho -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "rho", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - rho0_ + psi(p, T)*p - ) - ); -} - - -Foam::tmp Foam::phaseEquationsOfState::perfectFluid::psi -( - const volScalarField& p, - const volScalarField& T -) const -{ - return tmp - ( - new volScalarField - ( - IOobject - ( - "psi", - p.time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - 1.0/(R_*T) - ) - ); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H b/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H deleted file mode 100644 index 45a5079d0d..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/phaseEquationsOfState/phaseEquationOfState/phaseEquationOfState.H +++ /dev/null @@ -1,127 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::phaseEquationOfState - -Description - A2stract base-class for dispersed-phase particle diameter models. - -SourceFiles - phaseEquationOfState.C - newDiameterModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef phaseEquationOfState_H -#define phaseEquationOfState_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "dictionary.H" -#include "volFieldsFwd.H" -#include "runTimeSelectionTables.H" - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class phaseEquationOfState Declaration -\*---------------------------------------------------------------------------*/ - -class phaseEquationOfState -{ -protected: - - // Protected data - - const dictionary& dict_; - - -public: - - //- Runtime type information - TypeName("phaseEquationOfState"); - - - // Declare runtime construction - - declareRunTimeSelectionTable - ( - autoPtr, - phaseEquationOfState, - dictionary, - ( - const dictionary& dict - ), - (dict) - ); - - - // Constructors - - phaseEquationOfState - ( - const dictionary& dict - ); - - - //- Destructor - virtual ~phaseEquationOfState(); - - - // Selectors - - static autoPtr New - ( - const dictionary& dict - ); - - - // Member Functions - - //- Return the phase density - virtual tmp rho - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; - - //- Return the phase compressibility - virtual tmp psi - ( - const volScalarField& p, - const volScalarField& T - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/files new file mode 100644 index 0000000000..1cd0a09577 --- /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/twoPhaseMixtureThermo/Make/options b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options new file mode 100644 index 0000000000..8dbf02aa06 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseMixture \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C new file mode 100644 index 0000000000..d81f5ccb1f --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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::twoPhaseMixtureThermo::he +( + const volScalarField& p, + const volScalarField& T +) const +{ + return alpha1()*thermo1_->he(p, T) + alpha2()*thermo2_->he(p, T); +} + + +Foam::tmp 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::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::twoPhaseMixtureThermo::hc() const +{ + return alpha1()*thermo1_->hc() + alpha2()*thermo2_->hc(); +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::THE +( + const scalarField& h, + const scalarField& p, + const scalarField& T0, + const labelList& cells +) const +{ + notImplemented("twoPhaseMixtureThermo::THE(...)"); + return T0; +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::THE +( + const scalarField& h, + const scalarField& p, + const scalarField& T0, + const label patchi +) const +{ + notImplemented("twoPhaseMixtureThermo::THE(...)"); + return T0; +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::Cp() const +{ + return alpha1()*thermo1_->Cp() + alpha2()*thermo2_->Cp(); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::Cv() const +{ + return alpha1()*thermo1_->Cv() + alpha2()*thermo2_->Cv(); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::gamma() const +{ + return alpha1()*thermo1_->gamma() + alpha2()*thermo2_->gamma(); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::Cpv() const +{ + return alpha1()*thermo1_->Cpv() + alpha2()*thermo2_->Cpv(); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::CpByCpv() const +{ + return + alpha1()*thermo1_->CpByCpv() + + alpha2()*thermo2_->CpByCpv(); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::kappa() const +{ + return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa(); +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::kappa +( + const label patchi +) const +{ + return + alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi) + + alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi); +} + + +Foam::tmp Foam::twoPhaseMixtureThermo::kappaEff +( + const volScalarField& alphat +) const +{ + return + alpha1()*thermo1_->kappaEff(alphat) + + alpha2()*thermo2_->kappaEff(alphat); +} + + +Foam::tmp 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::twoPhaseMixtureThermo::alphaEff +( + const volScalarField& alphat +) const +{ + return + alpha1()*thermo1_->alphaEff(alphat) + + alpha2()*thermo2_->alphaEff(alphat); +} + + +Foam::tmp 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/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H new file mode 100644 index 0000000000..608dc91a9b --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -0,0 +1,287 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::twoPhaseMixtureThermo + +Description + +SourceFiles + twoPhaseMixtureThermoI.H + twoPhaseMixtureThermo.C + twoPhaseMixtureThermoIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef twoPhaseMixtureThermo_H +#define twoPhaseMixtureThermo_H + +#include "rhoThermo.H" +#include "psiThermo.H" +#include "twoPhaseMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class twoPhaseMixtureThermo Declaration +\*---------------------------------------------------------------------------*/ + +class twoPhaseMixtureThermo +: + public psiThermo, + public twoPhaseMixture +{ + // Private data + + //- Thermo-package of phase 1 + autoPtr thermo1_; + + //- Thermo-package of phase 2 + autoPtr thermo2_; + + +public: + + //- Runtime type information + TypeName("twoPhaseMixtureThermo"); + + + // Constructors + + //- Construct from mesh + twoPhaseMixtureThermo + ( + const fvMesh& mesh + ); + + + //- Destructor + virtual ~twoPhaseMixtureThermo(); + + + // Member Functions + + const rhoThermo& thermo1() const + { + return thermo1_(); + } + + const rhoThermo& thermo2() const + { + return thermo2_(); + } + + rhoThermo& thermo1() + { + return thermo1_(); + } + + rhoThermo& thermo2() + { + return thermo2_(); + } + + //- Update properties + virtual void correct(); + + //- Return true if the equation of state is incompressible + // i.e. rho != f(p) + virtual bool incompressible() const; + + //- Return true if the equation of state is isochoric + // i.e. rho = const + virtual bool isochoric() const; + + + // Access to thermodynamic state variables + + //- Enthalpy/Internal energy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& he() + { + notImplemented("twoPhaseMixtureThermo::he()"); + return thermo1_->he(); + } + + //- Enthalpy/Internal energy [J/kg] + virtual const volScalarField& he() const + { + notImplemented("twoPhaseMixtureThermo::he() const"); + return thermo1_->he(); + } + + //- Enthalpy/Internal energy + // for given pressure and temperature [J/kg] + virtual tmp he + ( + const volScalarField& p, + const volScalarField& T + ) const; + + //- Enthalpy/Internal energy for cell-set [J/kg] + virtual tmp he + ( + const scalarField& p, + const scalarField& T, + const labelList& cells + ) const; + + //- Enthalpy/Internal energy for patch [J/kg] + virtual tmp he + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + //- Chemical enthalpy [J/kg] + virtual tmp hc() const; + + //- Temperature from enthalpy/internal energy for cell-set + virtual tmp THE + ( + const scalarField& h, + const scalarField& p, + const scalarField& T0, // starting temperature + const labelList& cells + ) const; + + //- Temperature from enthalpy/internal energy for patch + virtual tmp THE + ( + const scalarField& h, + const scalarField& p, + const scalarField& T0, // starting temperature + const label patchi + ) const; + + + // Fields derived from thermodynamic state variables + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp Cp() const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp Cp + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant volume [J/kg/K] + virtual tmp Cv() const; + + //- Heat capacity at constant volume for patch [J/kg/K] + virtual tmp Cv + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + //- gamma = Cp/Cv [] + virtual tmp gamma() const; + + //- gamma = Cp/Cv for patch [] + virtual tmp gamma + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure/volume [J/kg/K] + virtual tmp Cpv() const; + + //- Heat capacity at constant pressure/volume for patch [J/kg/K] + virtual tmp Cpv + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity ratio [] + virtual tmp CpByCpv() const; + + //- Heat capacity ratio for patch [] + virtual tmp CpByCpv + ( + const scalarField& p, + const scalarField& T, + const label patchi + ) const; + + + // Fields derived from transport state variables + + //- Thermal diffusivity for temperature of mixture [J/m/s/K] + virtual tmp kappa() const; + + //- Thermal diffusivity of mixture for patch [J/m/s/K] + virtual tmp kappa + ( + const label patchi + ) const; + + //- Effective thermal diffusivity of mixture [J/m/s/K] + virtual tmp kappaEff + ( + const volScalarField& alphat + ) const; + + //- Effective thermal diffusivity of mixture for patch [J/m/s/K] + virtual tmp kappaEff + ( + const scalarField& alphat, + const label patchi + ) const; + + //- Effective thermal diffusivity of mixture [J/m/s/K] + virtual tmp alphaEff + ( + const volScalarField& alphat + ) const; + + //- Effective thermal diffusivity of mixture for patch [J/m/s/K] + virtual tmp alphaEff + ( + const scalarField& alphat, + const label patchi + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H index b64277749e..1f12fc9a12 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H @@ -19,34 +19,46 @@ fvScalarMatrix he1Eqn ( - fvm::ddt(alpha1, he1) - + fvm::div(alphaPhi1, he1) + fvm::ddt(alpha1, he1) + fvm::div(alphaPhi1, he1) + + fvc::ddt(alpha1, K1) + fvc::div(alphaPhi1, K1) // Compressibity correction - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), he1) + - (fvc::ddt(alpha1) + fvc::div(alphaPhi1))*K1 + + + ( + he1.name() == thermo1.phasePropertyName("e") + ? fvc::div(alphaPhi1, p) + : -dalpha1pdt + )/rho1 - fvm::laplacian(k1, he1) == heatTransferCoeff*(thermo2.T() - thermo1.T())/rho1 + heatTransferCoeff*he1/Cpv1/rho1 - fvm::Sp(heatTransferCoeff/Cpv1/rho1, he1) - + alpha1*(dpdt/rho1 - (fvc::ddt(K1) + fvc::div(phi1, K1))) ); fvScalarMatrix he2Eqn ( - fvm::ddt(alpha2, he2) - + fvm::div(alphaPhi2, he2) + fvm::ddt(alpha2, he2) + fvm::div(alphaPhi2, he2) + + fvc::ddt(alpha2, K2) + fvc::div(alphaPhi2, K2) // Compressibity correction - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), he2) + - (fvc::ddt(alpha2) + fvc::div(alphaPhi2))*K2 + + + ( + he2.name() == thermo2.phasePropertyName("e") + ? fvc::div(alphaPhi2, p) + : -dalpha2pdt + )/rho2 - fvm::laplacian(k2, he2) == heatTransferCoeff*(thermo1.T() - thermo2.T())/rho2 + heatTransferCoeff*he2/Cpv2/rho2 - fvm::Sp(heatTransferCoeff/Cpv2/rho2, he2) - + alpha2*(dpdt/rho2 - (fvc::ddt(K2) + fvc::div(phi2, K2))) ); he1Eqn.relax(); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H index ce5c622f9a..ae22926c4e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H @@ -1,3 +1,7 @@ +mrfZones.correctBoundaryVelocity(U1); +mrfZones.correctBoundaryVelocity(U2); +mrfZones.correctBoundaryVelocity(U); + fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H index a20f53e014..601ff0e919 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H @@ -104,6 +104,35 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); { alphaPhi1 = alphaPhic1; } + + /* + // Legacy semi-implicit and potentially unbounded form + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + + fvm::div(phic, alpha1, alphaScheme) + + fvm::div + ( + -fvc::flux(-phir, alpha2, alpharScheme), + alpha1, + alpharScheme + ) + == + fvm::Sp(Sp, alpha1) + Su + ); + + alpha1Eqn.relax(); + alpha1Eqn.solve(); + + if (nAlphaSubCycles > 1) + { + alphaPhi1 += (runTime.deltaT()/totalDeltaT)*alpha1Eqn.flux(); + } + else + { + alphaPhi1 = alpha1Eqn.flux(); + } + */ } if (g0.value() > 0.0) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H index cf19664d85..cc5b3ebe21 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H @@ -62,10 +62,10 @@ volScalarField& p = thermo1.p(); - volScalarField rho1("rho" + phase1Name, thermo1.rho()); + volScalarField& rho1 = thermo1.rho(); const volScalarField& psi1 = thermo1.psi(); - volScalarField rho2("rho" + phase2Name, thermo2.rho()); + volScalarField& rho2 = thermo2.rho(); const volScalarField& psi2 = thermo2.psi(); volVectorField U @@ -275,8 +275,8 @@ ); - Info<< "Creating field dpdt\n" << endl; - volScalarField dpdt + Info<< "Creating field dalpha1pdt\n" << endl; + volScalarField dalpha1pdt ( IOobject ( @@ -285,7 +285,20 @@ mesh ), mesh, - dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) + dimensionedScalar("dalpha1pdt", p.dimensions()/dimTime, 0) + ); + + Info<< "Creating field dalpha2pdt\n" << endl; + volScalarField dalpha2pdt + ( + IOobject + ( + "dpdt", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dalpha2pdt", p.dimensions()/dimTime, 0) ); Info<< "Creating field kinetic energy K\n" << endl; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H index f9a7807d00..02e49b5661 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H @@ -1,7 +1,4 @@ { - rho1 = thermo1.rho(); - rho2 = thermo2.rho(); - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); surfaceScalarField alpha2f(scalar(1) - alpha1f); @@ -91,10 +88,7 @@ tmp pEqnComp1; tmp pEqnComp2; - //if (transonic) - //{ - //} - //else + if (pimple.transonic()) { surfaceScalarField phid1 ( @@ -107,17 +101,42 @@ fvc::interpolate(psi2)*phi2 ); + pEqnComp1 = + fvc::ddt(rho1) + + fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1) + + correction + ( + psi1*fvm::ddt(p) + + fvm::div(phid1, p) - fvm::Sp(fvc::div(phid1), p) + ); + deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr()); + pEqnComp1().relax(); + + pEqnComp2 = + fvc::ddt(rho2) + + fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2) + + correction + ( + psi2*fvm::ddt(p) + + fvm::div(phid2, p) - fvm::Sp(fvc::div(phid2), p) + ); + deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr()); + pEqnComp2().relax(); + } + else + { pEqnComp1 = fvc::ddt(rho1) + psi1*correction(fvm::ddt(p)) - + fvc::div(phid1, p) - - fvc::Sp(fvc::div(phid1), p); + + fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1); pEqnComp2 = fvc::ddt(rho2) + psi2*correction(fvm::ddt(p)) - + fvc::div(phid2, p) - - fvc::Sp(fvc::div(phid2), p); + + fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2); } + // Cache p prior to solve for density update + volScalarField p_0(p); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqnIncomp @@ -182,16 +201,20 @@ p = max(p, pMin); - thermo1.correct(); - thermo2.correct(); - rho1 = thermo1.rho(); - rho2 = thermo2.rho(); + // Update densities from change in p + rho1 += psi1*(p - p_0); + rho2 += psi2*(p - p_0); K1 = 0.5*magSqr(U1); K2 = 0.5*magSqr(U2); if (thermo1.dpdt()) { - dpdt = fvc::ddt(p); + dalpha1pdt = fvc::ddt(alpha1, p); + } + + if (thermo2.dpdt()) + { + dalpha2pdt = fvc::ddt(alpha2, p); } } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 5dff309b57..112a302188 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -26,6 +26,7 @@ License #include "phaseModel.H" #include "diameterModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -118,7 +119,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 7580c3f9ac..3d1b93f429 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -41,7 +41,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "fvcSmooth.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options b/applications/solvers/multiphase/interFoam/LTSInterFoam/Make/options index b5c7b88e4f..33560b54e6 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -11,7 +12,8 @@ EXE_INC = \ EXE_LIBS = \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index 5f5ac824b8..faae197670 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 6c82f94049..57c78027a4 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 99cc1dd8bd..b819068ddd 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -40,7 +40,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "IOMRFZoneList.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options index b5c7b88e4f..db2e1736ee 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -10,8 +11,9 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -ltwoPhaseMixture \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index b87380d8a1..b1cfcac9bd 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -9,8 +10,9 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -ltwoPhaseMixture \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index b96dcf898d..a2720e20ee 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 6c82f94049..57c78027a4 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 df1edf04e1..f0d1809848 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 4fa14dd6d2..2a5429f7a8 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -12,8 +13,9 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -ltwoPhaseMixture \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H index 0e373e1f40..c4cdbc044b 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H @@ -53,6 +53,8 @@ fvc::makeRelative(phi, U); } } - - #include "continuityErrs.H" } + +phi.oldTime() = phi; + +#include "continuityErrs.H" diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 1a9d210e23..fa16f17141 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -37,7 +37,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" #include "fvIOoptionList.H" diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 53cc2719b9..51f082b616 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -41,7 +41,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" #include "fvIOoptionList.H" diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options b/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options index 6c54b4454b..cc09aeb2f3 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/twoPhaseMixture/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,8 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options index b5c7b88e4f..db2e1736ee 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -10,8 +11,9 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -ltwoPhaseMixture \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index ea1a15b032..39c81c7a8d 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -42,7 +42,7 @@ Description #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" -#include "twoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "turbulenceModel.H" #include "IOporosityModelList.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options index 5416a161a8..58b340781f 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/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ @@ -7,8 +8,9 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -ltwoPhaseMixture \ -linterfaceProperties \ - -ltwoPhaseInterfaceProperties \ + -ltwoPhaseProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 7ff971ed7f..817db5012c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -49,8 +49,6 @@ } } - #include "continuityErrs.H" - p == p_rgh + rho*gh; if (p_rgh.needReference()) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index f1e8feec00..08728c8f92 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 3a7c4c7a53..c08eba9390 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 fdfe30d5e7..fc81d080d3 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/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index a63ff3c85a..7584d84f27 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -1,3 +1,5 @@ +#include "mrfZonesCorrectBCs.H" + PtrList UEqns(fluid.phases().size()); autoPtr dragCoeffs(fluid.dragCoeffs()); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H b/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H new file mode 100644 index 0000000000..d670aa4a41 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H @@ -0,0 +1,6 @@ + forAllIter(PtrDictionary, fluid.phases(), iter) + { + mrfZones.correctBoundaryVelocity(iter().U()); + } + + mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index d1804b5b6d..acad49cd96 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.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 @@ -418,6 +418,47 @@ Foam::multiphaseSystem::multiphaseSystem ).ptr() ); } + + forAllConstIter(PtrDictionary, phases_, iter1) + { + const phaseModel& phase1 = iter1(); + + forAllConstIter(PtrDictionary, phases_, iter2) + { + const phaseModel& phase2 = iter2(); + + if (&phase2 != &phase1) + { + scalarCoeffSymmTable::const_iterator sigma + ( + sigmas_.find(interfacePair(phase1, phase2)) + ); + + if (sigma != sigmas_.end()) + { + scalarCoeffSymmTable::const_iterator cAlpha + ( + cAlphas_.find(interfacePair(phase1, phase2)) + ); + + if (cAlpha == cAlphas_.end()) + { + WarningIn + ( + "multiphaseSystem::multiphaseSystem" + "(const volVectorField& U," + "const surfaceScalarField& phi)" + ) << "Compression coefficient not specified for " + "phase pair (" + << phase1.name() << ' ' << phase2.name() + << ") for which a surface tension " + "coefficient is specified" + << endl; + } + } + } + } + } } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 543927e29b..f74ef12513 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.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 @@ -26,6 +26,7 @@ License #include "phaseModel.H" #include "diameterModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -152,7 +153,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index 6e20519ec9..53ea250a16 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/twoPhaseMixture/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 \ + -ltwoPhaseMixture \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H index 139646e43c..6bc5953a4a 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 6c82f94049..57c78027a4 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 0d01b9a9e5..18b686f4f8 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 6113aba01f..8c51a402ee 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/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index aebc7ba6cb..85ee12b316 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.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 @@ -25,6 +25,7 @@ License #include "phaseModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -114,7 +115,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index a0056d3c9a..57f4e68589 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.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 @@ -181,7 +181,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() gradient() = ( - (traction_ + pressure_*n)/rho + (traction_ - pressure_*n)/rho + twoMuLambda*fvPatchField::snGrad() - (n & sigmaD) )/twoMuLambda; diff --git a/applications/test/BinSum/Test-BinSum.C b/applications/test/BinSum/Test-BinSum.C index f8d9532aeb..873e7eb893 100644 --- a/applications/test/BinSum/Test-BinSum.C +++ b/applications/test/BinSum/Test-BinSum.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/test/Matrix/Test-Matrix.C b/applications/test/Matrix/Test-Matrix.C index eac3e9a8e8..9663ae8217 100644 --- a/applications/test/Matrix/Test-Matrix.C +++ b/applications/test/Matrix/Test-Matrix.C @@ -56,9 +56,9 @@ int main(int argc, char *argv[]) Info<< hmm << endl; - SquareMatrix hmm3(Sin); + //SquareMatrix hmm3(Sin); - Info<< hmm3 << endl; + //Info<< hmm3 << endl; SquareMatrix hmm4; @@ -71,6 +71,38 @@ int main(int argc, char *argv[]) hmm4 = hmm5; Info<< hmm5 << endl; + { + scalarSymmetricSquareMatrix symmMatrix(3, 3, 0); + + symmMatrix(0, 0) = 4; + symmMatrix(1, 0) = 12; + symmMatrix(1, 1) = 37; + symmMatrix(2, 0) = -16; + symmMatrix(2, 1) = -43; + symmMatrix(2, 2) = 98; + + Info<< "Symmetric Square Matrix = " << symmMatrix << endl; + + Info<< "Inverse = " << inv(symmMatrix) << endl; + Info<< "Determinant = " << det(symmMatrix) << endl; + + scalarSymmetricSquareMatrix symmMatrix2(symmMatrix); + LUDecompose(symmMatrix2); + + Info<< "Inverse = " << invDecomposed(symmMatrix2) << endl; + Info<< "Determinant = " << detDecomposed(symmMatrix2) << endl; + + scalarDiagonalMatrix rhs(3, 0); + rhs[0] = 1; + rhs[1] = 2; + rhs[2] = 3; + + LUsolve(symmMatrix, rhs); + + Info<< "Decomposition = " << symmMatrix << endl; + Info<< "Solution = " << rhs << endl; + } + { scalarSquareMatrix squareMatrix(3, 3, 0); @@ -97,64 +129,6 @@ int main(int argc, char *argv[]) Info<< "Solution = " << rhs << endl; } - { - scalarSymmetricSquareMatrix symmMatrix(4, 4, 0); - - symmMatrix(0, 0) = 3.44854; - - symmMatrix(1, 0) = -2.70766; - symmMatrix(1, 1) = 5.49922; - - symmMatrix(2, 0) = -0.96245; - symmMatrix(2, 1) = 2.40948; - symmMatrix(2, 2) = 1.56918; - - symmMatrix(3, 0) = 1.95912; - symmMatrix(3, 1) = -3.46118; - symmMatrix(3, 2) = -1.01410; - symmMatrix(3, 3) = 3.24753; - - Info<< "Symmetric Square Matrix = " << symmMatrix << endl; - - Info<< "Inverse = " << inv(symmMatrix) << endl; - Info<< "Determinant = " << det(symmMatrix) << endl; - - scalarSymmetricSquareMatrix symmMatrix2(symmMatrix); - LUDecompose(symmMatrix2); - - Info<< "Inverse = " << invDecomposed(symmMatrix2) << endl; - Info<< "Determinant = " << detDecomposed(symmMatrix2) << endl; - - scalarDiagonalMatrix rhs(4, 0); - rhs[0] = 1; - rhs[1] = 2; - rhs[2] = 3; - rhs[3] = 4; - - LUsolve(symmMatrix, rhs); - - Info<< "Decomposition = " << symmMatrix << endl; - Info<< "Solution = " << rhs << endl; - } - - { - IFstream str("datafile"); - scalarSymmetricSquareMatrix symmMatrix(str); - Info<< "Symmetric Square Matrix = " << symmMatrix << endl; - - Info<< "Inverse = " << inv(symmMatrix) << endl; - Info<< "Determinant (ans = 0.24130) = " << det(symmMatrix) << endl; - - scalarDiagonalMatrix rhs(4, 0); - rhs[0] = 1; - rhs[1] = 2; - rhs[2] = 3; - rhs[3] = 4; - - LUsolve(symmMatrix, rhs); - Info<< "Solution = " << rhs << endl; - } - Info<< "\nEnd\n" << endl; return 0; diff --git a/applications/test/PointEdgeWave/Test-PointEdgeWave.C b/applications/test/PointEdgeWave/Test-PointEdgeWave.C index 229268d518..c49c8662c1 100644 --- a/applications/test/PointEdgeWave/Test-PointEdgeWave.C +++ b/applications/test/PointEdgeWave/Test-PointEdgeWave.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 @@ -41,50 +41,50 @@ using namespace Foam; int main(int argc, char *argv[]) { - argList::validArgs.append("patch"); + argList::validArgs.append("(patches)"); # include "setRootCase.H" # include "createTime.H" # include "createPolyMesh.H" - const polyBoundaryMesh& patches = mesh.boundaryMesh(); + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); - // Get name of patch - const word patchName = args[1]; + labelList patchIDs + ( + pbm.patchSet(wordReList(IStringStream(args[1])())).sortedToc() + ); - // Find the label in patches by name. - label patchI = patches.findPatchID(patchName); + Info<< "Starting walk from patches " + << UIndirectList(pbm.names(), patchIDs) + << nl + << endl; + label nPoints = 0; + forAll(patchIDs, i) { - // Test whether any processor has patch - label maxPatchI = patchI; - - reduce(maxPatchI, maxOp