INT: Org integration of VOF, Euler phase solvers and models.

Integration of VOF MULES new interfaces. Update of VOF solvers and all instances
of MULES in the code.
Integration of reactingTwoPhaseEuler and reactingMultiphaseEuler solvers and sub-models
Updating reactingEuler tutorials accordingly (most of them tested)

New eRefConst thermo used in tutorials. Some modifications at thermo specie level
affecting mostly eThermo. hThermo mostly unaffected

New chtMultiRegionTwoPhaseEulerFoam solver for quenching and tutorial.

Phases sub-models for reactingTwoPhaseEuler and reactingMultiphaseEuler were moved
to src/phaseSystemModels/reactingEulerFoam in order to be used by BC for
chtMultiRegionTwoPhaseEulerFoam.

Update of interCondensatingEvaporatingFoam solver.
This commit is contained in:
Sergio Ferraris
2019-06-07 09:38:35 +01:00
committed by Andrew Heather
parent 0628bfb017
commit 8170f2ad92
914 changed files with 68142 additions and 8336 deletions

View File

@ -0,0 +1,5 @@
derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
../solid/solidRegionDiffNo.C
chtMultiRegionTwoPhaseEulerFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionTwoPhaseEulerFoam

View File

@ -0,0 +1,41 @@
EXE_INC = \
-I. \
-I.. \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialModels/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/lnInclude \
-I./fluid \
-I../solid \
-I../fluid \
-I../include \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
EXE_LIBS = \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lsolidThermo \
-ltwoPhaseReactingTurbulenceModels \
-lmeshTools \
-lfiniteVolume \
-lfvOptions \
-lradiationModels \
-lregionModels \
-lsampling \
-lreactingTwoPhaseSystem \

View File

@ -0,0 +1,166 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
chtMultiRegionTwoPhaseEulerFoam
Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent fluid flow and solid heat
conduction with conjugate heat transfer between solid and fluid regions.
It solves a two-phase Euler approach on the fluid region.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "twoPhaseSystem.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "pimpleControl.H"
#include "fixedGradientFvPatchFields.H"
#include "regionProperties.H"
#include "solidRegionDiffNo.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "coordinateSystem.H"
#include "loopControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for buoyant, turbulent two phase fluid flow and"
"solid heat conduction with conjugate heat transfer "
"between solid and fluid regions."
);
#define NO_CONTROL
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMeshes.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "readSolidTimeControls.H"
#include "compressibleMultiRegionCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setInitialMultiRegionDeltaT.H"
while (runTime.run())
{
#include "readTimeControls.H"
#include "readSolidTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleMultiRegionCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setMultiRegionDeltaT.H"
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
if (nOuterCorr != 1)
{
forAll(fluidRegions, i)
{
#include "storeOldFluidFields.H"
}
}
// --- PIMPLE loop
for (int oCorr=0; oCorr<nOuterCorr; ++oCorr)
{
const bool finalIter = (oCorr == nOuterCorr-1);
forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "solveSolid.H"
}
// Additional loops for energy solution only
if (!oCorr && nOuterCorr > 1)
{
loopControl looping(runTime, pimple, "energyCoupling");
while (looping.loop())
{
Info<< nl << looping << nl;
forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
frozenFlow = true;
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "solveSolid.H"
}
}
}
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,516 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "phaseSystem.H"
#include "mappedPatchBase.H"
#include "solidThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::regionType
>
Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::regionTypeNames_
{
{ regionType::solid, "solid" },
{ regionType::fluid, "fluid" },
};
const Foam::Enum
<
Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::KMethodType
>
Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::KMethodTypeNames_
{
{ KMethodType::mtSolidThermo, "solidThermo" },
{ KMethodType::mtLookup, "lookup" },
{ KMethodType::mtPhaseSystem, "phaseSystem" }
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
kappa
(
const scalarField& Tp
) const
{
const polyMesh& mesh = patch().boundaryMesh().mesh();
const label patchi = patch().index();
switch (method_)
{
case mtSolidThermo:
{
const solidThermo& thermo =
mesh.lookupObject<solidThermo>(basicThermo::dictName);
return thermo.kappa(patchi);
break;
}
case mtLookup:
{
if (mesh.foundObject<volScalarField>(kappaName_))
{
return patch().lookupPatchField<volScalarField, scalar>
(
kappaName_
);
}
else if (mesh.foundObject<volSymmTensorField>(kappaName_))
{
const symmTensorField& KWall =
patch().lookupPatchField<volSymmTensorField, scalar>
(
kappaName_
);
const vectorField n(patch().nf());
return n & KWall & n;
}
else
{
FatalErrorInFunction
<< "Did not find field " << kappaName_
<< " on mesh " << mesh.name() << " patch " << patch().name()
<< nl
<< " Please set 'kappa' to the name of a volScalarField"
<< " or volSymmTensorField."
<< exit(FatalError);
}
break;
}
case mtPhaseSystem:
{
// Lookup the fluid model
const phaseSystem& fluid =
(
mesh.lookupObject<phaseSystem>("phaseProperties")
);
tmp<scalarField> kappaEff
(
new scalarField(patch().size(), 0.0)
);
forAll(fluid.phases(), phasei)
{
const phaseModel& phase = fluid.phases()[phasei];
const fvPatchScalarField& alpha = phase.boundaryField()[patchi];
kappaEff.ref() += alpha*phase.kappaEff(patchi)();
}
return kappaEff;
break;
}
default:
{
FatalErrorInFunction
<< "Unimplemented method " << KMethodTypeNames_[method_] << nl
<< "Please set 'kappaMethod' to one of "
<< flatOutput(KMethodTypeNames_.sortedToc()) << nl
<< "and 'kappa' to the name of the volScalar"
<< exit(FatalError);
}
}
return scalarField(0);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
regionType_(fluid),
method_(mtLookup),
kappaName_("none"),
otherPhaseName_("vapor"),
TnbrName_("undefined-Tnbr"),
qrNbrName_("undefined-qrNbr"),
qrName_("undefined-qr")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField& psf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(psf, p, iF, mapper),
regionType_(psf.regionType_),
method_(psf.method_),
kappaName_(psf.kappaName_),
otherPhaseName_(psf.otherPhaseName_),
TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_)
{}
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
regionType_(regionTypeNames_.read(dict.lookup("region"))),
method_(KMethodTypeNames_.get("kappaMethod", dict)),
kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
otherPhaseName_(dict.lookup("otherPhase")),
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")),
qrName_(dict.lookupOrDefault<word>("qr", "none"))
{
if (!isA<mappedPatchBase>(this->patch().patch()))
{
FatalErrorInFunction
<< "' not type '" << mappedPatchBase::typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << internalField().name()
<< " in file " << internalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(psf, iF),
regionType_(psf.regionType_),
method_(psf.method_),
kappaName_(psf.kappaName_),
otherPhaseName_(psf.otherPhaseName_),
TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::
updateCoeffs()
{
if (updated())
{
return;
}
const polyMesh& mesh = patch().boundaryMesh().mesh();
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag+1;
// Get the coupling information from the mappedPatchBase
const label patchi = patch().index();
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchi = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
scalarField& Tp = *this;
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&
nbrField = refCast
<const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
// Swap to obtain full local values of neighbour internal field
scalarField TcNbr(nbrField.patchInternalField());
mpp.distribute(TcNbr);
// Swap to obtain full local values of neighbour K*delta
scalarField KDeltaNbr;
KDeltaNbr = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
mpp.distribute(KDeltaNbr);
scalarField KDelta(kappa(Tp)*patch().deltaCoeffs());
scalarField qr(Tp.size(), 0.0);
if (qrName_ != "none")
{
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
}
scalarField qrNbr(Tp.size(), 0.0);
if (qrNbrName_ != "none")
{
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
mpp.distribute(qrNbr);
}
if (regionType_ == solid)
{
// Lookup the fluid model in the nbrFvMesh
const phaseSystem& fluid =
(
nbrMesh.lookupObject<phaseSystem>("phaseProperties")
);
// The BC is applied to the liquid phase of the fluid
const phaseModel& liquid
(
fluid.phases()[nbrField.internalField().group()]
);
const phaseModel& vapor(fluid.phases()[otherPhaseName_]);
scalarField KDeltaLiqNbr;
const fvPatchScalarField& alphal = liquid.boundaryField()[samplePatchi];
KDeltaLiqNbr =
alphal*(liquid.kappaEff(samplePatchi))*nbrPatch.deltaCoeffs();
mpp.distribute(KDeltaLiqNbr);
scalarField KDeltaVapNbr;
const fvPatchScalarField& alphav = vapor.boundaryField()[samplePatchi];
KDeltaVapNbr =
alphav*(vapor.kappaEff(samplePatchi))*nbrPatch.deltaCoeffs();
mpp.distribute(KDeltaVapNbr);
scalarField TvNbr;
const fvPatchScalarField& Tv =
vapor.thermo().T().boundaryField()[samplePatchi];
TvNbr = Tv.patchInternalField();
mpp.distribute(TvNbr);
// TcNbr: liquid Tp
// TvNbr: vapour Tp
scalarField c(TcNbr*KDeltaLiqNbr + TvNbr*KDeltaVapNbr);
valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta);
refValue() = c/KDeltaNbr;
refGrad() = (qr + qrNbr)/kappa(Tp);
if (debug)
{
scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
Info<< "T solid : " << nl << endl;
Info
<< " heat transfer rate from solid:" << Q
<< " walltemperature "
<< " min:" << gMin(Tp)
<< " max:" << gMax(Tp)
<< " avg:" << gAverage(Tp)
<< endl;
}
}
else if (regionType_ == fluid)
{
const phaseSystem& fluid =
(
mesh.lookupObject<phaseSystem>("phaseProperties")
);
const phaseModel& liquid
(
fluid.phases()[internalField().group()]
);
const phaseModel& vapor(fluid.phases()[otherPhaseName_]);
const fvPatchScalarField& Tv =
vapor.thermo().T().boundaryField()[patchi];
const fvPatchScalarField& alphav = vapor.boundaryField()[patchi];
const scalarField KdeltaVap
(
alphav*(vapor.kappaEff(patchi))*patch().deltaCoeffs()
);
const fvPatchScalarField& alphal = liquid.boundaryField()[patchi];
const scalarField KdeltaLiq
(
alphal*(liquid.kappaEff(patchi))*patch().deltaCoeffs()
);
// TcNbr: solid Tp
// Tv: vapour Tp
const scalarField c(TcNbr*KDeltaNbr + Tv.patchInternalField()*KdeltaVap);
const scalarField a(KdeltaVap + KDeltaNbr);
valueFraction() = a/(a + KdeltaLiq);
refValue() = c/a;
refGrad() = (qr + qrNbr)/kappa(Tp);
if (debug)
{
scalarField Tc(patchInternalField());
scalarField qLiq((Tp - Tc)*KdeltaLiq);
scalarField qVap((Tp - Tv.patchInternalField())*KdeltaVap);
Info<< "T flow : " << nl << endl;
Info<< " qLiq: " << gMin(qLiq) << " - " << gMax(qLiq) << endl;
Info<< " qVap: " << gMin(qVap) << " - " << gMax(qVap) << endl;
scalar QLiq = gSum(qLiq*patch().magSf());
scalar QVap = gSum(qVap*patch().magSf());
Info<< " Heat transfer to Liq: " << QLiq << endl;
Info<< " Heat transfer to Vap: " << QVap << endl;
Info<< " walltemperature "
<< " min:" << gMin(Tp)
<< " max:" << gMax(Tp)
<< " avg:" << gAverage(Tp)
<< endl;
}
}
else
{
FatalErrorInFunction
<< "Unknown phase type. Valid types are: "
<< regionTypeNames_ << nl << exit(FatalError);
}
mixedFvPatchScalarField::updateCoeffs();
// Restore tag
UPstream::msgType() = oldTag;
}
void turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
os.writeEntryIfDifferent<word>("kappa","none", kappaName_);
os.writeEntry("Tnbr", TnbrName_);
os.writeEntryIfDifferent<word>("qrNbr", "none", qrNbrName_);
os.writeEntryIfDifferent<word>("qr", "none", qrName_);
os.writeKeyword("region") << regionTypeNames_[regionType_]
<< token::END_STATEMENT << nl;
os.writeKeyword("otherPhase") << otherPhaseName_ << token::END_STATEMENT
<< nl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,252 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
Description
Mixed boundary condition for temperature and radiation heat transfer
to be used for in multiregion cases with two phase Euler system
Usage
\table
Property | Description | Required | Default value
Tnbr | name of the field | no | T
qrNbr | name of the radiative flux in the nbr region | no | none
qr | name of the radiative flux in this region | no | none
region | region to which this BC belongs | yes
otherPhase | name of the vapour phase in the fluid region | yes
kappaMethod | inherited from temperatureCoupledBase | inherited |
kappa | inherited from temperatureCoupledBase | inherited |
\endtable
Example of the boundary condition specification on the fluid region:
\verbatim
<patchName>
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
Tnbr T;
qrNbr none;
qr none;
kappaMethod phaseSystem;
region fluid;
otherPhase gas;
value uniform 300;
}
\endverbatim
Example of the boundary condition specification on the solid region:
\verbatim
<patchName>
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
Tnbr T.liquid;
qrNbr none;
qr none;
kappaMethod solidThermo;
region solid;
otherPhase gas;
value uniform 300;
}
\endverbatim
Needs to be on underlying mapped(Wall)FvPatch.
SourceFiles
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField_H
#define turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField_H
#include "mixedFvPatchFields.H"
#include "scalarList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
:
public mixedFvPatchScalarField
{
public:
// Public enumerations
//- Type of supplied Kappa
enum KMethodType
{
mtSolidThermo,
mtLookup,
mtPhaseSystem
};
// Data types
//- Enumeration listing the region
enum regionType
{
solid,
fluid
};
private:
// Private data
//- Heat source type names
static const Enum<regionType> regionTypeNames_;
//- Kappa method types
static const Enum<KMethodType> KMethodTypeNames_;
//- Heat source type
regionType regionType_;
//- How to get K
const KMethodType method_;
//- Name of thermal conductivity field (if looked up from database)
const word kappaName_;
//- name of the other phase (vapor/liquid phase)
word otherPhaseName_;
//- Name of field on the neighbour region
const word TnbrName_;
//- Name of the radiative heat flux in the neighbour region
const word qrNbrName_;
//- Name of the radiative heat flux in local region
const word qrName_;
// Private members
//- Given patch temperature calculate corresponding K field
tmp<scalarField> kappa(const scalarField& Tp) const;
public:
//- Runtime type information
TypeName("compressible::turbulentTemperatureTwoPhaseRadCoupledMixed");
// Constructors
//- Construct from patch and internal field
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
// new patch
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
scalar CoNum = -GREAT;
forAll(fluidRegions, regioni)
{
if (fluidRegions[regioni].nInternalFaces())
{
const surfaceScalarField& phi =
phaseSystemFluid[regioni].phi();
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().primitiveField()
);
const surfaceScalarField& phi1 =
phaseSystemFluid[regioni].phase1().phiRef();
const surfaceScalarField& phi2 =
phaseSystemFluid[regioni].phase2().phiRef();
sumPhi = max
(
sumPhi,
fvc::surfaceSum(mag(phi1))().primitiveField()
);
sumPhi = max
(
sumPhi,
fvc::surfaceSum(mag(phi2))().primitiveField()
);
CoNum =
0.5*gMax
(
sumPhi/fluidRegions[regioni].V().field()
)*runTime.deltaTValue();
scalar UrCoNum = 0.5*gMax
(
fvc::surfaceSum(mag(phi1 - phi2))().primitiveField()
/ fluidRegions[regioni].V().field()
)*runTime.deltaTValue(),
CoNum = max(UrCoNum, CoNum);
}
}
Info<< "Courant Number max: " << CoNum << endl;

