Permalink
Browse files

reactingTwoPhaseEulerFoam: New twoPhaseEulerFoam supporting mass-tran…

…sfer and reactions

Multi-species, mass-transfer and reaction support and multi-phase
structure provided by William Bainbridge.

Integration of the latest p-U and face-p_U algorithms with William's
multi-phase structure is not quite complete due to design
incompatibilities which needs further development.  However the
integration of the functionality is complete.

The results of the tutorials are not exactly the same for the
twoPhaseEulerFoam and reactingTwoPhaseEulerFoam solvers but are very
similar.  Further analysis in needed to ensure these differences are
physical or to resolve them; in the meantime the twoPhaseEulerFoam
solver will be maintained.
  • Loading branch information...
Henry Weller
Henry Weller committed Jun 12, 2015
1 parent 6ba9208 commit 3ed90ae73d3bd5a1114614a8ee869a6c0dd1335d
Showing 575 changed files with 88,511 additions and 0 deletions.
@@ -0,0 +1,11 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+set -x
+
+wclean libso phaseSystems
+wclean libso interfacialModels
+wclean libso interfacialCompositionModels
+wclean libso phaseCompressibleTurbulenceModels
+wclean
+
+# ----------------------------------------------------------------- end-of-file
@@ -0,0 +1,13 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+set -x
+
+wmakeLnInclude interfacialModels
+wmakeLnInclude interfacialCompositionModels
+wmake libso phaseSystems
+wmake libso interfacialModels
+wmake libso interfacialCompositionModels
+wmake libso phaseCompressibleTurbulenceModels
+wmake
+
+# ----------------------------------------------------------------- end-of-file
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
+
+Global
+ CourantNo
+
+Description
+ Calculates and outputs the mean and maximum Courant Numbers.
+
+\*---------------------------------------------------------------------------*/
+
+scalar CoNum = 0.0;
+scalar meanCoNum = 0.0;
+
+if (mesh.nInternalFaces())
+{
+ scalarField sumPhi
+ (
+ fvc::surfaceSum(mag(phi))().internalField()
+ );
+
+ CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
+
+ meanCoNum =
+ 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
+}
+
+Info<< "Courant Number mean: " << meanCoNum
+ << " max: " << CoNum << endl;
+
+// ************************************************************************* //
@@ -0,0 +1,12 @@
+ #include "CourantNo.H"
+
+{
+ scalar UrCoNum = 0.5*gMax
+ (
+ fvc::surfaceSum(mag(phi1 - phi2))().internalField()/mesh.V().field()
+ )*runTime.deltaTValue();
+
+ Info<< "Max Ur Courant Number = " << UrCoNum << endl;
+
+ CoNum = max(CoNum, UrCoNum);
+}
@@ -0,0 +1,47 @@
+{
+ autoPtr<phaseSystem::heatTransferTable>
+ heatTransferPtr(fluid.heatTransfer());
+
+ phaseSystem::heatTransferTable&
+ heatTransfer = heatTransferPtr();
+
+ {
+ tmp<fvScalarMatrix> he1Eqn(phase1.heEqn());
+
+ if (he1Eqn.valid())
+ {
+ he1Eqn =
+ (
+ he1Eqn
+ ==
+ *heatTransfer[phase1.name()]
+ + fvOptions(alpha1, rho1, phase1.thermo().he())
+ );
+
+ he1Eqn->relax();
+ fvOptions.constrain(he1Eqn());
+ he1Eqn->solve();
+ }
+ }
+
+ {
+ tmp<fvScalarMatrix> he2Eqn(phase2.heEqn());
+
+ if (he2Eqn.valid())
+ {
+ he2Eqn =
+ (
+ he2Eqn
+ ==
+ *heatTransfer[phase2.name()]
+ + fvOptions(alpha2, rho2, phase2.thermo().he())
+ );
+
+ he2Eqn->relax();
+ fvOptions.constrain(he2Eqn());
+ he2Eqn->solve();
+ }
+ }
+}
+
+fluid.correctThermo();
@@ -0,0 +1,3 @@
+reactingTwoPhaseEulerFoam.C
+
+EXE = $(FOAM_APPBIN)/reactingTwoPhaseEulerFoam
@@ -0,0 +1,24 @@
+EXE_INC = \
+ -IphaseSystems/lnInclude \
+ -IinterfacialModels/lnInclude \
+ -IinterfacialCompositionModels/lnInclude \
+ -IphaseCompressibleTurbulenceModels/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/fvOptions/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude \
+ -I$(LIB_SRC)/sampling/lnInclude
+
+EXE_LIBS = \
+ -lreactingTwoPhaseSystem \
+ -lreactingEulerianInterfacialModels \
+ -lreactingEulerianInterfacialCompositionModels \
+ -lphaseReactingTurbulenceModels \
+ -lfiniteVolume \
+ -lfvOptions \
+ -lmeshTools \
+ -lsampling
@@ -0,0 +1,50 @@
+{
+ autoPtr<phaseSystem::massTransferTable>
+ massTransferPtr(fluid.massTransfer());
+
+ phaseSystem::massTransferTable&
+ massTransfer(massTransferPtr());
+
+ PtrList<volScalarField>& Y1 = phase1.Y();
+ PtrList<volScalarField>& Y2 = phase2.Y();
+
+ forAll(Y1, i)
+ {
+ tmp<fvScalarMatrix> Y1iEqn(phase1.YiEqn(Y1[i]));
+
+ if (Y1iEqn.valid())
+ {
+ Y1iEqn =
+ (
+ Y1iEqn
+ ==
+ *massTransfer[Y1[i].name()]
+ + fvOptions(alpha1, rho1, Y1[i])
+ );
+
+ Y1iEqn->relax();
+ Y1iEqn->solve(mesh.solver("Yi"));
+ }
+ }
+
+ forAll(Y2, i)
+ {
+ tmp<fvScalarMatrix> Y2iEqn(phase2.YiEqn(Y2[i]));
+
+ if (Y2iEqn.valid())
+ {
+ Y2iEqn =
+ (
+ Y2iEqn
+ ==
+ *massTransfer[Y2[i].name()]
+ + fvOptions(alpha2, rho2, Y2[i])
+ );
+
+ Y2iEqn->relax();
+ Y2iEqn->solve(mesh.solver("Yi"));
+ }
+ }
+
+ fluid.massTransfer(); // updates interfacial mass flow rates
+}
@@ -0,0 +1,7 @@
+phase1.continuityError() =
+ fvc::ddt(alpha1, rho1) + fvc::div(alphaRhoPhi1)
+ - (fvOptions(alpha1, rho1)&rho1);
+
+phase2.continuityError() =
+ fvc::ddt(alpha2, rho2) + fvc::div(alphaRhoPhi2)
+ - (fvOptions(alpha2, rho2)&rho2);
@@ -0,0 +1,73 @@
+ #include "readGravitationalAcceleration.H"
+ #include "readhRef.H"
+
+ Info<< "Creating phaseSystem\n" << endl;
+
+ autoPtr<twoPhaseSystem> fluidPtr
+ (
+ twoPhaseSystem::New(mesh)
+ );
+ twoPhaseSystem& fluid = fluidPtr();
+
+ phaseModel& phase1 = fluid.phase1();
+ phaseModel& phase2 = fluid.phase2();
+
+ volScalarField& alpha1 = phase1;
+ volScalarField& alpha2 = phase2;
+
+ volVectorField& U1 = phase1.U();
+ surfaceScalarField& phi1 = phase1.phi();
+ surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
+ surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi();
+
+ volVectorField& U2 = phase2.U();
+ surfaceScalarField& phi2 = phase2.phi();
+ surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
+ surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi();
+
+ surfaceScalarField& phi = fluid.phi();
+
+ dimensionedScalar pMin
+ (
+ "pMin",
+ dimPressure,
+ fluid.lookup("pMin")
+ );
+
+ #include "gh.H"
+
+ rhoThermo& thermo1 = phase1.thermo();
+ rhoThermo& thermo2 = phase2.thermo();
+
+ volScalarField& p = thermo1.p();
+
+ volScalarField& rho1 = thermo1.rho();
+ const volScalarField& psi1 = thermo1.psi();
+
+ volScalarField& rho2 = thermo2.rho();
+ const volScalarField& psi2 = thermo2.psi();
+
+ Info<< "Reading field p_rgh\n" << endl;
+ volScalarField p_rgh
+ (
+ IOobject
+ (
+ "p_rgh",
+ runTime.timeName(),
+ mesh,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh
+ );
+
+ label pRefCell = 0;
+ scalar pRefValue = 0.0;
+ setRefCell
+ (
+ p,
+ p_rgh,
+ pimple.dict(),
+ pRefCell,
+ pRefValue
+ );
@@ -0,0 +1,3 @@
+ IOMRFZoneList MRF(mesh);
+ MRF.correctBoundaryVelocity(U1);
+ MRF.correctBoundaryVelocity(U2);
@@ -0,0 +1,20 @@
+massTransferModels/massTransferModel/massTransferModel.C
+massTransferModels/massTransferModel/newMassTransferModel.C
+massTransferModels/Frossling/Frossling.C
+massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C
+
+surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C
+surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C
+surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C
+
+interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C
+interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C
+interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C
+
+saturationPressureModels/saturationPressureModel/saturationPressureModel.C
+saturationPressureModels/saturationPressureModel/newSaturationPressureModel.C
+saturationPressureModels/Antoine/Antoine.C
+saturationPressureModels/AntoineExtended/AntoineExtended.C
+saturationPressureModels/ArdenBuck/ArdenBuck.C
+
+LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialCompositionModels
@@ -0,0 +1,27 @@
+EXE_INC = \
+ -I../phaseSystems/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
+ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
+ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
+ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
+
+LIB_LIBS = \
+ -lreactingTwoPhaseSystem \
+ -lfluidThermophysicalModels \
+ -lreactionThermophysicalModels \
+ -lspecie
Oops, something went wrong.

0 comments on commit 3ed90ae

Please sign in to comment.