View File

@ -0,0 +1,147 @@
// Initialise fluid field pointer lists
PtrList<twoPhaseSystem> phaseSystemFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<uniformDimensionedScalarField> hRefFluid(fluidRegions.size());
PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<multivariateSurfaceInterpolationScheme<scalar>::fieldTable>
fieldsFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size());
List<bool> frozenFlowFluid(fluidRegions.size(), false);
List<label> pRefCellFluid(fluidRegions.size());
List<scalar> pRefValueFluid(fluidRegions.size());
PtrList<dimensionedScalar> pMinFluid(fluidRegions.size());
const uniformDimensionedVectorField& g = meshObjects::gravity::New(runTime);
PtrList<pimpleControl> pimpleFluid(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
{
Info<< "*** Reading fluid mesh thermophysical properties for region "
<< fluidRegions[i].name() << nl << endl;
pimpleFluid.set
(
i,
new pimpleControl(fluidRegions[i])
);
Info<< " Adding to phaseSystemFluid\n" << endl;
phaseSystemFluid.set(i, twoPhaseSystem::New(fluidRegions[i]).ptr());
Info<< " Adding hRefFluid\n" << endl;
hRefFluid.set
(
i,
new uniformDimensionedScalarField
(
IOobject
(
"hRef",
runTime.constant(),
fluidRegions[i],
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar("hRef", dimLength, Zero)
)
);
Info<< " Adding ghRef\n" << endl;
dimensionedScalar ghRef
(
mag(g.value()) > SMALL
? g & (cmptMag(g.value())/mag(g.value()))*hRefFluid[i]
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
);
ghFluid.set
(
i,
new volScalarField
(
"gh",
(g & fluidRegions[i].C()) - ghRef
)
);
ghfFluid.set
(
i,
new surfaceScalarField
(
"ghf",
(g & fluidRegions[i].Cf()) - ghRef
)
);
Info<< " Adding p_rghFluid\n" << endl;
p_rghFluid.set
(
i,
new volScalarField
(
IOobject
(
"p_rgh",
runTime.timeName(),
fluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
fluidRegions[i]
)
);
Info<< " Correcting p_rghFluid\n" << endl;
// Force p_rgh to be consistent with p
p_rghFluid[i] =
phaseSystemFluid[i].phase1().thermo().p()
- phaseSystemFluid[i].phase1().thermo().rho()*ghFluid[i];
fluidRegions[i].setFluxRequired(p_rghFluid[i].name());
Info<< " Correcting initialMassFluid\n" << endl;
initialMassFluid[i] =
fvc::domainIntegrate(phaseSystemFluid[i].rho()).value();
const dictionary& pimpleDict =
fluidRegions[i].solutionDict().subDict("PIMPLE");
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);
pRefCellFluid[i] = -1;
pRefValueFluid[i] = 0.0;
Info<< " Setting reference\n" << endl;
if (p_rghFluid[i].needReference())
{
setRefCell
(
phaseSystemFluid[i].phase1().thermoRef().p(),
p_rghFluid[i],
pimpleDict,
pRefCellFluid[i],
pRefValueFluid[i]
);
}
pMinFluid.set
(
i,
new dimensionedScalar
(
"pMin",
dimPressure,
phaseSystemFluid[i]
)
);
}

View File

@ -0,0 +1,28 @@
PtrList<uniformDimensionedScalarField> cumulativeContErrIO(fluidRegions.size());
forAll(cumulativeContErrIO, i)
{
#include "setRegionFluidFields.H"
cumulativeContErrIO.set
(
i,
new uniformDimensionedScalarField
(
IOobject
(
"cumulativeContErr",
runTime.timeName(),
"uniform",
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar(dimless, Zero)
)
);
}
UPtrList<scalar> cumulativeContErr(cumulativeContErrIO.size());
forAll(cumulativeContErrIO, i)
{
cumulativeContErr.set(i, &cumulativeContErrIO[i].value());
}

View File

@ -0,0 +1,11 @@
const dictionary& pimpleDict = mesh.solutionDict().subDict("PIMPLE");
Switch faceMomentum
(
pimpleDict.lookupOrDefault<Switch>("faceMomentum", false)
);
int nEnergyCorrectors
(
pimpleDict.lookupOrDefault<int>("nEnergyCorrectors", 1)
);

View File

@ -0,0 +1,58 @@
fvMesh& mesh = fluidRegions[i];
twoPhaseSystem& fluid = phaseSystemFluid[i];
phaseModel& phase1 = fluid.phase1();
phaseModel& phase2 = fluid.phase2();
const volScalarField& alpha1 = phase1;
const volScalarField& alpha2 = phase2;
volVectorField& U1 = phase1.URef();
surfaceScalarField& phi1 = phase1.phiRef();
const surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
volVectorField& U2 = phase2.URef();
surfaceScalarField& phi2 = phase2.phiRef();
const surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
surfaceScalarField& phi = fluid.phi();
rhoThermo& thermo1 = phase1.thermoRef();
rhoThermo& thermo2 = phase2.thermoRef();
thermo1.validate(args.executable(), "h", "e");
thermo2.validate(args.executable(), "h", "e");
volScalarField& rho1 = thermo1.rho();
const volScalarField& psi1 = thermo1.psi();
volScalarField& rho2 = thermo2.rho();
const volScalarField& psi2 = thermo2.psi();
const IOMRFZoneList& MRF = fluid.MRF();
fv::options& fvOptions = fluid.fvOptions();
volScalarField& p = thermo1.p();
volScalarField& p_rgh = p_rghFluid[i];
//const dimensionedVector& g = gFluid[i];
const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i];
const dimensionedScalar initialMass
(
"initialMass",
dimMass,
initialMassFluid[i]
);
bool frozenFlow = frozenFlowFluid[i];
//const label pRefCell = pRefCellFluid[i];
//const scalar pRefValue = pRefValueFluid[i];
pimpleControl& pimple = pimpleFluid[i];
const dimensionedScalar& pMin = pMinFluid[i];

View File

@ -0,0 +1,39 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (frozenFlow)
{
#include "EEqns.H"
}
else
{
fluid.solve();
fluid.correct();
#include "YEqns.H"
if (faceMomentum)
{
#include "pUf/UEqns.H"
#include "EEqns.H"
#include "pUf/pEqn.H"
}
else
{
#include "pU/UEqns.H"
#include "EEqns.H"
#include "pU/pEqn.H"
}
fluid.correctKinematics();
// Update alpha's for new U
fluid.correctTurbulence();
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -0,0 +1,2 @@
p_rghFluid[i].storePrevIter();
//rhoFluid[i].storePrevIter();

View File

@ -137,7 +137,8 @@
alphaPhi10,
talphaPhi1Corr0.ref(),
zeroField(), zeroField(),
1, 0
oneField(),
zeroField()
);
alphaPhi10 += talphaPhi1Corr0();
@ -187,8 +188,8 @@
talphaPhi1Corr.ref(),
Sp,
(-Sp*alpha1)(),
1,
0
oneField(),
zeroField()
);
// Under-relax the correction for all but the 1st corrector
@ -214,8 +215,8 @@
alphaPhi10,
Sp,
(Su + divU*min(alpha1(), scalar(1)))(),
1,
0
oneField(),
zeroField()
);
}

View File

@ -133,7 +133,15 @@
if (alphaApplyPrevCorr && talphaPhi1Corr0.valid())
{
Info<< "Applying the previous iteration compression flux" << endl;
MULES::correct(alpha1, alphaPhi10, talphaPhi1Corr0.ref(), 1, 0);
MULES::correct
(
geometricOneField(),
alpha1,
alphaPhi10,
talphaPhi1Corr0.ref(),
oneField(),
zeroField()
);
alphaPhi10 += talphaPhi1Corr0();
}
@ -182,8 +190,8 @@
talphaPhi1Corr.ref(),
Sp,
(-Sp*alpha1)(),
1,
0
oneField(),
zeroField()
);
// Under-relax the correction for all but the 1st corrector
@ -209,8 +217,8 @@
alphaPhi10,
Sp,
(Su + divU*min(alpha1(), scalar(1)))(),
1,
0
oneField(),
zeroField()
);
}

View File

@ -330,6 +330,25 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappa
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::alphahe() const
{
return
alpha1()*thermo1_->alphahe()
+ alpha2()*thermo2_->alphahe();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::alphahe
(
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->alphahe(patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->alphahe(patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::kappaEff
(
const volScalarField& alphat

View File

@ -268,6 +268,13 @@ public:
const label patchi
) const;
//- Thermal diffusivity for energy of mixture [kg/m/s]
virtual tmp<volScalarField> alphahe() const;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual tmp<volScalarField> kappaEff
(

View File

@ -45,6 +45,9 @@ namespace Foam
defineTypeNameAndDebug(multiphaseMixtureThermo, 0);
}
const Foam::scalar Foam::multiphaseMixtureThermo::convertToRad =
Foam::constant::mathematical::pi/180.0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -605,6 +608,45 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::kappa
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::alphahe() const
{
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
tmp<volScalarField> talphaEff(phasei()*phasei().thermo().alphahe());
for (++phasei; phasei != phases_.end(); ++phasei)
{
talphaEff.ref() += phasei()*phasei().thermo().alphahe();
}
return talphaEff;
}
Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::alphahe
(
const label patchi
) const
{
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
tmp<scalarField> talphaEff
(
phasei().boundaryField()[patchi]
*phasei().thermo().alphahe(patchi)
);
for (++phasei; phasei != phases_.end(); ++phasei)
{
talphaEff.ref() +=
phasei().boundaryField()[patchi]
*phasei().thermo().alphahe(patchi);
}
return talphaEff;
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::kappaEff
(
const volScalarField& alphat
@ -1042,8 +1084,8 @@ void Foam::multiphaseMixtureThermo::solveAlphas
alphaPhiCorr,
zeroField(),
zeroField(),
1,
0,
oneField(),
zeroField(),
true
);

View File

@ -138,6 +138,10 @@ private:
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
//- Conversion factor for degrees into radians
static const scalar convertToRad;
// Private member functions
@ -388,6 +392,13 @@ public:
const label patchi
) const;
//- Thermal diffusivity for energy of mixture [kg/m/s]
virtual tmp<volScalarField> alphahe() const;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual tmp<volScalarField> kappaEff
(

View File

@ -32,11 +32,12 @@
MULES::correct
(
geometricOneField(),
alpha1,
alphaPhi,
talphaPhiCorr0.ref(),
mixture.alphaMax(),
0
UniformField<scalar>(mixture.alphaMax()),
zeroField()
);
alphaPhi += talphaPhiCorr0();
@ -71,11 +72,12 @@
MULES::correct
(
geometricOneField(),
alpha1,
talphaPhiUn(),
talphaPhiCorr.ref(),
mixture.alphaMax(),
0
UniformField<scalar>(mixture.alphaMax()),
zeroField()
);
// Under-relax the correction for all but the 1st corrector
@ -95,11 +97,12 @@
MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
alphaPhi,
mixture.alphaMax(),
0
UniformField<scalar>(mixture.alphaMax()),
zeroField()
);
}
}

View File

@ -72,7 +72,7 @@ MultiComponentPhaseModel
species_ = thermoPtr_->composition().species();
inertIndex_ = species_[thermoPtr_->getWord("inertSpecie")];
inertIndex_ = species_[thermoPtr_().template get<word>("inertSpecie")];
X_.setSize(thermoPtr_->composition().species().size());
@ -104,6 +104,7 @@ MultiComponentPhaseModel
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasePhaseModel, class phaseThermo>
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
::calculateVolumeFractions()
@ -190,7 +191,7 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
const dictionary& MULEScontrols = mesh.solverDict(alpha1.name());
scalar cAlpha(MULEScontrols.get<scalar>("cYi"));
scalar cAlpha(readScalar(MULEScontrols.lookup("cYi")));
PtrList<surfaceScalarField> phiYiCorrs(species_.size());
const surfaceScalarField& phi = this->fluid().phi();
@ -201,7 +202,7 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
surfaceScalarField phir(0.0*phi);
forAllConstIters(this->fluid().phases(),iter2)
forAllConstIter(phaseSystem::phaseModelTable,this->fluid().phases(),iter2)
{
const volScalarField& alpha2 = iter2()();
if (&alpha2 == &alpha1)
@ -250,7 +251,10 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
surfaceScalarField& phiYiCorr = phiYiCorrs[i];
forAllConstIters(this->fluid().phases(), iter2)
forAllConstIter
(
phaseSystem::phaseModelTable, this->fluid().phases(), iter2
)
{
//const volScalarField& alpha2 = iter2()().oldTime();
const volScalarField& alpha2 = iter2()();
@ -298,8 +302,8 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
phiYiCorr,
Sp[i],
Su[i],
1,
0,
oneField(),
zeroField(),
true
);
}
@ -354,8 +358,8 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
phiYiCorr,
Sp[i],
Su[i],
1,
0
oneField(),
zeroField()
);
}
}
@ -369,8 +373,8 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::solveYi
phiYiCorr,
Sp[i],
Su[i],
1,
0
oneField(),
zeroField()
);
}
Yt += Yi;

View File

@ -213,6 +213,18 @@ Foam::tmp<Foam::scalarField> Foam::phaseModel::kappa(const label patchI) const
}
Foam::tmp<Foam::volScalarField> Foam::phaseModel::alphahe() const
{
return thermo().alphahe();
}
Foam::tmp<Foam::scalarField> Foam::phaseModel::alphahe(const label patchI) const
{
return thermo().alphahe(patchI);
}
Foam::tmp<Foam::volScalarField>Foam::phaseModel::kappaEff
(
const volScalarField& kappat

View File

@ -226,6 +226,12 @@ public:
//- Thermal diffusivity for temperature of phase for patch [J/m/s/K]
tmp<scalarField> kappa(const label patchi) const;
//- Thermal diffusivity for energy of mixture [kg/m/s]
tmp<volScalarField> alphahe() const;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal diffusivity for temperature of phase [J/m/s/K]
tmp<volScalarField> kappaEff(const volScalarField&) const;

View File

@ -414,8 +414,8 @@ void Foam::multiphaseSystem::solve()
phiAlphaCorr,
Sp,
Su,
1,
0,
oneField(),
zeroField(),
true
);
++phasei;
@ -485,8 +485,8 @@ void Foam::multiphaseSystem::solve()
phiAlpha,
(alphaSubCycle.index()*Sp)(),
(Su - (alphaSubCycle.index() - 1)*Sp*alpha1)(),
1,
0
oneField(),
zeroField()
);
if (alphaSubCycle.index() == 1)
@ -511,8 +511,8 @@ void Foam::multiphaseSystem::solve()
phiAlpha,
Sp,
Su,
1,
0
oneField(),
zeroField()
);
phase.alphaPhi() = phiAlpha;

View File

@ -649,6 +649,48 @@ Foam::tmp<Foam::scalarField> Foam::phaseSystem::kappa(const label patchI) const
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::alphahe() const
{
phaseModelTable::const_iterator phaseModelIter = phaseModels_.begin();
tmp<volScalarField> talphaEff
(
phaseModelIter()()*phaseModelIter()->alphahe()
);
for (; phaseModelIter != phaseModels_.end(); ++phaseModelIter)
{
talphaEff.ref() += phaseModelIter()()*phaseModelIter()->alphahe();
}
return talphaEff;
}
Foam::tmp<Foam::scalarField> Foam::phaseSystem::alphahe
(
const label patchi
) const
{
phaseModelTable::const_iterator phaseModelIter = phaseModels_.begin();
tmp<scalarField> talphaEff
(
phaseModelIter()().boundaryField()[patchi]
*phaseModelIter()->alphahe(patchi)
);
for (; phaseModelIter != phaseModels_.end(); ++phaseModelIter)
{
talphaEff.ref() +=
phaseModelIter()().boundaryField()[patchi]
*phaseModelIter()->alphahe(patchi);
}
return talphaEff;
}
Foam::tmp<Foam::volScalarField>Foam::phaseSystem::kappaEff
(
const volScalarField& kappat

View File

@ -396,6 +396,12 @@ public:
const label patchi
) const;
//- Thermal diffusivity for energy of mixture [kg/m/s]
virtual tmp<volScalarField> alphahe() const;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal diffusivity for temperature
// of mixture [J/m/s/K]
virtual tmp<volScalarField> kappaEff

View File

@ -1,17 +1,11 @@
{
tmp<volScalarField> tcp(thermo->Cp());
const volScalarField& cp = tcp();
rhoCp = rho*cp;
kappaEff = thermo->kappa() + rho*cp*turbulence->nut()/Prt;
pDivU = dimensionedScalar("pDivU", p.dimensions()/dimTime, Zero);
if (thermo->pDivU())
{
pDivU = (p*fvc::div(rhoPhi/fvc::interpolate(rho)));
}
const surfaceScalarField rhoCpPhi(fvc::interpolate(cp)*rhoPhi);
Pair<tmp<volScalarField>> vDotAlphal = mixture->mDot();
@ -23,13 +17,13 @@
fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoCpPhi, T, "div(rhoCpPhi,T)")
+ fvm::div(rhoCpPhi, T)
- fvm::Sp(fvc::ddt(rhoCp) + fvc::div(rhoCpPhi), T)
- fvm::laplacian(kappaEff, T)
+ thermo->hc()*vDotvmcAlphal
+ pDivU
);
TEqn.relax();
TEqn.solve();

View File

@ -57,8 +57,7 @@ volScalarField rho
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types()
alpha1*rho1 + alpha2*rho2
);
rho.oldTime();
@ -123,19 +122,6 @@ volScalarField kappaEff
thermo->kappa()
);
Info<< "Creating field pDivU\n" << endl;
volScalarField pDivU
(
IOobject
(
"pDivU",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, Zero)
);
// Need to store rho for ddt(rhoCp, U)
volScalarField rhoCp
(
@ -149,4 +135,5 @@ volScalarField rhoCp
),
rho*thermo->Cp()
);
rhoCp.oldTime();

View File

@ -118,9 +118,8 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H"
#include "eEqn.H"
#include "TEqn.H"
// --- Pressure corrector loop
while (pimple.correct())

View File

@ -490,6 +490,22 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::kappa
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::alphahe() const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::alphahe
(
const label patchi
) const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::kappaEff
(
const volScalarField& kappat

View File

@ -246,6 +246,12 @@ public:
const label patchi
) const;
//- Thermal diffusivity for energy of mixture [kg/m/s]
virtual tmp<volScalarField> alphahe() const;
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal diffusivity for temperature
//- of mixture [J/m/s/K]
virtual tmp<volScalarField> kappaEff

View File

@ -87,8 +87,8 @@
alphaPhi1,
zeroField(),
zeroField(),
1,
0
oneField(),
zeroField()
);
}
else
@ -103,8 +103,8 @@
alphaPhi1,
zeroField(),
zeroField(),
1,
0
oneField(),
zeroField()
);
}
@ -155,8 +155,8 @@
alphaPhi2,
zeroField(),
zeroField(),
1,
0
oneField(),
zeroField()
);
}
else
@ -171,8 +171,8 @@
alphaPhi2,
zeroField(),
zeroField(),
1,
0
oneField(),
zeroField()
);
}

View File

@ -78,8 +78,8 @@
divU*(alpha10 - alpha100)
- vDotvmcAlphal*alpha10
)(),
1,
0
oneField(),
zeroField()
);
// Under-relax the correction for all but the 1st corrector
@ -103,8 +103,8 @@
talphaPhiCorr.ref(),
vDotvmcAlphal,
(divU*alpha1 + vDotcAlphal)(),
1,
0
oneField(),
zeroField()
);
talphaPhi = talphaPhiCorr;

View File

@ -5,7 +5,7 @@
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
| Copyright (C) 2011-2018 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,7 +37,12 @@ License
#include "fvcDiv.H"
#include "fvcFlux.H"
#include "fvcAverage.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
const Foam::scalar Foam::multiphaseSystem::convertToRad =
Foam::constant::mathematical::pi/180.0;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -124,8 +129,8 @@ void Foam::multiphaseSystem::solveAlphas()
alphaPhiCorr,
zeroField(),
zeroField(),
1,
0,
oneField(),
zeroField(),
true
);
@ -143,7 +148,7 @@ void Foam::multiphaseSystem::solveAlphas()
mesh_
),
mesh_,
dimensionedScalar(dimless, Zero)
dimensionedScalar("sumAlpha", dimless, 0)
);
phasei = 0;
@ -158,9 +163,7 @@ void Foam::multiphaseSystem::solveAlphas()
(
geometricOneField(),
phase,
alphaPhi,
zeroField(),
zeroField()
alphaPhi
);
phase.alphaPhi() = alphaPhi;
@ -278,7 +281,7 @@ void Foam::multiphaseSystem::correctContactAngle
bool matched = (tp.key().first() == phase1.name());
const scalar theta0 = degToRad(tp().theta0(matched));
scalar theta0 = convertToRad*tp().theta0(matched);
scalarField theta(boundary[patchi].size(), theta0);
scalar uTheta = tp().uTheta();
@ -286,8 +289,8 @@ void Foam::multiphaseSystem::correctContactAngle
// Calculate the dynamic contact angle if required
if (uTheta > SMALL)
{
const scalar thetaA = degToRad(tp().thetaA(matched));
const scalar thetaR = degToRad(tp().thetaR(matched));
scalar thetaA = convertToRad*tp().thetaA(matched);
scalar thetaR = convertToRad*tp().thetaR(matched);
// Calculated the component of the velocity parallel to the wall
vectorField Uwall
@ -391,7 +394,7 @@ Foam::multiphaseSystem::multiphaseSystem
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar(dimless, Zero)
dimensionedScalar("alphas", dimless, 0.0)
),
sigmas_(lookup("sigmas")),
@ -411,7 +414,7 @@ Foam::multiphaseSystem::multiphaseSystem
forAllConstIters(dragModelsDict, iter)
{
dragModels_.insert
dragModels_.set
(
iter.key(),
dragModel::New
@ -419,7 +422,7 @@ Foam::multiphaseSystem::multiphaseSystem
iter(),
*phases_.lookup(iter.key().first()),
*phases_.lookup(iter.key().second())
)
).ptr()
);
}
@ -583,7 +586,12 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
mesh_
),
mesh_,
dimensionedVector(dimensionSet(1, -2, -2, 0, 0), Zero)
dimensionedVector
(
"Svm",
dimensionSet(1, -2, -2, 0, 0),
Zero
)
)
);
@ -636,7 +644,7 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
Foam::autoPtr<Foam::multiphaseSystem::dragCoeffFields>
Foam::multiphaseSystem::dragCoeffs() const
{
auto dragCoeffsPtr = autoPtr<dragCoeffFields>::New();
autoPtr<dragCoeffFields> dragCoeffsPtr(new dragCoeffFields);
forAllConstIters(dragModels_, iter)
{
@ -646,8 +654,8 @@ Foam::multiphaseSystem::dragCoeffs() const
(
max
(
//fvc::average(dm.phase1()*dm.phase2()),
//fvc::average(dm.phase1())*fvc::average(dm.phase2()),
// fvc::average(dm.phase1()*dm.phase2()),
// fvc::average(dm.phase1())*fvc::average(dm.phase2()),
dm.phase1()*dm.phase2(),
dm.residualPhaseFraction()
)
@ -702,7 +710,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff
mesh_
),
mesh_,
dimensionedScalar(dimensionSet(1, -3, -1, 0, 0), Zero)
dimensionedScalar
(
"dragCoeff",
dimensionSet(1, -3, -1, 0, 0),
0
)
)
);
@ -745,7 +758,12 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
mesh_
),
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero)
dimensionedScalar
(
"surfaceTension",
dimensionSet(1, -2, -2, 0, 0),
0
)
)
);
tSurfaceTension.ref().setOriented();
@ -789,7 +807,7 @@ Foam::multiphaseSystem::nearInterface() const
mesh_
),
mesh_,
dimensionedScalar(dimless, Zero)
dimensionedScalar("nearInterface", dimless, 0.0)
)
);
@ -813,7 +831,7 @@ void Foam::multiphaseSystem::solve()
const Time& runTime = mesh_.time();
const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
@ -845,7 +863,7 @@ void Foam::multiphaseSystem::solve()
mesh_
),
mesh_,
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero)
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
)
);
@ -912,14 +930,16 @@ bool Foam::multiphaseSystem::read()
readOK &= phase.read(phaseData[phasei++].dict());
}
readEntry("sigmas", sigmas_);
readEntry("interfaceCompression", cAlphas_);
readEntry("virtualMass", Cvms_);
lookup("sigmas") >> sigmas_;
lookup("interfaceCompression") >> cAlphas_;
lookup("virtualMass") >> Cvms_;
return readOK;
}
return false;
else
{
return false;
}
}

View File

@ -76,16 +76,30 @@ public:
{
public:
struct symmHash
class symmHash
:
public Hash<interfacePair>
{
public:
symmHash()
{}
label operator()(const interfacePair& key) const
{
return word::hash()(key.first()) + word::hash()(key.second());
}
};
struct hash
class hash
:
public Hash<interfacePair>
{
public:
hash()
{}
label operator()(const interfacePair& key) const
{
return word::hash()(key.first(), word::hash()(key.second()));
@ -95,7 +109,8 @@ public:
// Constructors
interfacePair() {} // = default
interfacePair()
{}
interfacePair(const word& alpha1Name, const word& alpha2Name)
:
@ -174,6 +189,9 @@ private:
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
//- Conversion factor for degrees into radians
static const scalar convertToRad;
// Private member functions
@ -220,7 +238,8 @@ public:
//- Destructor
virtual ~multiphaseSystem() = default;
virtual ~multiphaseSystem()
{}
// Member Functions

View File

@ -613,8 +613,8 @@ void Foam::multiphaseMixture::solveAlphas
alphaPhiCorr,
zeroField(),
zeroField(),
1,
0,
oneField(),
zeroField(),
true
);
@ -648,9 +648,7 @@ void Foam::multiphaseMixture::solveAlphas
(
geometricOneField(),
alpha,
alphaPhi,
zeroField(),
zeroField()
alphaPhi
);
rhoPhi_ += alphaPhi*alpha.rho();

View File

@ -1,10 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
wclean libso phaseSystems
wclean libso interfacialModels
wclean libso interfacialCompositionModels
reactingTwoPhaseEulerFoam/Allwclean
reactingMultiphaseEulerFoam/Allwclean
wclean reactingTwoPhaseEulerFoam
wclean reactingMultiphaseEulerFoam
wclean libso functionObjects
#------------------------------------------------------------------------------

View File

@ -4,12 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory
#------------------------------------------------------------------------------
wmakeLnInclude interfacialModels
wmakeLnInclude interfacialCompositionModels
wmake $targetType phaseSystems
wmake $targetType interfacialModels
wmake $targetType interfacialCompositionModels
reactingTwoPhaseEulerFoam/Allwmake $targetType $*
reactingMultiphaseEulerFoam/Allwmake $targetType $*
wmake $targetType functionObjects
#------------------------------------------------------------------------------

View File

@ -0,0 +1,4 @@
sizeDistribution/sizeDistribution.C
phaseForces/phaseForces.C
LIB = $(FOAM_LIBBIN)/libreactingEulerFoamFunctionObjects

View File

@ -0,0 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/functionObjects/field/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialModels/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude
LIB_LIBS = \
-lfieldFunctionObjects \
-lfiniteVolume

View File

@ -0,0 +1,306 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "phaseForces.H"
#include "addToRunTimeSelectionTable.H"
#include "BlendedInterfacialModel.H"
#include "dragModel.H"
#include "virtualMassModel.H"
#include "liftModel.H"
#include "wallLubricationModel.H"
#include "turbulentDispersionModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(phaseForces, 0);
addToRunTimeSelectionTable(functionObject, phaseForces, dictionary);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class modelType>
Foam::tmp<Foam::volVectorField>
Foam::functionObjects::phaseForces::nonDragForce(const phasePair& pair) const
{
const BlendedInterfacialModel<modelType>& model =
fluid_.lookupBlendedSubModel<modelType>(pair);
if (&pair.phase1() == &phase_)
{
return model.template F<vector>();
}
else
{
return -model.template F<vector>();
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::phaseForces::phaseForces
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fvMeshFunctionObject(name, runTime, dict),
phase_
(
mesh_.lookupObject<phaseModel>
(
IOobject::groupName("alpha", dict.get<word>("phase"))
)
),
fluid_(mesh_.lookupObject<phaseSystem>("phaseProperties"))
{
read(dict);
forAllConstIter
(
phaseSystem::phasePairTable,
fluid_.phasePairs(),
iter
)
{
const phasePair& pair = iter();
if (pair.contains(phase_) && !pair.ordered())
{
if (fluid_.foundBlendedSubModel<dragModel>(pair))
{
forceFields_.set
(
dragModel::typeName,
new volVectorField
(
IOobject
(
IOobject::groupName("dragForce", phase_.name()),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector(dimForce/dimVolume)
)
);
}
if (fluid_.foundBlendedSubModel<virtualMassModel>(pair))
{
forceFields_.set
(
virtualMassModel::typeName,
new volVectorField
(
IOobject
(
IOobject::groupName
(
"virtualMassForce",
phase_.name()
),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector(dimForce/dimVolume)
)
);
}
if (fluid_.foundBlendedSubModel<liftModel>(pair))
{
forceFields_.set
(
liftModel::typeName,
new volVectorField
(
IOobject
(
IOobject::groupName("liftForce", phase_.name()),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector(dimForce/dimVolume)
)
);
}
if (fluid_.foundBlendedSubModel<wallLubricationModel>(pair))
{
forceFields_.set
(
wallLubricationModel::typeName,
new volVectorField
(
IOobject
(
IOobject::groupName
(
"wallLubricationForce",
phase_.name()
),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector(dimForce/dimVolume)
)
);
}
if (fluid_.foundBlendedSubModel<turbulentDispersionModel>(pair))
{
forceFields_.set
(
turbulentDispersionModel::typeName,
new volVectorField
(
IOobject
(
IOobject::groupName
(
"turbulentDispersionForce",
phase_.name()
),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector(dimForce/dimVolume)
)
);
}
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::phaseForces::~phaseForces()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::phaseForces::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
return true;
}
bool Foam::functionObjects::phaseForces::execute()
{
forAllIter
(
HashPtrTable<volVectorField>,
forceFields_,
iter
)
{
const word& type = iter.key();
volVectorField& force = *iter();
force *= 0.0;
forAllConstIter
(
phaseSystem::phasePairTable,
fluid_.phasePairs(),
iter2
)
{
const phasePair& pair = iter2();
if (pair.contains(phase_) && !pair.ordered())
{
if (type == "dragModel")
{
force +=
fluid_.lookupBlendedSubModel<dragModel>(pair).K()
*(pair.otherPhase(phase_).U() - phase_.U());
}
if (type == "virtualMassModel")
{
force +=
fluid_.lookupBlendedSubModel<virtualMassModel>(pair).K()
*(
pair.otherPhase(phase_).DUDt()
- phase_.DUDt()
);
}
if (type == "liftModel")
{
force = nonDragForce<liftModel>(pair);
}
if (type == "wallLubricationModel")
{
force = nonDragForce<wallLubricationModel>(pair);
}
if (type == "turbulentDispersionModel")
{
force = nonDragForce<turbulentDispersionModel>(pair);
}
}
}
}
return true;
}
bool Foam::functionObjects::phaseForces::write()
{
forAllIter
(
HashPtrTable<volVectorField>,
forceFields_,
iter
)
{
writeObject(iter()->name());
}
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,163 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::phaseForces
Description
This function object calculates and outputs the blended interfacial forces
acting on a given phase, i.e. drag, virtual mass, lift, wall-lubrication and
turbulent dispersion. Note that it works only in run-time processing mode
and in combination with the reactingEulerFoam solvers.
For a simulation involving more than two phases, the accumulated force is
calculated by looping over all phasePairs involving that phase. The fields
are stored in the database so that they can be processed further, e.g. with
the fieldAveraging functionObject.
Example of function object specification:
\verbatim
phaseForces.water
{
type phaseForces;
libs ("libreactingEulerFoamFunctionObjects.so");
writeControl writeTime;
writeInterval 1;
...
phaseName water;
}
\endverbatim
Usage
\table
Property | Description | Required | Default value
type | type name: phaseForces | yes |
phaseName | Name of evaluated phase | yes |
\endtable
See also
Foam::BlendedInterfacialModel
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObject
SourceFiles
phaseForces.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_phaseForces_H
#define functionObjects_phaseForces_H
#include "fvMeshFunctionObject.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class phaseForces Declaration
\*---------------------------------------------------------------------------*/
class phaseForces
:
public fvMeshFunctionObject
{
// Private Member Functions
//- Disallow default bitwise copy construct
phaseForces(const phaseForces&);
//- Disallow default bitwise assignment
void operator=(const phaseForces&);
protected:
// Protected data
HashPtrTable<volVectorField> forceFields_;
//- Phase for which forces are evaluated
const phaseModel& phase_;
//- Constant access to phaseSystem
const phaseSystem& fluid_;
// Protected Member Functions
//- Evaluate and return non-drag force
template<class modelType>
tmp<volVectorField> nonDragForce(const phasePair& key) const;
public:
//- Runtime type information
TypeName("phaseForces");
// Constructors
//- Construct from Time and dictionary
phaseForces
(
const word& name,
const Time& runTime,
const dictionary&
);
//- Destructor
virtual ~phaseForces();
// Member Functions
//- Read the input data
virtual bool read(const dictionary& dict);
//- Calculate the force fields
virtual bool execute();
//- Write the force fields
virtual bool write();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,585 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "sizeDistribution.H"
#include "sizeGroup.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(sizeDistribution, 0);
addToRunTimeSelectionTable(functionObject, sizeDistribution, dictionary);
}
}
const Foam::Enum
<
Foam::functionObjects::sizeDistribution::selectionModeTypes
>
Foam::functionObjects::sizeDistribution::selectionModeTypeNames_
({
{selectionModeTypes::rtCellZone, "cellZone"},
{selectionModeTypes::rtAll, "all"},
});
const Foam::Enum
<
Foam::functionObjects::sizeDistribution::functionTypes
>
Foam::functionObjects::sizeDistribution::functionTypeNames_
({
{functionTypes::ftNdf, "numberDensity"},
{functionTypes::ftVdf, "volumeDensity"},
{functionTypes::ftNc, "numberConcentration"},
{functionTypes::ftMom, "moments"},
});
const Foam::Enum
<
Foam::functionObjects::sizeDistribution::abszissaTypes
>
Foam::functionObjects::sizeDistribution::abszissaTypeNames_
({
{abszissaTypes::atDiameter, "diameter"},
{abszissaTypes::atVolume, "volume"},
});
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::functionObjects::sizeDistribution::initialise
(
const dictionary& dict
)
{
switch (functionType_)
{
case ftNdf:
{
break;
}
case ftVdf:
{
break;
}
case ftNc:
{
break;
}
case ftMom:
{
break;
}
default:
{
FatalIOErrorInFunction(dict)
<< "Unknown functionType. Valid types are:"
<< functionTypeNames_ << nl << exit(FatalIOError);
}
}
switch (abszissaType_)
{
case atDiameter:
{
break;
}
case atVolume:
{
break;
}
default:
{
FatalIOErrorInFunction(dict)
<< "Unknown abszissaType. Valid types are:"
<< abszissaTypeNames_ << nl << exit(FatalIOError);
}
}
setCellZoneCells();
if (nCells_ == 0)
{
FatalIOErrorInFunction(dict)
<< type() << " " << name() << ": "
<< selectionModeTypeNames_[selectionModeType_]
<< "(" << selectionModeTypeName_ << "):" << nl
<< " Selection has no cells" << exit(FatalIOError);
}
volume_ = volume();
Info<< type() << " " << name() << ":"
<< selectionModeTypeNames_[selectionModeType_]
<< "(" << selectionModeTypeName_ << "):" << nl
<< " total cells = " << nCells_ << nl
<< " total volume = " << volume_
<< nl << endl;
}
void Foam::functionObjects::sizeDistribution::setCellZoneCells()
{
switch (selectionModeType_)
{
case rtCellZone:
{
dict().lookup("cellZone") >> selectionModeTypeName_;
label zoneId =
mesh().cellZones().findZoneID(selectionModeTypeName_);
if (zoneId < 0)
{
FatalIOErrorInFunction(dict_)
<< "Unknown cellZone name: " << selectionModeTypeName_
<< ". Valid cellZone names are: "
<< mesh().cellZones().names()
<< nl << exit(FatalIOError);
}
cellId_ = mesh().cellZones()[zoneId];
nCells_ = returnReduce(cellId_.size(), sumOp<label>());
break;
}
case rtAll:
{
cellId_ = identity(mesh().nCells());
nCells_ = returnReduce(cellId_.size(), sumOp<label>());
break;
}
default:
{
FatalIOErrorInFunction(dict_)
<< "Unknown selectionMode type. Valid selectionMode types are:"
<< selectionModeTypeNames_ << nl << exit(FatalIOError);
}
}
}
Foam::scalar Foam::functionObjects::sizeDistribution::volume() const
{
return gSum(filterField(mesh().V()));
}
void Foam::functionObjects::sizeDistribution::combineFields(scalarField& field)
{
List<scalarField> allValues(Pstream::nProcs());
allValues[Pstream::myProcNo()] = field;
Pstream::gatherList(allValues);
if (Pstream::master())
{
field =
ListListOps::combine<scalarField>
(
allValues,
accessOp<scalarField>()
);
}
}
Foam::tmp<Foam::scalarField>
Foam::functionObjects::sizeDistribution::filterField
(
const scalarField& field
) const
{
return tmp<scalarField>(new scalarField(field, cellId_));
}
void Foam::functionObjects::sizeDistribution::writeFileHeader
(
const label i
)
{
OFstream& file = this->file();
switch (functionType_)
{
case ftNdf:
{
writeHeader(file, "Number density function");
break;
}
case ftVdf:
{
writeHeader(file, "Volume density function");
break;
}
case ftNc:
{
writeHeader(file, "Number concentration");
break;
}
case ftMom:
{
writeHeader(file, "Moments");
break;
}
}
switch (abszissaType_)
{
case atVolume:
{
writeCommented(file, "Time/volume");
break;
}
case atDiameter:
{
writeCommented(file, "Time/diameter");
break;
}
}
switch (functionType_)
{
case ftMom:
{
for (label i = 0; i <= momentOrder_; i++)
{
file() << tab << i;
}
break;
}
default:
{
forAll(popBal_.sizeGroups(), sizeGroupi)
{
const diameterModels::sizeGroup& fi =
popBal_.sizeGroups()[sizeGroupi];
switch (abszissaType_)
{
case atDiameter:
{
file() << tab << fi.d().value();
break;
}
case atVolume:
{
file() << tab << fi.x().value();
break;
}
}
}
break;
}
}
file << endl;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::sizeDistribution::sizeDistribution
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fvMeshFunctionObject(name, runTime, dict),
writeFile(obr_, name),
dict_(dict),
selectionModeType_
(
selectionModeTypeNames_.get("selectionMode", dict)
),
selectionModeTypeName_(word::null),
functionType_(functionTypeNames_.get("functionType", dict)),
abszissaType_(abszissaTypeNames_.get("abszissaType", dict)),
nCells_(0),
cellId_(),
volume_(0.0),
writeVolume_(dict.lookupOrDefault("writeVolume", false)),
popBal_
(
obr_.lookupObject<Foam::diameterModels::populationBalanceModel>
(
dict.get<word>("populationBalance")
)
),
N_(popBal_.sizeGroups().size()),
momentOrder_(dict.lookupOrDefault<label>("momentOrder", 0)),
normalize_(dict.lookupOrDefault("normalize", false)),
sumN_(0.0),
sumV_(0.0)
{
read(dict);
resetFile(name);
createFile(name);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::sizeDistribution::~sizeDistribution()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::sizeDistribution::read(const dictionary& dict)
{
if (dict != dict_)
{
dict_ = dict;
}
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
initialise(dict);
return true;
}
bool Foam::functionObjects::sizeDistribution::execute()
{
return true;
}
bool Foam::functionObjects::sizeDistribution::write()
{
writeFileHeader();
writeTime(file());
Log << type() << " " << name() << " write" << nl;
scalarField V(filterField(mesh().V()));
combineFields(V);
sumN_ = 0;
sumV_ = 0;
forAll(N_, i)
{
const Foam::diameterModels::sizeGroup& fi = popBal_.sizeGroups()[i];
const volScalarField& alpha = fi.VelocityGroup().phase();
scalarField Ni(fi*alpha/fi.x());
scalarField values(filterField(Ni));
scalarField V(filterField(mesh().V()));
// Combine onto master
combineFields(values);
combineFields(V);
if (Pstream::master())
{
// Calculate volume-averaged number concentration
N_[i] = sum(V*values)/sum(V);
}
sumN_ += N_[i];
sumV_ += N_[i]*fi.x().value();
}
if (Pstream::master())
{
switch (functionType_)
{
case ftMom:
{
for (label m = 0; m <= momentOrder_; m++)
{
scalar result(0.0);
forAll(N_, i)
{
const Foam::diameterModels::sizeGroup& fi =
popBal_.sizeGroups()[i];
switch (abszissaType_)
{
case atVolume:
{
result += pow(fi.x().value(), m)*N_[i];
break;
}
case atDiameter:
{
result += pow(fi.d().value(), m)*N_[i];
break;
}
}
}
file() << tab << result;
}
break;
}
default:
{
forAll(popBal_.sizeGroups(), i)
{
const Foam::diameterModels::sizeGroup& fi =
popBal_.sizeGroups()[i];
scalar result(0.0);
scalar delta(0.0);
switch (abszissaType_)
{
case atVolume:
{
delta = popBal_.v()[i+1].value()
- popBal_.v()[i].value();
break;
}
case atDiameter:
{
const scalar& formFactor =
fi.VelocityGroup().formFactor().value();
delta =
pow
(
popBal_.v()[i+1].value()
/formFactor,
1.0/3.0
)
- pow
(
popBal_.v()[i].value()
/formFactor,
1.0/3.0
);
break;
}
}
switch (functionType_)
{
case ftNdf:
{
if (normalize_ == true)
{
result = N_[i]/delta/sumN_;
}
else
{
result = N_[i]/delta;
}
break;
}
case ftVdf:
{
if (normalize_ == true)
{
result = N_[i]*fi.x().value()/delta/sumV_;
}
else
{
result = N_[i]*fi.x().value()/delta;
}
break;
}
case ftNc:
{
if (normalize_ == true)
{
result = N_[i]/sumN_;
}
else
{
result = N_[i];
}
break;
}
default:
{
break;
}
}
file()<< tab << result;
}
}
}
}
{
file()<< endl;
}
Log << endl;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,277 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::sizeDistribution
Description
This function object calculates and outputs information about the size
distribution of the dispersed phase, such as the number density function or
its moments. It is designed to be used exclusively with the population
balance modeling functionality of the reactingEulerFoam solvers. It can be
applied to a specific cellZone or the entire domain.
Example of function object specification:
\verbatim
box.all.numberDensity.volume.bubbles
{
type sizeDistribution;
libs ("libreactingEulerFoamFunctionObjects.so");
writeControl outputTime;
writeInterval 1;
log true;
...
functionType numberDensity;
abszissaType volume;
selectionMode all;
populationBalanceModel bubbles;
normalize true;
}
\endverbatim
Usage
\table
Property | Description | Required | Default value
type | type name: sizeDistribution | yes |
functionType | numberDensity, volumeDensity, numberConcentration,
moments | yes |
abszissaType | volume, diameter | yes |
momentOrder | Write moment up to given order | no | 0
selectionMode | Evaluate for cellZone or entire mesh | yes |
cellZone | Required if selectionMode is cellZone | |
populationBalanceModel | Respective populationBalanceModel | yes |
normalize | Normalization | no |
\endtable
See also
Foam::diameterModels::populationBalanceModel
Foam::functionObject
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::writeFile
SourceFiles
sizeDistribution.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_sizeDistribution_H
#define functionObjects_sizeDistribution_H
#include "fvMeshFunctionObject.H"
#include "writeFile.H"
#include "populationBalanceModel.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class fvMesh;
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class sizeDistribution Declaration
\*---------------------------------------------------------------------------*/
class sizeDistribution
:
public fvMeshFunctionObject,
public writeFile
{
public:
// Public data types
//- Selection mode type enumeration
enum selectionModeTypes
{
rtCellZone,
rtAll
};
//- Selection mode type names
static const Enum<selectionModeTypes> selectionModeTypeNames_;
//- Function type enumeration
enum functionTypes
{
ftNdf,
ftVdf,
ftNc,
ftMom
};
//- Function type names
static const Enum<functionTypes> functionTypeNames_;
//- abszissa type enumeration
enum abszissaTypes
{
atDiameter,
atVolume,
};
//- Abszissa type names
static const Enum<abszissaTypes> abszissaTypeNames_;
protected:
// Protected data
//- Construction dictionary
dictionary dict_;
//- Selection mode type
selectionModeTypes selectionModeType_;
//- Name of selection
word selectionModeTypeName_;
//- Function type
functionTypes functionType_;
//- Abszissa type
abszissaTypes abszissaType_;
//- Global number of cells
label nCells_;
//- Local list of cell IDs
labelList cellId_;
//- Total volume of the evaluated selection
scalar volume_;
//- Optionally write the volume of the sizeDistribution
bool writeVolume_;
//- PopulationBalance
const Foam::diameterModels::populationBalanceModel& popBal_;
//- Number concentrations
List<scalar> N_;
//- Write moments up to specified order with respect to abszissaType
label momentOrder_;
//- Normalization switch
const Switch normalize_;
//- Sum of number concentrations
scalar sumN_;
//- Volumertic sum
scalar sumV_;
// Protected Member Functions
//- Initialise, e.g. cell addressing
void initialise(const dictionary& dict);
//- Set cells to evaluate based on a cell zone
void setCellZoneCells();
//- Calculate and return volume of the evaluated cell zone
scalar volume() const;
//- Combine fields from all processor domains into single field
void combineFields(scalarField& field);
//- Filter field according to cellIds
tmp<scalarField> filterField(const scalarField& field) const;
//- Output file header information
void writeFileHeader(const label i = 0);
public:
//- Runtime type information
TypeName("sizeDistribution");
// Constructors
//- Construct from Time and dictionary
sizeDistribution
(
const word& name,
const Time& runTime,
const dictionary& dict
);
//- Destructor
virtual ~sizeDistribution();
// Member Functions
//- Return the reference to the construction dictionary
const dictionary& dict() const
{
return dict_;
}
//- Return the local list of cell IDs
const labelList& cellId() const
{
return cellId_;
}
//- Helper function to return the reference to the mesh
const fvMesh& mesh() const
{
return refCast<const fvMesh>(obr_);
}
//- Read from dictionary
virtual bool read(const dictionary& dict);
//- Execute
virtual bool execute();
//- Write
virtual bool write();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,23 +0,0 @@
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
saturationModels/saturationModel/saturationModel.C
saturationModels/saturationModel/newSaturationModel.C
saturationModels/Antoine/Antoine.C
saturationModels/AntoineExtended/AntoineExtended.C
saturationModels/ArdenBuck/ArdenBuck.C
saturationModels/polynomial/polynomial.C
saturationModels/function1/function1.C
saturationModels/constantSaturationConditions/constantSaturationConditions.C
LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialCompositionModels

View File

@ -1,23 +0,0 @@
EXE_INC = \
-I../phaseSystems/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/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
LIB_LIBS = \
-lfiniteVolume \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie

View File

@ -1,128 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Henry.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::Henry
(
const dictionary& dict,
const phasePair& pair
)
:
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
k_(dict.lookup("k")),
YSolvent_
(
IOobject
(
IOobject::groupName("YSolvent", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
dimensionedScalar("one", dimless, 1)
)
{
if (k_.size() != this->speciesNames_.size())
{
FatalErrorInFunction
<< "Differing number of species and solubilities"
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
void Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::update
(
const volScalarField& Tf
)
{
YSolvent_ = scalar(1);
for (const word& speciesName : this->speciesNames_)
{
YSolvent_ -= Yf(speciesName, Tf);
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::Yf
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (this->speciesNames_.found(speciesName))
{
const label index = this->speciesNames_[speciesName];
return
k_[index]
*this->otherThermo_.composition().Y(speciesName)
*this->otherThermo_.rhoThermo::rho()
/this->thermo_.rhoThermo::rho();
}
else
{
return
YSolvent_
*this->thermo_.composition().Y(speciesName);
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("YfPrime", this->pair_.name()),
this->pair_.phase1().mesh().time().timeName(),
this->pair_.phase1().mesh()
),
this->pair_.phase1().mesh(),
dimensionedScalar(dimless/dimTemperature, Zero)
);
}
// ************************************************************************* //

View File

@ -1,129 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Henry
Description
Henry's law for gas solubiliy in liquid. The concentration of the dissolved
species in the liquid is proportional to its partial pressure in the gas.
The dimensionless constant of proportionality between concentrations on
each side of the interface is \f$k\f$, and is given for each species.
Mixing in the gas is assumed to be ideal.
SourceFiles
Henry.C
\*---------------------------------------------------------------------------*/
#ifndef Henry_H
#define Henry_H
#include "InterfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace interfaceCompositionModels
{
/*---------------------------------------------------------------------------*\
Class Henry Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
class Henry
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
//- Solubility coefficients
const scalarList k_;
//- The remaining solvent species fraction
volScalarField YSolvent_;
public:
//- Runtime type information
TypeName("Henry");
// Constructors
//- Construct from components
Henry
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Henry() = default;
// Member Functions
//- Update the composition
virtual void update(const volScalarField& Tf);
//- The interface species fraction
virtual tmp<volScalarField> Yf
(
const word& speciesName,
const volScalarField& Tf
) const;
//- The interface species fraction derivative w.r.t. temperature
virtual tmp<volScalarField> YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace interfaceCompositionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "Henry.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,242 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "InterfaceCompositionModel.H"
#include "phaseModel.H"
#include "phasePair.H"
#include "pureMixture.H"
#include "multiComponentMixture.H"
#include "rhoThermo.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
template<class ThermoType>
const typename Foam::multiComponentMixture<ThermoType>::thermoType&
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getLocalThermo
(
const word& speciesName,
const multiComponentMixture<ThermoType>& globalThermo
) const
{
return
globalThermo.getLocalThermo
(
globalThermo.species()
[
speciesName
]
);
}
template<class Thermo, class OtherThermo>
template<class ThermoType>
const typename Foam::pureMixture<ThermoType>::thermoType&
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getLocalThermo
(
const word& speciesName,
const pureMixture<ThermoType>& globalThermo
) const
{
return globalThermo.cellMixture(0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::InterfaceCompositionModel
(
const dictionary& dict,
const phasePair& pair
)
:
interfaceCompositionModel(dict, pair),
thermo_
(
pair.phase1().mesh().lookupObject<Thermo>
(
IOobject::groupName(basicThermo::dictName, pair.phase1().name())
)
),
otherThermo_
(
pair.phase2().mesh().lookupObject<OtherThermo>
(
IOobject::groupName(basicThermo::dictName, pair.phase2().name())
)
),
Le_("Le", dimless, dict)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::dY
(
const word& speciesName,
const volScalarField& Tf
) const
{
return
Yf(speciesName, Tf)
- thermo_.composition().Y()
[
thermo_.composition().species()[speciesName]
];
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
(
const word& speciesName
) const
{
const typename Thermo::thermoType& localThermo =
getLocalThermo
(
speciesName,
thermo_
);
const volScalarField& p(thermo_.p());
const volScalarField& T(thermo_.T());
tmp<volScalarField> tmpD
(
new volScalarField
(
IOobject
(
IOobject::groupName("D", pair_.name()),
p.time().timeName(),
p.mesh()
),
p.mesh(),
dimensionedScalar(dimArea/dimTime, Zero)
)
);
volScalarField& D = tmpD.ref();
forAll(p, celli)
{
D[celli] =
localThermo.alphah(p[celli], T[celli])
/localThermo.rho(p[celli], T[celli]);
}
D /= Le_;
return tmpD;
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
(
const word& speciesName,
const volScalarField& Tf
) const
{
const typename Thermo::thermoType& localThermo =
getLocalThermo
(
speciesName,
thermo_
);
const typename OtherThermo::thermoType& otherLocalThermo =
getLocalThermo
(
speciesName,
otherThermo_
);
const volScalarField& p(thermo_.p());
const volScalarField& otherP(otherThermo_.p());
tmp<volScalarField> tmpL
(
new volScalarField
(
IOobject
(
IOobject::groupName("L", pair_.name()),
p.time().timeName(),
p.mesh()
),
p.mesh(),
dimensionedScalar(dimEnergy/dimMass, Zero)
)
);
volScalarField& L = tmpL.ref();
forAll(p, celli)
{
L[celli] =
localThermo.Ha(p[celli], Tf[celli])
- otherLocalThermo.Ha(otherP[celli], Tf[celli]);
}
return tmpL;
}
template<class Thermo, class OtherThermo>
void Foam::InterfaceCompositionModel<Thermo, OtherThermo>::addMDotL
(
const volScalarField& K,
const volScalarField& Tf,
volScalarField& mDotL,
volScalarField& mDotLPrime
) const
{
for (const word& speciesName : this->speciesNames_)
{
volScalarField rhoKDL
(
thermo_.rhoThermo::rho()
*K
*D(speciesName)
*L(speciesName, Tf)
);
mDotL += rhoKDL*dY(speciesName, Tf);
mDotLPrime += rhoKDL*YfPrime(speciesName, Tf);
}
}
// ************************************************************************* //

View File

@ -1,218 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::InterfaceCompositionModel
Description
Base class for interface composition models, templated on the two
thermodynamic models either side of the interface.
SourceFiles
InterfaceCompositionModel.C
\*---------------------------------------------------------------------------*/
#ifndef InterfaceCompositionModel_H
#define InterfaceCompositionModel_H
#include "interfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phaseModel;
class phasePair;
template<class ThermoType> class pureMixture;
template<class ThermoType> class multiComponentMixture;
/*---------------------------------------------------------------------------*\
Class InterfaceCompositionModel Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
class InterfaceCompositionModel
:
public interfaceCompositionModel
{
protected:
// Protected Data
//- Thermo
const Thermo& thermo_;
//- Other Thermo
const OtherThermo& otherThermo_;
//- Lewis number
const dimensionedScalar Le_;
// Protected Member Functions
//- Get a reference to the local thermo for a pure mixture
template<class ThermoType>
const typename pureMixture<ThermoType>::thermoType&
getLocalThermo
(
const word& speciesName,
const pureMixture<ThermoType>& globalThermo
) const;
//- Get a reference to the local thermo for a multi component mixture
template<class ThermoType>
const typename multiComponentMixture<ThermoType>::thermoType&
getLocalThermo
(
const word& speciesName,
const multiComponentMixture<ThermoType>& globalThermo
) const;
public:
// Constructors
//- Construct from components
InterfaceCompositionModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
~InterfaceCompositionModel() = default;
// Member Functions
//- Mass fraction difference between the interface and the field
virtual tmp<volScalarField> dY
(
const word& speciesName,
const volScalarField& Tf
) const;
//- Mass diffusivity
virtual tmp<volScalarField> D
(
const word& speciesName
) const;
//- Latent heat
virtual tmp<volScalarField> L
(
const word& speciesName,
const volScalarField& Tf
) const;
//- Add latent heat flow rate to total
virtual void addMDotL
(
const volScalarField& K,
const volScalarField& Tf,
volScalarField& mDotL,
volScalarField& mDotLPrime
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Instantiation for multi-component-multi-component pairs
#define makeInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
\
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
Type##Thermo##Comp##Mix##Phys; \
\
typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
\
addInterfaceCompositionToRunTimeSelectionTable \
( \
Type, \
Type##Thermo##Comp##Mix##Phys, \
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
)
// Instantiation for multi-component-single-component pairs
#define makeSpecieInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
\
typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
Type##Thermo##Comp##Mix##Phys; \
\
typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
\
addInterfaceCompositionToRunTimeSelectionTable \
( \
Type, \
Type##Thermo##Comp##Mix##Phys, \
Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
)
// Addition to the run-time selection table
#define addInterfaceCompositionToRunTimeSelectionTable(Type, Thermo, OtherThermo)\
\
typedef Type<Thermo, OtherThermo> \
Type##Thermo##OtherThermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
Type##Thermo##OtherThermo, \
( \
word(Type##Thermo##OtherThermo::typeName_()) + "<" \
+ word(Thermo::typeName) + "," \
+ word(OtherThermo::typeName) + ">" \
).c_str(), \
0 \
); \
\
addToRunTimeSelectionTable \
( \
interfaceCompositionModel, \
Type##Thermo##OtherThermo, \
dictionary \
)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "InterfaceCompositionModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,120 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "interfaceCompositionModel.H"
#include "InterfaceCompositionModel.H"
#include "Henry.H"
#include "NonRandomTwoLiquid.H"
#include "Raoult.H"
#include "Saturated.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "makeReactionThermo.H"
#include "thermoPhysicsTypes.H"
#include "rhoConst.H"
#include "perfectFluid.H"
#include "pureMixture.H"
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "SpecieMixture.H"
#include "rhoThermo.H"
#include "rhoReactionThermo.H"
#include "heRhoThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
using namespace interfaceCompositionModels;
// multi-component gas in the presence of a pure liquid
makeInterfaceCompositionType
(
Saturated,
heRhoThermo,
rhoReactionThermo,
multiComponentMixture,
gasEThermoPhysics,
heRhoThermo,
rhoThermo,
pureMixture,
constFluidEThermoPhysics
);
// reacting gas in the presence of a pure liquid
makeInterfaceCompositionType
(
Saturated,
heRhoThermo,
rhoReactionThermo,
reactingMixture,
gasEThermoPhysics,
heRhoThermo,
rhoThermo,
pureMixture,
constFluidEThermoPhysics
);
// multi-component gas in the presence of a multi-component liquid
makeSpecieInterfaceCompositionType
(
Saturated,
heRhoThermo,
rhoReactionThermo,
multiComponentMixture,
constGasEThermoPhysics,
heRhoThermo,
rhoReactionThermo,
multiComponentMixture,
constFluidEThermoPhysics
);
// multi-component liquid in the presence of a multi-component gas
makeSpecieInterfaceCompositionType
(
Henry,
heRhoThermo,
rhoReactionThermo,
multiComponentMixture,
constFluidEThermoPhysics,
heRhoThermo,
rhoReactionThermo,
multiComponentMixture,
constGasEThermoPhysics
);
}
// ************************************************************************* //

View File

@ -1,248 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "NonRandomTwoLiquid.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::
NonRandomTwoLiquid
(
const dictionary& dict,
const phasePair& pair
)
:
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
gamma1_
(
IOobject
(
IOobject::groupName("gamma1", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
dimensionedScalar("one", dimless, 1)
),
gamma2_
(
IOobject
(
IOobject::groupName("gamma2", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
dimensionedScalar("one", dimless, 1)
),
alpha12_("alpha12", dimless, Zero),
alpha21_("alpha21", dimless, Zero),
beta12_("beta12", dimless/dimTemperature, Zero),
beta21_("beta21", dimless/dimTemperature, Zero)
{
if (this->speciesNames_.size() != 2)
{
FatalErrorInFunction
<< "NonRandomTwoLiquid model is suitable for two species only."
<< exit(FatalError);
}
species1Name_ = this->speciesNames_[0];
species2Name_ = this->speciesNames_[1];
species1Index_ = this->thermo_.composition().species()[species1Name_];
species2Index_ = this->thermo_.composition().species()[species2Name_];
alpha12_.read("alpha", dict.subDict(species1Name_));
alpha21_.read("alpha", dict.subDict(species2Name_));
beta12_.read("beta", dict.subDict(species1Name_));
beta21_.read("beta", dict.subDict(species2Name_));
saturationModel12_.reset
(
saturationModel::New
(
dict.subDict(species1Name_).subDict("interaction")
).ptr()
);
saturationModel21_.reset
(
saturationModel::New
(
dict.subDict(species2Name_).subDict("interaction")
).ptr()
);
speciesModel1_.reset
(
interfaceCompositionModel::New
(
dict.subDict(species1Name_),
pair
).ptr()
);
speciesModel2_.reset
(
interfaceCompositionModel::New
(
dict.subDict(species2Name_),
pair
).ptr()
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::
~NonRandomTwoLiquid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
void
Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::
update
(
const volScalarField& Tf
)
{
volScalarField W(this->thermo_.composition().W());
volScalarField X1
(
this->thermo_.composition().Y(species1Index_)
*W
/this->thermo_.composition().W(species1Index_)
);
volScalarField X2
(
this->thermo_.composition().Y(species2Index_)
*W
/this->thermo_.composition().W(species2Index_)
);
volScalarField alpha12(alpha12_ + Tf*beta12_);
volScalarField alpha21(alpha21_ + Tf*beta21_);
volScalarField tau12(saturationModel12_->lnPSat(Tf));
volScalarField tau21(saturationModel21_->lnPSat(Tf));
volScalarField G12(exp(- alpha12*tau12));
volScalarField G21(exp(- alpha21*tau21));
gamma1_ =
exp
(
sqr(X2)
*(
tau21*sqr(G21)/max(sqr(X1 + X2*G21), SMALL)
+ tau12*G12/max(sqr(X2 + X1*G12), SMALL)
)
);
gamma2_ =
exp
(
sqr(X1)
*(
tau12*sqr(G12)/max(sqr(X2 + X1*G12), SMALL)
+ tau21*G21/max(sqr(X1 + X2*G21), SMALL)
)
);
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::Yf
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (speciesName == species1Name_)
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModel1_->Yf(speciesName, Tf)
*gamma1_;
}
else if(speciesName == species2Name_)
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModel2_->Yf(speciesName, Tf)
*gamma2_;
}
else
{
return
this->thermo_.composition().Y(speciesName)
*(scalar(1) - Yf(species1Name_, Tf) - Yf(species2Name_, Tf));
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::
YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (speciesName == species1Name_)
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModel1_->YfPrime(speciesName, Tf)
*gamma1_;
}
else if(speciesName == species2Name_)
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModel2_->YfPrime(speciesName, Tf)
*gamma2_;
}
else
{
return
- this->thermo_.composition().Y(speciesName)
*(YfPrime(species1Name_, Tf) + YfPrime(species2Name_, Tf));
}
}
// ************************************************************************* //

View File

@ -1,167 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::NonRandomTwoLiquid
Description
Non ideal law for the mixing of two species. A separate composition model
is given for each species. The composition of a species is equal to the
value given by the model, scaled by the species fraction in the bulk of the
other phase, and multiplied by the activity coefficient for that species.
The gas behaviour is assumed ideal; i.e. the fugacity coefficient is taken
as equal to 1.
SourceFiles
NonRandomTwoLiquid.C
\*---------------------------------------------------------------------------*/
#ifndef NonRandomTwoLiquid_H
#define NonRandomTwoLiquid_H
#include "InterfaceCompositionModel.H"
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace interfaceCompositionModels
{
/*---------------------------------------------------------------------------*\
Class NonRandomTwoLiquid Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
class NonRandomTwoLiquid
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
//- Activity coefficient for species 1
volScalarField gamma1_;
//- Activity coefficient for species 2
volScalarField gamma2_;
//- Name of species 1
word species1Name_;
//- Name of species 2
word species2Name_;
//- Index of species 1 within this thermo
label species1Index_;
//- Index of species 2 within this thermo
label species2Index_;
//- Non-randomness constant parameter for species 1
dimensionedScalar alpha12_;
//- Non-randomness constant parameter for species 2
dimensionedScalar alpha21_;
//- Non-randomness linear parameter for species 1
dimensionedScalar beta12_;
//- Non-randomness linear parameter for species 2
dimensionedScalar beta21_;
//- Interaction parameter model for species 1
autoPtr<saturationModel> saturationModel12_;
//- Interaction parameter model for species 2
autoPtr<saturationModel> saturationModel21_;
//- Composition model for species 1
autoPtr<interfaceCompositionModel> speciesModel1_;
//- Composition model for species 2
autoPtr<interfaceCompositionModel> speciesModel2_;
public:
//- Runtime type information
TypeName("NonRandomTwoLiquid");
// Constructors
//- Construct from components
NonRandomTwoLiquid
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~NonRandomTwoLiquid();
// Member Functions
//- Update the composition
virtual void update(const volScalarField& Tf);
//- The interface species fraction
virtual tmp<volScalarField> Yf
(
const word& speciesName,
const volScalarField& Tf
) const;
//- The interface species fraction derivative w.r.t. temperature
virtual tmp<volScalarField> YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace interfaceCompositionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "NonRandomTwoLiquid.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,152 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Raoult.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::Raoult<Thermo, OtherThermo>::Raoult
(
const dictionary& dict,
const phasePair& pair
)
:
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
YNonVapour_
(
IOobject
(
IOobject::groupName("YNonVapour", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
dimensionedScalar("one", dimless, 1)
),
YNonVapourPrime_
(
IOobject
(
IOobject::groupName("YNonVapourPrime", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
dimensionedScalar(dimless/dimTemperature, Zero)
)
{
for (const word& speciesName : this->speciesNames_)
{
speciesModels_.insert
(
speciesName,
autoPtr<interfaceCompositionModel>
(
interfaceCompositionModel::New
(
dict.subDict(speciesName),
pair
)
)
);
}
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
void Foam::interfaceCompositionModels::Raoult<Thermo, OtherThermo>::update
(
const volScalarField& Tf
)
{
YNonVapour_ = scalar(1);
forAllIters(speciesModels_, iter)
{
iter()->update(Tf);
YNonVapour_ -=
this->otherThermo_.composition().Y(iter.key())
*iter()->Yf(iter.key(), Tf);
YNonVapourPrime_ -=
this->otherThermo_.composition().Y(iter.key())
*iter()->YfPrime(iter.key(), Tf);
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Raoult<Thermo, OtherThermo>::Yf
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (this->speciesNames_.found(speciesName))
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModels_[speciesName]->Yf(speciesName, Tf);
}
else
{
return
this->thermo_.composition().Y(speciesName)
*YNonVapour_;
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Raoult<Thermo, OtherThermo>::YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (this->speciesNames_.found(speciesName))
{
return
this->otherThermo_.composition().Y(speciesName)
*speciesModels_[speciesName]->YfPrime(speciesName, Tf);
}
else
{
return
this->otherThermo_.composition().Y(speciesName)
*YNonVapourPrime_;
}
}
// ************************************************************************* //

View File

@ -1,130 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Raoult
Description
Raoult's law of ideal mixing. A separate composition model is given for
each species. The composition of a species is equal to the value given by
the model scaled by the species fraction in the bulk of the other phase.
SourceFiles
Raoult.C
\*---------------------------------------------------------------------------*/
#ifndef Raoult_H
#define Raoult_H
#include "InterfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace interfaceCompositionModels
{
/*---------------------------------------------------------------------------*\
Class Raoult Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
class Raoult
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
//- Non-vapour species fraction
volScalarField YNonVapour_;
//- Non-vapour species fraction derivative w.r.t. temperature
volScalarField YNonVapourPrime_;
//- Species' individual composition models
HashTable<autoPtr<interfaceCompositionModel>> speciesModels_;
public:
//- Runtime type information
TypeName("Raoult");
// Constructors
//- Construct from components
Raoult
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Raoult() = default;
// Member Functions
//- Update the composition
virtual void update(const volScalarField& Tf);
//- The interface species fraction
virtual tmp<volScalarField> Yf
(
const word& speciesName,
const volScalarField& Tf
) const;
//- The interface species fraction derivative w.r.t. temperature
virtual tmp<volScalarField> YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace interfaceCompositionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "Raoult.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,152 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Saturated.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::
wRatioByP() const
{
const dimensionedScalar Wi
(
"W",
dimMass/dimMoles,
this->thermo_.composition().W(saturatedIndex_)
);
return Wi/this->thermo_.W()/this->thermo_.p();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::Saturated
(
const dictionary& dict,
const phasePair& pair
)
:
InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
saturatedName_(this->speciesNames_[0]),
saturatedIndex_
(
this->thermo_.composition().species()[saturatedName_]
),
saturationModel_
(
saturationModel::New
(
dict.subDict("saturationPressure")
)
)
{
if (this->speciesNames_.size() != 1)
{
FatalErrorInFunction
<< "Saturated model is suitable for one species only."
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::~Saturated()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
void
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::update
(
const volScalarField& Tf
)
{}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::Yf
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (saturatedName_ == speciesName)
{
return wRatioByP()*saturationModel_->pSat(Tf);
}
else
{
const label speciesIndex
(
this->thermo_.composition().species()[speciesName]
);
return
this->thermo_.Y()[speciesIndex]
*(scalar(1) - wRatioByP()*saturationModel_->pSat(Tf))
/max(scalar(1) - this->thermo_.Y()[saturatedIndex_], SMALL);
}
}
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const
{
if (saturatedName_ == speciesName)
{
return wRatioByP()*saturationModel_->pSatPrime(Tf);
}
else
{
const label speciesIndex
(
this->thermo_.composition().species()[speciesName]
);
return
- this->thermo_.Y()[speciesIndex]
*wRatioByP()*saturationModel_->pSatPrime(Tf)
/max(scalar(1) - this->thermo_.Y()[saturatedIndex_], SMALL);
}
}
// ************************************************************************* //

View File

@ -1,139 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Saturated
Description
Model which uses a saturation pressure model for a single species to
calculate the interface composition.
SourceFiles
Saturated.C
\*---------------------------------------------------------------------------*/
#ifndef Saturated_H
#define Saturated_H
#include "InterfaceCompositionModel.H"
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace interfaceCompositionModels
{
/*---------------------------------------------------------------------------*\
Class Saturated Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
class Saturated
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
protected:
// Private data
//- Saturated species name
word saturatedName_;
//- Saturated species index
label saturatedIndex_;
//- Saturation pressure model
autoPtr<saturationModel> saturationModel_;
// Private Member Functions
//- Constant of proportionality between partial pressure and mass
//- fraction
tmp<volScalarField> wRatioByP() const;
public:
//- Runtime type information
TypeName("Saturated");
// Constructors
//- Construct from components
Saturated
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Saturated();
// Member Functions
//- Update the composition
virtual void update(const volScalarField& Tf);
//- The interface species fraction
virtual tmp<volScalarField> Yf
(
const word& speciesName,
const volScalarField& Tf
) const;
//- The interface species fraction derivative w.r.t. temperature
virtual tmp<volScalarField> YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace interfaceCompositionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "Saturated.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,68 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interfaceCompositionModel.H"
#include "phaseModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(interfaceCompositionModel, 0);
defineRunTimeSelectionTable(interfaceCompositionModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::interfaceCompositionModel::interfaceCompositionModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair),
speciesNames_(dict.lookup("species"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::hashedWordList& Foam::interfaceCompositionModel::species() const
{
return speciesNames_;
}
bool Foam::interfaceCompositionModel::transports(word& speciesName) const
{
return this->speciesNames_.found(speciesName);
}
// ************************************************************************* //

View File

@ -1,184 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interfaceCompositionModel
Description
Generic base class for interface composition models. These models describe
the composition in phase 1 of the supplied pair at the interface with phase
2.
SourceFiles
interfaceCompositionModel.C
\*---------------------------------------------------------------------------*/
#ifndef interfaceCompositionModel_H
#define interfaceCompositionModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "hashedWordList.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phaseModel;
class phasePair;
/*---------------------------------------------------------------------------*\
Class interfaceCompositionModel Declaration
\*---------------------------------------------------------------------------*/
class interfaceCompositionModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
//- Names of the transferring species
const hashedWordList speciesNames_;
public:
//- Runtime type information
TypeName("interfaceCompositionModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
interfaceCompositionModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Constructors
//- Construct from a dictionary and a phase pair
interfaceCompositionModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~interfaceCompositionModel() = default;
// Selectors
static autoPtr<interfaceCompositionModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Update the composition
virtual void update(const volScalarField& Tf) = 0;
//- Return the transferring species names
const hashedWordList& species() const;
//- Returns whether the species is transported by the model and
//- provides the name of the diffused species
bool transports
(
word& speciesName
) const;
//- Interface mass fraction
virtual tmp<volScalarField> Yf
(
const word& speciesName,
const volScalarField& Tf
) const = 0;
//- The interface mass fraction derivative w.r.t. temperature
virtual tmp<volScalarField> YfPrime
(
const word& speciesName,
const volScalarField& Tf
) const = 0;
//- Mass fraction difference between the interface and the field
virtual tmp<volScalarField> dY
(
const word& speciesName,
const volScalarField& Tf
) const = 0;
//- Mass diffusivity
virtual tmp<volScalarField> D
(
const word& speciesName
) const = 0;
//- Latent heat
virtual tmp<volScalarField> L
(
const word& speciesName,
const volScalarField& Tf
) const = 0;
//- Add latent heat flow rate to total
virtual void addMDotL
(
const volScalarField& K,
const volScalarField& Tf,
volScalarField& mDotL,
volScalarField& mDotLPrime
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,70 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interfaceCompositionModel.H"
#include "phasePair.H"
#include "rhoThermo.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::interfaceCompositionModel>
Foam::interfaceCompositionModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
const word modelType
(
dict.get<word>("type")
+ "<"
+ pair.phase1().thermo().type()
+ ","
+ pair.phase2().thermo().type()
+ ">"
);
Info<< "Selecting interfaceCompositionModel for "
<< pair << ": " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown interfaceCompositionModel type "
<< modelType << nl << nl
<< "Valid interfaceCompositionModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -1,74 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Frossling.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace massTransferModels
{
defineTypeNameAndDebug(Frossling, 0);
addToRunTimeSelectionTable(massTransferModel, Frossling, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::massTransferModels::Frossling::Frossling
(
const dictionary& dict,
const phasePair& pair
)
:
massTransferModel(dict, pair),
Le_("Le", dimless, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::massTransferModels::Frossling::~Frossling()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::massTransferModels::Frossling::K() const
{
volScalarField Sh(scalar(2) + 0.552*sqrt(pair_.Re())*cbrt(Le_*pair_.Pr()));
return 6.0*pair_.dispersed()*Sh/sqr(pair_.dispersed().d());
}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::massTransferModels::Frossling
Description
Frossling correlation for turbulent mass transfer from the surface of a
sphere to the surrounding fluid.
SourceFiles
Frossling.C
\*---------------------------------------------------------------------------*/
#ifndef Frossling_H
#define Frossling_H
#include "massTransferModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace massTransferModels
{
/*---------------------------------------------------------------------------*\
Class Frossling Declaration
\*---------------------------------------------------------------------------*/
class Frossling
:
public massTransferModel
{
// Private data
//- Lewis number
const dimensionedScalar Le_;
public:
//- Runtime type information
TypeName("Frossling");
// Constructors
//- Construct from components
Frossling
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Frossling();
// Member Functions
//- The implicit mass transfer coefficient
virtual tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace massTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,60 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "massTransferModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(massTransferModel, 0);
defineRunTimeSelectionTable(massTransferModel, dictionary);
}
const Foam::dimensionSet Foam::massTransferModel::dimK(0, -2, 0, 0, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::massTransferModel::massTransferModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::massTransferModel::~massTransferModel()
{}
// ************************************************************************* //

View File

@ -1,130 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::massTransferModel
Description
SourceFiles
massTransferModel.C
\*---------------------------------------------------------------------------*/
#ifndef massTransferModel_H
#define massTransferModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class massTransferModel Declaration
\*---------------------------------------------------------------------------*/
class massTransferModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("massTransferModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
massTransferModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Static data members
//- Coefficient dimensions
static const dimensionSet dimK;
// Constructors
//- Construct from a dictionary and a phase pair
massTransferModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~massTransferModel();
// Selectors
static autoPtr<massTransferModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- The implicit mass transfer coefficient
// Note: this has had the species mass diffusivity factored out
virtual tmp<volScalarField> K() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,60 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "massTransferModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::massTransferModel> Foam::massTransferModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
const word modelType(dict.get<word>("type"));
Info<< "Selecting massTransferModel for "
<< pair << ": " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown massTransferModel type "
<< modelType << nl << nl
<< "Valid massTransferModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -1,77 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "sphericalMassTransfer.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace massTransferModels
{
defineTypeNameAndDebug(sphericalMassTransfer, 0);
addToRunTimeSelectionTable
(
massTransferModel,
sphericalMassTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::massTransferModels::sphericalMassTransfer::sphericalMassTransfer
(
const dictionary& dict,
const phasePair& pair
)
:
massTransferModel(dict, pair),
Le_("Le", dimless, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::massTransferModels::sphericalMassTransfer::~sphericalMassTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::massTransferModels::sphericalMassTransfer::K() const
{
return 60.0*pair_.dispersed()/sqr(pair_.dispersed().d());
}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::massTransferModels::sphericalMassTransfer
Description
Model which applies an analytical solution for mass transfer from the
surface of a sphere to the fluid within the sphere.
SourceFiles
sphericalMassTransfer.C
\*---------------------------------------------------------------------------*/
#ifndef sphericalMassTransfer_H
#define sphericalMassTransfer_H
#include "massTransferModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phasePair;
namespace massTransferModels
{
/*---------------------------------------------------------------------------*\
Class sphericalMassTransfer Declaration
\*---------------------------------------------------------------------------*/
class sphericalMassTransfer
:
public massTransferModel
{
// Private data
//- Lewis number
const dimensionedScalar Le_;
public:
//- Runtime type information
TypeName("spherical");
// Constructors
//- Construct from components
sphericalMassTransfer
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~sphericalMassTransfer();
// Member Functions
//- The implicit mass transfer coefficient
virtual tmp<volScalarField> K() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace massTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,106 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Antoine.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(Antoine, 0);
addToRunTimeSelectionTable(saturationModel, Antoine, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::Antoine::Antoine(const dictionary& dict)
:
saturationModel(),
A_("A", dimless, dict),
B_("B", dimTemperature, dict),
C_("C", dimTemperature, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::Antoine::~Antoine()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::pSat
(
const volScalarField& T
) const
{
return
dimensionedScalar("one", dimPressure, 1)
*exp(A_ + B_/(C_ + T));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::pSatPrime
(
const volScalarField& T
) const
{
return - pSat(T)*B_/sqr(C_ + T);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::lnPSat
(
const volScalarField& T
) const
{
return A_ + B_/(C_ + T);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::Tsat
(
const volScalarField& p
) const
{
return
B_/(log(p*dimensionedScalar("one", dimless/dimPressure, 1)) - A_)
- C_;
}
// ************************************************************************* //

View File

@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::Antoine
Description
Antoine equation for the vapour pressure.
\f[
\log p = A + \frac{B}{C + T}
\f]
Coefficients \f$A\f$, \f$B\f$ and \f$C\f$ are to be supplied and should be
suitable for natural logarithms and temperatures in Kelvin.
SourceFiles
Antoine.C
\*---------------------------------------------------------------------------*/
#ifndef Antoine_H
#define Antoine_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class Antoine Declaration
\*---------------------------------------------------------------------------*/
class Antoine
:
public saturationModel
{
protected:
// Protected data
//- Constant A
dimensionedScalar A_;
//- Constant B
dimensionedScalar B_;
//- Constant C
dimensionedScalar C_;
public:
//- Runtime type information
TypeName("Antoine");
// Constructors
//- Construct from a dictionary
Antoine(const dictionary& dict);
//- Destructor
virtual ~Antoine();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,119 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "AntoineExtended.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(AntoineExtended, 0);
addToRunTimeSelectionTable
(
saturationModel,
AntoineExtended,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::AntoineExtended::AntoineExtended
(
const dictionary& dict
)
:
Antoine(dict),
D_("D", dimless, dict),
F_("F", dimless, dict),
E_("E", dimless/pow(dimTemperature, F_), dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::AntoineExtended::~AntoineExtended()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::pSat
(
const volScalarField& T
) const
{
return
dimensionedScalar("one", dimPressure/pow(dimTemperature, D_), 1)
*exp(A_ + B_/(C_ + T) + E_*pow(T, F_))
*pow(T, D_);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::pSatPrime
(
const volScalarField& T
) const
{
return pSat(T)*((D_ + E_*F_*pow(T, F_))/T - B_/sqr(C_ + T));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::lnPSat
(
const volScalarField& T
) const
{
return
A_
+ B_/(C_ + T)
+ D_*log(T*dimensionedScalar("one", dimless/dimTemperature, 1))
+ E_*pow(T, F_);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::Tsat
(
const volScalarField& p
) const
{
NotImplemented;
return volScalarField::null();
}
// ************************************************************************* //

View File

@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::AntoineExtended
Description
Extended Antoine equation for the vapour pressure.
\f[
\log (p) = A + \frac{B}{C + T} + D \log (T) + E T^F
\f]
Coefficients \f$A\f$, \f$B\f$, \f$C\f$, \f$D\f$, \f$E\f$ and \f$F\f$ are
to be supplied and should be suitable for natural logarithms and
temperatures in Kelvin.
SourceFiles
AntoineExtended.C
\*---------------------------------------------------------------------------*/
#ifndef AntoineExtended_H
#define AntoineExtended_H
#include "Antoine.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class AntoineExtended Declaration
\*---------------------------------------------------------------------------*/
class AntoineExtended
:
public Antoine
{
// Private data
//- Constant D
dimensionedScalar D_;
//- Constant F
dimensionedScalar F_;
//- Constant E
// (after F so F's dimensions can be used in the construction)
dimensionedScalar E_;
public:
//- Runtime type information
TypeName("AntoineExtended");
// Constructors
//- Construct from a dictionary
AntoineExtended(const dictionary& dict);
//- Destructor
virtual ~AntoineExtended();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,126 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "ArdenBuck.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(ArdenBuck, 0);
addToRunTimeSelectionTable(saturationModel, ArdenBuck, dictionary);
}
}
static const Foam::dimensionedScalar zeroC("", Foam::dimTemperature, 273.15);
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21);
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678);
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5);
static const Foam::dimensionedScalar D("", Foam::dimTemperature, 257.14);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::xByTC
(
const volScalarField& TC
) const
{
return (B - TC/C)/(D + TC);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::ArdenBuck::ArdenBuck(const dictionary& dict)
:
saturationModel()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::ArdenBuck::~ArdenBuck()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::pSat
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
return A*exp(TC*xByTC(TC));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::pSatPrime
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
volScalarField x(xByTC(TC));
return A*exp(TC*x)*(D*x - TC/C)/(D + TC);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::lnPSat
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
return log(A.value()) + TC*xByTC(TC);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::Tsat
(
const volScalarField& p
) const
{
NotImplemented;
return volScalarField::null();
}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::ArdenBuck
Description
ArdenBuck equation for the vapour pressure of moist air.
SourceFiles
ArdenBuck.C
\*---------------------------------------------------------------------------*/
#ifndef ArdenBuck_H
#define ArdenBuck_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class ArdenBuck Declaration
\*---------------------------------------------------------------------------*/
class ArdenBuck
:
public saturationModel
{
// Private Member Functions
//- Exponent divided by the temperature
tmp<volScalarField> xByTC(const volScalarField& TC) const;
public:
//- Runtime type information
TypeName("ArdenBuck");
// Constructors
//- Construct from a dictionary
ArdenBuck(const dictionary& dict);
//- Destructor
virtual ~ArdenBuck();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,160 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constantSaturationConditions.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(constantSaturationConditions, 0);
addToRunTimeSelectionTable
(
saturationModel,
constantSaturationConditions,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::constantSaturationConditions::
constantSaturationConditions(const dictionary& dict)
:
saturationModel(),
pSat_("pSat", dimPressure, dict),
Tsat_("Tsat", dimTemperature, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::constantSaturationConditions::
~constantSaturationConditions()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::pSat
(
const volScalarField& T
) const
{
return tmp<volScalarField>::New
(
IOobject
(
"pSat",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
pSat_
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::pSatPrime
(
const volScalarField& T
) const
{
return tmp<volScalarField>::New
(
IOobject
(
"pSatPrime",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
dimensionedScalar(dimPressure/dimTemperature, Zero)
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::lnPSat
(
const volScalarField& T
) const
{
return tmp<volScalarField>::New
(
IOobject
(
"lnPSat",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
dimensionedScalar("lnPSat", dimless, log(pSat_.value()))
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::Tsat
(
const volScalarField& p
) const
{
return tmp<volScalarField>::New
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
p.mesh(),
Tsat_
);
}
// ************************************************************************* //

View File

@ -1,108 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::constantSaturationConditions
Description
Constant saturation pressure and temperature.
SourceFiles
constantSaturationConditions.C
\*---------------------------------------------------------------------------*/
#ifndef constantSaturationConditions_H
#define constantSaturationConditions_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class constantSaturationConditions Declaration
\*---------------------------------------------------------------------------*/
class constantSaturationConditions
:
public saturationModel
{
protected:
// Private data
//- Constant saturation pressure
dimensionedScalar pSat_;
//- Constant saturation temperature
dimensionedScalar Tsat_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from a dictionary
constantSaturationConditions(const dictionary& dict);
//- Destructor
virtual ~constantSaturationConditions();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,144 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "function1.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(function1, 0);
addToRunTimeSelectionTable(saturationModel, function1, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::function1::function1(const dictionary& dict)
:
saturationModel(),
function_
(
Function1<scalar>::New("function", dict)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::function1::~function1()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::pSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::pSatPrime
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::lnPSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::Tsat
(
const volScalarField& p
) const
{
tmp<volScalarField> tTsat
(
new volScalarField
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimTemperature, Zero)
)
);
volScalarField& Tsat = tTsat.ref();
forAll(Tsat, celli)
{
Tsat[celli] = function_->value(p[celli]);
}
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
forAll(Tsat.boundaryField(), patchi)
{
scalarField& Tsatp = TsatBf[patchi];
const scalarField& pp = p.boundaryField()[patchi];
forAll(Tsatp, facei)
{
Tsatp[facei] = function_->value(pp[facei]);
}
}
return tTsat;
}
// ************************************************************************* //

View File

@ -1,144 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::function1
Description
Saturation vapour temperature in terms of
the vapour pressure (in Pa). The saturation temperature in Kelvins is
specified as a Foam::Function1 type, to enable use of, e.g. constant,
polynomial, table values.
Currently this class only provides \f$T_sat\f$, the inverse function to
return the vapour pressure for a given temperature are not implemented.
Examples:
\verbatim
type function1;
function polynomial
(
(308.0422 0)
(0.0015096 1)
(-1.61589e-8 2)
(1.114106e-13 3)
(-4.52216e-19 4)
(1.05192e-24 5)
(-1.2953e-30 6)
(6.5365e-37 7)
)
\endverbatim
\verbatim
type function1;
function csvFile;
functionCoeffs
{
nHeaderLine 1;
refColumn 0;
componentColumns (1);
separator ",";
mergeSeparators no;
file "filename.csv";
outOfBounds clamp;
interpolationScheme linear;
};
\endverbatim
SourceFiles
function1.C
\*---------------------------------------------------------------------------*/
#ifndef saturationModels_function1_H
#define saturationModels_function1_H
#include "saturationModel.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class function1 Declaration
\*---------------------------------------------------------------------------*/
class function1
:
public saturationModel
{
// Private data
//- Saturation temperature as a function of pressure
autoPtr<Function1<scalar>> function_;
public:
//- Runtime type information
TypeName("function1");
// Constructors
//- Construct from a dictionary
function1(const dictionary& dict);
//- Destructor
virtual ~function1();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,140 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "polynomial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(polynomial, 0);
addToRunTimeSelectionTable(saturationModel, polynomial, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::polynomial::polynomial(const dictionary& dict)
:
saturationModel(),
C_(dict.lookup("C<8>"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::polynomial::~polynomial()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::pSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::pSatPrime
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::lnPSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::Tsat
(
const volScalarField& p
) const
{
tmp<volScalarField> tTsat
(
new volScalarField
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimTemperature, Zero)
)
);
volScalarField& Tsat = tTsat.ref();
forAll(Tsat,celli)
{
Tsat[celli] = C_.value(p[celli]);
}
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
forAll(Tsat.boundaryField(), patchi)
{
scalarField& Tsatp = TsatBf[patchi];
const scalarField& pp = p.boundaryField()[patchi];
forAll(Tsatp, facei)
{
Tsatp[facei] = C_.value(pp[facei]);
}
}
return tTsat;
}
// ************************************************************************* //

View File

@ -1,114 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModels::polynomial
Description
Polynomial equation for the saturation vapour temperature in terms of
the vapour pressure (in Pa).
\f[
T_sat = \sum_i C_i p^i
\f]
where \f$p\f$ is the pressure in Pa and \f$C\f$ are the coefficients.
Currently this class only provides \f$T_sat\f$, the inverse function to
return the vapour pressure for a given temperature are not implemented.
SourceFiles
polynomial.C
\*---------------------------------------------------------------------------*/
#ifndef polynomial_H
#define polynomial_H
#include "saturationModel.H"
#include "Polynomial.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class polynomial Declaration
\*---------------------------------------------------------------------------*/
class polynomial
:
public saturationModel
{
// Private data
//- Polynomial coefficients
Polynomial<8> C_;
public:
//- Runtime type information
TypeName("polynomial");
// Constructors
//- Construct from a dictionary
polynomial(const dictionary& dict);
//- Destructor
virtual ~polynomial();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,57 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New
(
const dictionary& dict
)
{
const word modelType(dict.get<word>("type"));
Info<< "Selecting saturationModel: " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown saturationModel type "
<< modelType << nl << nl
<< "Valid saturationModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict);
}
// ************************************************************************* //

View File

@ -1,51 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "saturationModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(saturationModel, 0);
defineRunTimeSelectionTable(saturationModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModel::saturationModel()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModel::~saturationModel()
{}
// ************************************************************************* //

View File

@ -1,135 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModel
Description
SourceFiles
saturationModel.C
newSaturationModel.C
\*---------------------------------------------------------------------------*/
#ifndef saturationModel_H
#define saturationModel_H
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class saturationModel Declaration
\*---------------------------------------------------------------------------*/
class saturationModel
{
// Private Member Functions
//- No copy construct
saturationModel(const saturationModel&) = delete;
//- No copy assignment
void operator=(const saturationModel&) = delete;
public:
//- Runtime type information
TypeName("saturationModel");
//- Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
saturationModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct null
saturationModel();
// Selectors
//- Select null constructed
static autoPtr<saturationModel> New(const dictionary& dict);
//- Destructor
virtual ~saturationModel();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat
(
const volScalarField& T
) const = 0;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime
(
const volScalarField& T
) const = 0;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat
(
const volScalarField& T
) const = 0;
//- Saturation temperature
virtual tmp<volScalarField> Tsat
(
const volScalarField& p
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,98 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constantSurfaceTensionCoefficient.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceTensionModels
{
defineTypeNameAndDebug(constantSurfaceTensionCoefficient, 0);
addToRunTimeSelectionTable
(
surfaceTensionModel,
constantSurfaceTensionCoefficient,
multiphase
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::
constantSurfaceTensionCoefficient
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
)
:
surfaceTensionModel(dict, pair, registerObject),
sigma_("sigma", dimSigma, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::
~constantSurfaceTensionCoefficient()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"sigma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
sigma_
)
);
}
// ************************************************************************* //

View File

@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient
Description
Constant value surface tension model.
SourceFiles
constantSurfaceTensionCoefficient.C
\*---------------------------------------------------------------------------*/
#ifndef constantSurfaceTensionCoefficient_H
#define constantSurfaceTensionCoefficient_H
#include "surfaceTensionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceTensionModels
{
/*---------------------------------------------------------------------------*\
Class constantSurfaceTensionCoefficient Declaration
\*---------------------------------------------------------------------------*/
class constantSurfaceTensionCoefficient
:
public surfaceTensionModel
{
// Private data
//- Constant surface tension value
const dimensionedScalar sigma_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from a dictionary and a phase pair
constantSurfaceTensionCoefficient
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
);
//- Destructor
virtual ~constantSurfaceTensionCoefficient();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> sigma() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceTensionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,61 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "surfaceTensionModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceTensionModel >
Foam::surfaceTensionModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
const word modelType(dict.get<word>("type"));
Info<< "Selecting surfaceTensionModel for "
<< pair << ": " << modelType << endl;
auto cstrIter = multiphaseConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown surfaceTensionModel type "
<< modelType << nl << nl
<< "Valid surfaceTensionModel types :" << endl
<< multiphaseConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair, true);
}
// ************************************************************************* //

View File

@ -1,81 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "surfaceTensionModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(surfaceTensionModel, 0);
defineRunTimeSelectionTable(surfaceTensionModel, multiphase);
}
const Foam::dimensionSet Foam::surfaceTensionModel::dimSigma(1, 0, -2, 0, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceTensionModel::surfaceTensionModel
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
)
:
regIOobject
(
IOobject
(
IOobject::groupName(typeName, pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
registerObject
)
),
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceTensionModel::~surfaceTensionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::surfaceTensionModel::writeData(Ostream& os) const
{
return os.good();
}
// ************************************************************************* //

View File

@ -1,136 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::surfaceTensionModel
Description
SourceFiles
surfaceTensionModel.C
newAspectRatioModel.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceTensionModel_H
#define surfaceTensionModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class surfaceTensionModel Declaration
\*---------------------------------------------------------------------------*/
class surfaceTensionModel
:
public regIOobject
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("surfaceTensionModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
surfaceTensionModel,
multiphase,
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
),
(dict, pair, registerObject)
);
// Static data members
//- Coefficient dimensions
static const dimensionSet dimSigma;
// Constructors
//- Construct from a dictionary and a phase pair
surfaceTensionModel
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
);
//- Destructor
virtual ~surfaceTensionModel();
// Selectors
static autoPtr<surfaceTensionModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> sigma() const = 0;
//- Dummy write for regIOobject
bool writeData(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,76 +0,0 @@
dragModels/dragModel/dragModel.C
dragModels/dragModel/newDragModel.C
dragModels/Beetstra/Beetstra.C
dragModels/segregated/segregated.C
dragModels/Ergun/Ergun.C
dragModels/Gibilaro/Gibilaro.C
dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
dragModels/Lain/Lain.C
dragModels/SchillerNaumann/SchillerNaumann.C
dragModels/SyamlalOBrien/SyamlalOBrien.C
dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C
dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C
dragModels/Tenneti/Tenneti.C
dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C
dragModels/WenYu/WenYu.C
dragModels/IshiiZuber/IshiiZuber.C
swarmCorrections/swarmCorrection/swarmCorrection.C
swarmCorrections/swarmCorrection/newSwarmCorrection.C
swarmCorrections/noSwarm/noSwarm.C
swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C
liftModels/liftModel/liftModel.C
liftModels/liftModel/newLiftModel.C
liftModels/noLift/noLift.C
liftModels/constantLiftCoefficient/constantLiftCoefficient.C
liftModels/Moraga/Moraga.C
liftModels/LegendreMagnaudet/LegendreMagnaudet.C
liftModels/TomiyamaLift/TomiyamaLift.C
liftModels/wallDampedLift/wallDampedLift.C
heatTransferModels/heatTransferModel/heatTransferModel.C
heatTransferModels/heatTransferModel/newHeatTransferModel.C
heatTransferModels/RanzMarshall/RanzMarshall.C
heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C
virtualMassModels/virtualMassModel/virtualMassModel.C
virtualMassModels/virtualMassModel/newVirtualMassModel.C
virtualMassModels/noVirtualMass/noVirtualMass.C
virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C
virtualMassModels/Lamb/Lamb.C
wallLubricationModels/wallLubricationModel/wallLubricationModel.C
wallLubricationModels/wallLubricationModel/newWallLubricationModel.C
wallLubricationModels/noWallLubrication/noWallLubrication.C
wallLubricationModels/Antal/Antal.C
wallLubricationModels/Frank/Frank.C
wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C
turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C
turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C
turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C
turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C
turbulentDispersionModels/Burns/Burns.C
turbulentDispersionModels/Gosman/Gosman.C
turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C
aspectRatioModels/aspectRatioModel/aspectRatioModel.C
aspectRatioModels/aspectRatioModel/newAspectRatioModel.C
aspectRatioModels/constantAspectRatio/constantAspectRatio.C
aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C
aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C
aspectRatioModels/Wellek/Wellek.C
wallDependentModel/wallDependentModel.C
wallDampingModels/wallDampingModel/wallDampingModel.C
wallDampingModels/wallDampingModel/newWallDampingModel.C
wallDampingModels/noWallDamping/noWallDamping.C
wallDampingModels/interpolated/interpolatedWallDamping.C
wallDampingModels/linear/linearWallDamping.C
wallDampingModels/cosine/cosineWallDamping.C
wallDampingModels/sine/sineWallDamping.C
LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialModels

View File

@ -1,17 +0,0 @@
EXE_INC = \
-I../phaseSystems/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/transportModel \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lfluidThermophysicalModels \
-lcompressibleTransportModels \
-lspecie \
-lreactingPhaseSystem

View File

@ -1,83 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "TomiyamaAspectRatio.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(TomiyamaAspectRatio, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
TomiyamaAspectRatio,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::TomiyamaAspectRatio::TomiyamaAspectRatio
(
const dictionary& dict,
const phasePair& pair
)
:
VakhrushevEfremov(dict, pair),
wallDependentModel(pair.phase1().mesh())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::TomiyamaAspectRatio::~TomiyamaAspectRatio()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::TomiyamaAspectRatio::E() const
{
return
VakhrushevEfremov::E()
*max
(
scalar(1) - 0.35*yWall()/pair_.dispersed().d(),
scalar(0.65)
);
}
// ************************************************************************* //

View File

@ -1,103 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::aspectRatioModels::TomiyamaAspectRatio
Description
Aspect ratio model of Tomiyama.
Reference:
\verbatim
"Implementation and Comparison of Correlations for interfacial Forces
in a Gas-Liquid System within an Euler-Euler Framework"
Otromke, M.,
PhD Thesis, April 2013
\endverbatim
SourceFiles
TomiyamaAspectRatio.C
\*---------------------------------------------------------------------------*/
#ifndef TomiyamaAspectRatio_H
#define TomiyamaAspectRatio_H
#include "VakhrushevEfremov.H"
#include "wallDependentModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class TomiyamaAspectRatio Declaration
\*---------------------------------------------------------------------------*/
class TomiyamaAspectRatio
:
public VakhrushevEfremov,
public wallDependentModel
{
public:
//- Runtime type information
TypeName("Tomiyama");
// Constructors
//- Construct from a dictionary and an ordered phase pair
TomiyamaAspectRatio
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~TomiyamaAspectRatio();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,82 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "VakhrushevEfremov.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(VakhrushevEfremov, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
VakhrushevEfremov,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov
(
const dictionary& dict,
const phasePair& pair
)
:
aspectRatioModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::VakhrushevEfremov::~VakhrushevEfremov()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::VakhrushevEfremov::E() const
{
volScalarField Ta(pair_.Ta());
return
neg(Ta - scalar(1))*scalar(1)
+ pos0(Ta - scalar(1))*neg(Ta - scalar(39.8))
*pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1)))))
+ pos0(Ta - scalar(39.8))*0.24;
}
// ************************************************************************* //

View File

@ -1,102 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::VakhrushevEfremov
Description
Aspect ratio model of Vakhrushev and Efremov.
Reference:
\verbatim
"Interpolation formula for computing the velocities of single gas
bubbles in liquids"
Vakhrushev, I.A. and Efremov, G.I.,
Chemistry and Technology of Fuels and Oils
Volume 6, Issue 5, May 1970, pp. 376-379,
\endverbatim
SourceFiles
VakhrushevEfremov.C
\*---------------------------------------------------------------------------*/
#ifndef VakhrushevEfremov_H
#define VakhrushevEfremov_H
#include "aspectRatioModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class VakhrushevEfremov Declaration
\*---------------------------------------------------------------------------*/
class VakhrushevEfremov
:
public aspectRatioModel
{
public:
//- Runtime type information
TypeName("VakhrushevEfremov");
// Constructors
//- Construct from a dictionary and an ordered phase pair
VakhrushevEfremov
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~VakhrushevEfremov();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,76 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Wellek.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(Wellek, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
Wellek,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::Wellek::Wellek
(
const dictionary& dict,
const phasePair& pair
)
:
aspectRatioModel(dict, pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::Wellek::~Wellek()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::Wellek::E() const
{
return scalar(1)/(scalar(1) + 0.163*pow(pair_.Eo(), 0.757));
}
// ************************************************************************* //

View File

@ -1,108 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::aspectRatioModels::Wellek
Description
Aspect ratio model of Wellek et al.
References:
\verbatim
"Implementation and Comparison of Correlations for interfacial Forces
in a Gas-Liquid System within an Euler-Euler Framework"
Otromke, M.,
PhD Thesis, April 2013
\endverbatim
\verbatim
"Shape of liquid drops moving in liquid media"
Wellek, R.M., Agrawal, A.K., Skelland, A.H.P.,
International Journal of Multiphase Flow
Volume 12, Issue 5, September 1966, pp. 854-862
\endverbatim
SourceFiles
Wellek.C
\*---------------------------------------------------------------------------*/
#ifndef Wellek_H
#define Wellek_H
#include "aspectRatioModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class Wellek Declaration
\*---------------------------------------------------------------------------*/
class Wellek
:
public aspectRatioModel
{
public:
//- Runtime type information
TypeName("Wellek");
// Constructors
//- Construct from a dictionary and an ordered phase pair
Wellek
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~Wellek();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,58 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(aspectRatioModel, 0);
defineRunTimeSelectionTable(aspectRatioModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModel::aspectRatioModel
(
const dictionary& dict,
const phasePair& pair
)
:
pair_(pair)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModel::~aspectRatioModel()
{}
// ************************************************************************* //

View File

@ -1,123 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::aspectRatioModel
Description
SourceFiles
aspectRatioModel.C
newAspectRatioModel.C
\*---------------------------------------------------------------------------*/
#ifndef aspectRatioModel_H
#define aspectRatioModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
class phasePair;
/*---------------------------------------------------------------------------*\
Class aspectRatioModel Declaration
\*---------------------------------------------------------------------------*/
class aspectRatioModel
{
protected:
// Protected data
//- Phase pair
const phasePair& pair_;
public:
//- Runtime type information
TypeName("aspectRatioModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
aspectRatioModel,
dictionary,
(
const dictionary& dict,
const phasePair& pair
),
(dict, pair)
);
// Constructors
//- Construct from a dictionary and an ordered phase pair
aspectRatioModel
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~aspectRatioModel();
// Selectors
static autoPtr<aspectRatioModel> New
(
const dictionary& dict,
const phasePair& pair
);
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,61 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::aspectRatioModel>
Foam::aspectRatioModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
const word modelType(dict.get<word>("type"));
Info<< "Selecting aspectRatioModel for "
<< pair << ": " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown aspectRatioModel type "
<< modelType << nl << nl
<< "Valid aspectRatioModel types :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict, pair);
}
// ************************************************************************* //

View File

@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constantAspectRatio.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(constantAspectRatio, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
constantAspectRatio,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio
(
const dictionary& dict,
const phasePair& pair
)
:
aspectRatioModel(dict, pair),
E0_("E0", dimless, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::aspectRatioModels::constantAspectRatio::E() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
aspectRatioModel::typeName + ":E",
mesh.time().timeName(),
mesh
),
mesh,
E0_
)
);
}
// ************************************************************************* //

View File

@ -1,99 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::aspectRatioModels::constantAspectRatio
Description
Constant value aspect ratio model.
SourceFiles
constantAspectRatio.C
\*---------------------------------------------------------------------------*/
#ifndef constantAspectRatio_H
#define constantAspectRatio_H
#include "aspectRatioModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace aspectRatioModels
{
/*---------------------------------------------------------------------------*\
Class constantAspectRatio Declaration
\*---------------------------------------------------------------------------*/
class constantAspectRatio
:
public aspectRatioModel
{
// Private data
//- Constant aspect ratio value
const dimensionedScalar E0_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from a dictionary and an ordered phase pair
constantAspectRatio
(
const dictionary& dict,
const phasePair& pair
);
//- Destructor
virtual ~constantAspectRatio();
// Member Functions
//- Aspect ratio
virtual tmp<volScalarField> E() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace aspectRatioModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,104 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2016-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Beetstra.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(Beetstra, 0);
addToRunTimeSelectionTable(dragModel, Beetstra, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::Beetstra::Beetstra
(
const dictionary& dict,
const phasePair& pair,
const bool registerObject
)
:
dragModel(dict, pair, registerObject),
residualRe_("residualRe", dimless, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::Beetstra::~Beetstra()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::Beetstra::CdRe() const
{
volScalarField alpha1
(
max(pair_.dispersed(), pair_.continuous().residualAlpha())
);
volScalarField alpha2
(
max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha())
);
volScalarField Res(alpha2*pair_.Re());
volScalarField ResLim
(
"ReLim",
max(Res, residualRe_)
);
volScalarField F0
(
"F0",
10.0*alpha1/sqr(alpha2) + sqr(alpha2)*(1.0 + 1.5*sqrt(alpha1))
);
volScalarField F1
(
"F1",
0.413*Res/(24.0*sqr(alpha2))*(1.0/alpha2
+ 3.0*alpha1*alpha2 + 8.4*pow(ResLim, -0.343))
/(1.0 + pow(10.0, 3*alpha1)*pow(ResLim, -(1.0 + 4.0*alpha1)/2.0))
);
return 24.0*alpha2*(F0 + F1);
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More