diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..d676e48c65bb05464c2fcec45a878418b917c38b --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/files @@ -0,0 +1,5 @@ +derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C +../solid/solidRegionDiffNo.C +chtMultiRegionTwoPhaseEulerFoam.C + +EXE = $(FOAM_APPBIN)/chtMultiRegionTwoPhaseEulerFoam diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..4a667217bd982262e0a18ec13f7facde03d9354c --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options @@ -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 \ + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/chtMultiRegionTwoPhaseEulerFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/chtMultiRegionTwoPhaseEulerFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..9a69e5f088a80d99be4a87b2384ee4eb93022921 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/chtMultiRegionTwoPhaseEulerFoam.C @@ -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; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..5f4e83950842d9b7a1f55adeba2e862dd054ff73 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C @@ -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 + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..4a6256a0e5c90f31b5c3f4e95acdd1e49f0500f7 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H @@ -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 + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/compressibleMultiRegionCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/compressibleMultiRegionCourantNo.H new file mode 100644 index 0000000000000000000000000000000000000000..3e363440e8f17f108ffa74afda8c61a3a987213b --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/compressibleMultiRegionCourantNo.H @@ -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; + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/createFluidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..6d1e3b9bcccd2a4f55d4a39a872411bf715fbdfb --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/createFluidFields.H @@ -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] + ) + ); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/initContinuityErrs.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/initContinuityErrs.H new file mode 100644 index 0000000000000000000000000000000000000000..002a5ac479573ce853180790d91085a846026409 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/initContinuityErrs.H @@ -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()); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/readFluidMultiRegionPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/readFluidMultiRegionPIMPLEControls.H new file mode 100644 index 0000000000000000000000000000000000000000..f4ced506227eee82ecaae9cf62a9dd165819baf4 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/readFluidMultiRegionPIMPLEControls.H @@ -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) + ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..7b55ecf5295093eca59bb4e5941167e06459118c --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H @@ -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]; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/solveFluid.H new file mode 100644 index 0000000000000000000000000000000000000000..10d3c5bcae60e67eb55f1f8283232d952c38df00 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/solveFluid.H @@ -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"); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/storeOldFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/storeOldFluidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..517474838cdc5aea3430d5b46f441b4e9a8c35cd --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/storeOldFluidFields.H @@ -0,0 +1,2 @@ +p_rghFluid[i].storePrevIter(); +//rhoFluid[i].storePrevIter(); diff --git a/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H b/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H index bada4c6c0129c5351fb3b85fe0e076a95161687c..33b6bd75ded220931577fdfca5db0ce24af74604 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H @@ -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() ); } diff --git a/applications/solvers/multiphase/VoF/alphaEqn.H b/applications/solvers/multiphase/VoF/alphaEqn.H index ad9ddcb5e5b94781456388ed7fae5dd899cd8068..a9a959fe45c30ca91ea94daf7575cf5b38781d43 100644 --- a/applications/solvers/multiphase/VoF/alphaEqn.H +++ b/applications/solvers/multiphase/VoF/alphaEqn.H @@ -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() ); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C index fa837780ad801092fc208696ab8bb48083a5a41d..36083886cb689a3d10d67ee49aa54e2aae2fd619 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -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 diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index 895bbe3d8d4ecaebc410badba57370456e8b2d36..6a34cc4e20b2d2d9f6622f91987a64555614cd88 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -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 ( diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 2fede3599bd317ff84010c1ae4ee8cdbcd9d2008..97f4b8947c3f09d0ac6cfda368d02ef528fa62bf 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -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 ); diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 7be76f32634a38290d623a9f4897448ddaeb02a5..9bcbfbe4d74e9f3542a0bd79b422e04346f88033 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -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 ( diff --git a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H index 3938fde30f0e5121081ddad3154f7414686461c2..0a64efbcd8fbf89d7715e5d0843d2902ffc4ac8f 100644 --- a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H +++ b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H @@ -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() ); } } diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C index 858b43424272a0547ef011d18701bfafd5e12a19..deedbf968f5a3a5e9e77ccefe973282ee382969e 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C @@ -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; diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.C index f19e3419dad406404cdd013d352e2b18670ece7e..9dcc79cdcaeb87ae545b8284d0119f096399331d 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.C @@ -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 diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.H index 1d711d1ba98fb389c7f31c29a25d0f29a2f23cdf..f96cea2002d9edf93db0ed1b4f8fbd41318addde 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.H @@ -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; diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C index 0fd59e03019e374f7c2aa2735497fd7c78011326..f4a1414df33f6f1cde51e2489ec647f08eae8bc3 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystem.C @@ -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; diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.C index d906813ff76cae6c623b34bb11553d6600e45677..64943f47c460acb77e993527ed21fa62eb34edbb 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.C @@ -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 diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.H index 932b3a3f8e6ead58bfb7805ff4fe5580708dde2a..947f97b1bf8b05688d4c8f53bb16ba7e21ef5baa 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.H +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/phaseSystem.H @@ -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 diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/TEqn.H similarity index 77% rename from applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/TEqn.H index 29b1ae466fdb33c712e15bc4de3d346d75b18f34..b570a71d80dccde41fb6bbae95953033029fe44b 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/TEqn.H @@ -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(); diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H index 8324a25e9682a46ff93d1d1fe2d28298f8850697..f0de2deffd4c0d01467e69f41bd2ad79a7d9b370 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H @@ -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(); diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C index b5fc74e5bd02ec10cc539f5b4b854dae878c02ee..9186fa1e98a9f0acbcb75f6fce78d3c6d6d76506 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C @@ -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()) diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C index 4d846ec43acd795deb876e3297a42d5db0d9c19c..6f84abe8c9887138e70bdf6249ba8441819f129b 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C @@ -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 diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H index 07c3c612de41fac4a9078601a85cf224e90b6aaf..9a0fecadf7370b6631b7111515ffa69508e75df2 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H @@ -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 diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/interMixingFoam/alphaEqn.H index 004c0d1ddb8e475c1e280b610be87224b345f46a..9c1017e617bb8193eb00f83b8fd0931a3826e1ef 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/alphaEqn.H @@ -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() ); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 150ccd1f787e98885e24a3c0a9fbec536737b776..e3bbba19d8bcd7a1d1735dbcf08b6facfc5f122d 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -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; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 2b1f4d9386d315ae4e1ccd71eb3c2ae75659d641..ebcd6caba8495cb7b01b53df459168daf044d55e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -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; + } } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index 10f8e835e2d65a2da50efef241a5e087aeb3957d..8aebcd8d53523c3578b56b11cd14b5c1c1ac17ee 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -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 diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index d35f122e06bf327ebb8cbf8f66cddd71de2433d4..af042603a78fbe9772afbca577be811d586d6602 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -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(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean index ad8f3f8fafb54efe8b51f2bac0a2423e8ff751b8..71b3b9609bd72ad803a1905ce58eab11aaf8e645 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean @@ -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 #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake index bcf5ba22e95e5e91abe786a024600edc973716ce..a334548fd777209f569bfc1559156c8f4fcb76e4 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake @@ -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 #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..ca7d02162dbd5f5feb601c39c9fae101549aa696 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files @@ -0,0 +1,4 @@ +sizeDistribution/sizeDistribution.C +phaseForces/phaseForces.C + +LIB = $(FOAM_LIBBIN)/libreactingEulerFoamFunctionObjects diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..8ff34452ca317c8c4353a023a7583f4453c7ced5 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options @@ -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 diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.C b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.C new file mode 100644 index 0000000000000000000000000000000000000000..c9f75620dcc2250b528ac20768af989aa4a4f660 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.C @@ -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; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.H b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.H new file mode 100644 index 0000000000000000000000000000000000000000..5f3dc4903c2d338c1df544d0af14e41b948abd50 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/phaseForces/phaseForces.H @@ -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 + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C new file mode 100644 index 0000000000000000000000000000000000000000..bdf6f34016d494994af7e84067c20ac0626cdde3 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C @@ -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; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H new file mode 100644 index 0000000000000000000000000000000000000000..2e516e2ab1554f9aeb9494fcef8a838bf660e27a --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.H @@ -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 + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C deleted file mode 100644 index a74706c99a39204ac1142891fe3161acb397fda3..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C +++ /dev/null @@ -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 - ); -} - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C deleted file mode 100644 index ae568a0fc73e5b3f8e6659116c6d113b8d611628..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C +++ /dev/null @@ -1,550 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2014-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 "BlendedInterfacialModel.H" -#include "fixedValueFvsPatchFields.H" -#include "surfaceInterpolate.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template<class ModelType> -template<class GeometricField> -void Foam::BlendedInterfacialModel<ModelType>::correctFixedFluxBCs -( - GeometricField& field -) const -{ - typename GeometricField::Boundary& fieldBf = - field.boundaryFieldRef(); - - forAll(phase1_.phi()().boundaryField(), patchi) - { - if - ( - isA<fixedValueFvsPatchScalarField> - ( - phase1_.phi()().boundaryField()[patchi] - ) - ) - { - fieldBf[patchi] = Zero; - } - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class ModelType> -Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel -( - const phaseModel& phase1, - const phaseModel& phase2, - const blendingMethod& blending, - autoPtr<ModelType> model, - autoPtr<ModelType> model1In2, - autoPtr<ModelType> model2In1, - const bool correctFixedFluxBCs -) -: - phase1_(phase1), - phase2_(phase2), - blending_(blending), - model_(model), - model1In2_(model1In2), - model2In1_(model2In1), - correctFixedFluxBCs_(correctFixedFluxBCs) -{} - - -template<class ModelType> -Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel -( - const phasePair::dictTable& modelTable, - const blendingMethod& blending, - const phasePair& pair, - const orderedPhasePair& pair1In2, - const orderedPhasePair& pair2In1, - const bool correctFixedFluxBCs -) -: - phase1_(pair.phase1()), - phase2_(pair.phase2()), - blending_(blending), - correctFixedFluxBCs_(correctFixedFluxBCs) -{ - if (modelTable.found(pair)) - { - model_.set - ( - ModelType::New - ( - modelTable[pair], - pair - ).ptr() - ); - } - - if (modelTable.found(pair1In2)) - { - model1In2_.set - ( - ModelType::New - ( - modelTable[pair1In2], - pair1In2 - ).ptr() - ); - } - - if (modelTable.found(pair2In1)) - { - model2In1_.set - ( - ModelType::New - ( - modelTable[pair2In1], - pair2In1 - ).ptr() - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class ModelType> -Foam::BlendedInterfacialModel<ModelType>::~BlendedInterfacialModel() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class ModelType> -bool Foam::BlendedInterfacialModel<ModelType>::hasModel -( - const class phaseModel& phase -) const -{ - return - &phase == &(phase1_) - ? model1In2_.valid() - : model2In1_.valid(); -} - - -template<class ModelType> -const ModelType& Foam::BlendedInterfacialModel<ModelType>::model -( - const class phaseModel& phase -) const -{ - return &phase == &(phase1_) ? model1In2_ : model2In1_; -} - - -template<class ModelType> -Foam::tmp<Foam::volScalarField> -Foam::BlendedInterfacialModel<ModelType>::K() const -{ - tmp<volScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = blending_.f1(phase1_, phase2_); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = blending_.f2(phase1_, phase2_); - } - - tmp<volScalarField> x - ( - new volScalarField - ( - IOobject - ( - ModelType::typeName + ":K", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensionedScalar(ModelType::dimK, Zero) - ) - ); - - if (model_.valid()) - { - x.ref() += model_->K()*(scalar(1) - f1() - f2()); - } - if (model1In2_.valid()) - { - x.ref() += model1In2_->K()*f1; - } - if (model2In1_.valid()) - { - x.ref() += model2In1_->K()*f2; - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -template<class ModelType> -Foam::tmp<Foam::volScalarField> -Foam::BlendedInterfacialModel<ModelType>::K(const scalar residualAlpha) const -{ - tmp<volScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = blending_.f1(phase1_, phase2_); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = blending_.f2(phase1_, phase2_); - } - - tmp<volScalarField> x - ( - new volScalarField - ( - IOobject - ( - ModelType::typeName + ":K", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensionedScalar(ModelType::dimK, Zero) - ) - ); - - if (model_.valid()) - { - x.ref() += model_->K(residualAlpha)*(scalar(1) - f1() - f2()); - } - if (model1In2_.valid()) - { - x.ref() += model1In2_->K(residualAlpha)*f1; - } - if (model2In1_.valid()) - { - x.ref() += model2In1_->K(residualAlpha)*f2; - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -template<class ModelType> -Foam::tmp<Foam::surfaceScalarField> -Foam::BlendedInterfacialModel<ModelType>::Kf() const -{ - tmp<surfaceScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = fvc::interpolate - ( - blending_.f1(phase1_, phase2_) - ); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = fvc::interpolate - ( - blending_.f2(phase1_, phase2_) - ); - } - - tmp<surfaceScalarField> x - ( - new surfaceScalarField - ( - IOobject - ( - ModelType::typeName + ":Kf", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensionedScalar(ModelType::dimK, Zero) - ) - ); - - if (model_.valid()) - { - x.ref() += model_->Kf()*(scalar(1) - f1() - f2()); - } - - if (model1In2_.valid()) - { - x.ref() += model1In2_->Kf()*f1; - } - - if (model2In1_.valid()) - { - x.ref() += model2In1_->Kf()*f2; - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -template<class ModelType> -template<class Type> -Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>> -Foam::BlendedInterfacialModel<ModelType>::F() const -{ - tmp<volScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = blending_.f1(phase1_, phase2_); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = blending_.f2(phase1_, phase2_); - } - - tmp<GeometricField<Type, fvPatchField, volMesh>> x - ( - new GeometricField<Type, fvPatchField, volMesh> - ( - IOobject - ( - ModelType::typeName + ":F", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensioned<Type>(ModelType::dimF, Zero) - ) - ); - - if (model_.valid()) - { - x.ref() += model_->F()*(scalar(1) - f1() - f2()); - } - - if (model1In2_.valid()) - { - x.ref() += model1In2_->F()*f1; - } - - if (model2In1_.valid()) - { - x.ref() -= model2In1_->F()*f2; // note : subtraction - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -template<class ModelType> -Foam::tmp<Foam::surfaceScalarField> -Foam::BlendedInterfacialModel<ModelType>::Ff() const -{ - tmp<surfaceScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = fvc::interpolate - ( - blending_.f1(phase1_, phase2_) - ); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = fvc::interpolate - ( - blending_.f2(phase1_, phase2_) - ); - } - - tmp<surfaceScalarField> x - ( - new surfaceScalarField - ( - IOobject - ( - ModelType::typeName + ":Ff", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensionedScalar(ModelType::dimF*dimArea, Zero) - ) - ); - x.ref().setOriented(); - - if (model_.valid()) - { - x.ref() += model_->Ff()*(scalar(1) - f1() - f2()); - } - - if (model1In2_.valid()) - { - x.ref() += model1In2_->Ff()*f1; - } - - if (model2In1_.valid()) - { - x.ref() -= model2In1_->Ff()*f2; // note : subtraction - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -template<class ModelType> -Foam::tmp<Foam::volScalarField> -Foam::BlendedInterfacialModel<ModelType>::D() const -{ - tmp<volScalarField> f1, f2; - - if (model_.valid() || model1In2_.valid()) - { - f1 = blending_.f1(phase1_, phase2_); - } - - if (model_.valid() || model2In1_.valid()) - { - f2 = blending_.f2(phase1_, phase2_); - } - - tmp<volScalarField> x - ( - new volScalarField - ( - IOobject - ( - ModelType::typeName + ":D", - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase1_.mesh(), - dimensionedScalar(ModelType::dimD, Zero) - ) - ); - - if (model_.valid()) - { - x.ref() += model_->D()*(scalar(1) - f1() - f2()); - } - if (model1In2_.valid()) - { - x.ref() += model1In2_->D()*f1; - } - if (model2In1_.valid()) - { - x.ref() += model2In1_->D()*f2; - } - - if - ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) - ) - { - correctFixedFluxBCs(x.ref()); - } - - return x; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files deleted file mode 100644 index 1f516dc2437c5f1a0eb3b03dc9e1388511a686c1..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/files +++ /dev/null @@ -1,24 +0,0 @@ -phaseModel/phaseModel/phaseModel.C -phaseModel/phaseModel/newPhaseModel.C -phaseModel/phaseModel/phaseModels.C - -phasePair/phasePairKey/phasePairKey.C -phasePair/phasePair/phasePair.C -phasePair/orderedPhasePair/orderedPhasePair.C - -phaseSystem/phaseSystem.C - -diameterModels/diameterModel/diameterModel.C -diameterModels/diameterModel/newDiameterModel.C -diameterModels/constantDiameter/constantDiameter.C -diameterModels/isothermalDiameter/isothermalDiameter.C - -BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C -BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C -BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C -BlendedInterfacialModel/blendingMethods/linear/linear.C -BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C - -reactionThermo/hRefConstThermos.C - -LIB = $(FOAM_LIBBIN)/libreactingPhaseSystem diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C deleted file mode 100644 index 71c5a113847e6602a9c8cbf79b5f13d9c21575f0..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C +++ /dev/null @@ -1,371 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ 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 "HeatAndMassTransferPhaseSystem.H" - -#include "BlendedInterfacialModel.H" -#include "heatTransferModel.H" -#include "massTransferModel.H" - -#include "HashPtrTable.H" - -#include "fvcDiv.H" -#include "fvmSup.H" -#include "fvMatrix.H" -#include "zeroGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>:: -HeatAndMassTransferPhaseSystem -( - const fvMesh& mesh -) -: - BasePhaseSystem(mesh) -{ - this->generatePairsAndSubModels - ( - "heatTransfer", - heatTransferModels_ - ); - - this->generatePairsAndSubModels - ( - "massTransfer", - massTransferModels_ - ); - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - // Initially assume no mass transfer - - dmdt_.set - ( - pair, - new volScalarField - ( - IOobject - ( - IOobject::groupName("dmdt", pair.name()), - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ) - ); - - dmdtExplicit_.set - ( - pair, - new volScalarField - ( - IOobject - ( - IOobject::groupName("dmdtExplicit", pair.name()), - this->mesh().time().timeName(), - this->mesh() - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ) - ); - - volScalarField H1(heatTransferModels_[pair][pair.first()]->K()); - volScalarField H2(heatTransferModels_[pair][pair.second()]->K()); - - Tf_.set - ( - pair, - new volScalarField - ( - IOobject - ( - IOobject::groupName("Tf", pair.name()), - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - ( - H1*pair.phase1().thermo().T() - + H2*pair.phase2().thermo().T() - ) - /max - ( - H1 + H2, - dimensionedScalar("small", heatTransferModel::dimK, SMALL) - ), - zeroGradientFvPatchScalarField::typeName - ) - ); - Tf_[pair]->correctBoundaryConditions(); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>:: -~HeatAndMassTransferPhaseSystem() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -bool Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::transfersMass -( - const phaseModel& phase -) const -{ - return true; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt -( - const phasePairKey& key -) const -{ - const scalar dmdtSign(Pair<word>::compare(dmdt_.find(key).key(), key)); - - return dmdtSign**dmdt_[key]; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt -( - const Foam::phaseModel& phase -) const -{ - tmp<volScalarField> tdmdt - ( - new volScalarField - ( - IOobject - ( - IOobject::groupName("dmdt", phase.name()), - this->mesh_.time().timeName(), - this->mesh_ - ), - this->mesh_, - dimensionedScalar(dimDensity/dimTime, Zero) - ) - ); - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIters(pair, iter) - { - if (phase1 == &phase) - { - tdmdt.ref() += this->dmdt(pair); - } - - Swap(phase1, phase2); - } - } - - return tdmdt; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::momentumTransferTable> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const -{ - autoPtr<phaseSystem::momentumTransferTable> - eqnsPtr(BasePhaseSystem::momentumTransfer()); - - phaseSystem::momentumTransferTable& eqns = eqnsPtr(); - - // Source term due to mass transfer - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const volVectorField& U1(pair.phase1().U()); - const volVectorField& U2(pair.phase2().U()); - - const volScalarField dmdt(this->dmdt(pair)); - const volScalarField dmdt21(posPart(dmdt)); - const volScalarField dmdt12(negPart(dmdt)); - - *eqns[pair.phase1().name()] += dmdt21*U2 - fvm::Sp(dmdt21, U1); - *eqns[pair.phase2().name()] -= dmdt12*U1 - fvm::Sp(dmdt12, U2); - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::heatTransferTable> -Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const -{ - auto eqnsPtr = autoPtr<phaseSystem::heatTransferTable>::New(); - auto& eqns = *eqnsPtr; - - for (const phaseModel& phase : this->phaseModels_) - { - eqns.set - ( - phase.name(), - new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime) - ); - } - - // Heat transfer with the interface - forAllConstIters(heatTransferModels_, heatTransferModelIter) - { - const phasePair& pair = - *(this->phasePairs_[heatTransferModelIter.key()]); - - const phaseModel* phase = &pair.phase1(); - const phaseModel* otherPhase = &pair.phase2(); - - const volScalarField& Tf(*Tf_[pair]); - - const volScalarField K1 - ( - heatTransferModelIter()[pair.first()]->K() - ); - const volScalarField K2 - ( - heatTransferModelIter()[pair.second()]->K() - ); - const volScalarField KEff - ( - K1*K2 - /max - ( - K1 + K2, - dimensionedScalar("small", heatTransferModel::dimK, SMALL) - ) - ); - - const volScalarField* K = &K1; - const volScalarField* otherK = &K2; - - forAllConstIters(pair, iter) - { - const volScalarField& he(phase->thermo().he()); - volScalarField Cpv(phase->thermo().Cpv()); - - *eqns[phase->name()] += - (*K)*(Tf - phase->thermo().T()) - + KEff/Cpv*he - fvm::Sp(KEff/Cpv, he); - - Swap(phase, otherPhase); - Swap(K, otherK); - } - } - - // Source term due to mass transfer - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); - - const volScalarField& he1(phase1.thermo().he()); - const volScalarField& he2(phase2.thermo().he()); - - const volScalarField& K1(phase1.K()); - const volScalarField& K2(phase2.K()); - - const volScalarField dmdt(this->dmdt(pair)); - const volScalarField dmdt21(posPart(dmdt)); - const volScalarField dmdt12(negPart(dmdt)); - const volScalarField& Tf(*Tf_[pair]); - - *eqns[phase1.name()] += - dmdt21*(phase1.thermo().he(phase1.thermo().p(), Tf)) - - fvm::Sp(dmdt21, he1) - + dmdt21*(K2 - K1); - - *eqns[phase2.name()] -= - dmdt12*(phase2.thermo().he(phase2.thermo().p(), Tf)) - - fvm::Sp(dmdt12, he2) - + dmdt12*(K1 - K2); - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -bool Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::read() -{ - if (BasePhaseSystem::read()) - { - return true; - } - - return false; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C deleted file mode 100644 index e4db55591ab4ca52c730fb0372275aa6308884bc..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C +++ /dev/null @@ -1,176 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ 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 "HeatTransferPhaseSystem.H" - -#include "BlendedInterfacialModel.H" -#include "heatTransferModel.H" - -#include "HashPtrTable.H" - -#include "fvcDiv.H" -#include "fvmSup.H" -#include "fvMatrix.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::HeatTransferPhaseSystem -( - const fvMesh& mesh -) -: - BasePhaseSystem(mesh) -{ - this->generatePairsAndSubModels("heatTransfer", heatTransferModels_); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::~HeatTransferPhaseSystem() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -bool Foam::HeatTransferPhaseSystem<BasePhaseSystem>::transfersMass -( - const phaseModel& phase -) const -{ - return false; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::dmdt -( - const phasePairKey& key -) const -{ - return tmp<volScalarField>::New - ( - IOobject - ( - IOobject::groupName - ( - "dmdt", - this->phasePairs_[key]->name() - ), - this->mesh().time().timeName(), - this->mesh().time() - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::dmdt -( - const Foam::phaseModel& phase -) const -{ - return tmp<volScalarField>(nullptr); -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::heatTransferTable> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const -{ - auto eqnsPtr = autoPtr<phaseSystem::heatTransferTable>::New(); - auto& eqns = *eqnsPtr; - - for (const phaseModel& phase : this->phaseModels_) - { - eqns.set - ( - phase.name(), - new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime) - ); - } - - forAllConstIters(heatTransferModels_, heatTransferModelIter) - { - const phasePair& pair = - *(this->phasePairs_[heatTransferModelIter.key()]); - - const volScalarField K(heatTransferModelIter()->K()); - - const phaseModel* phase = &pair.phase1(); - const phaseModel* otherPhase = &pair.phase2(); - - forAllConstIters(pair, iter) - { - const volScalarField& he(phase->thermo().he()); - volScalarField Cpv(phase->thermo().Cpv()); - - *eqns[phase->name()] += - K*(otherPhase->thermo().T() - phase->thermo().T() + he/Cpv) - - fvm::Sp(K/Cpv, he); - - Swap(phase, otherPhase); - } - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::massTransferTable> -Foam::HeatTransferPhaseSystem<BasePhaseSystem>::massTransfer() const -{ - autoPtr<phaseSystem::massTransferTable> eqnsPtr - ( - new phaseSystem::massTransferTable() - ); - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -bool Foam::HeatTransferPhaseSystem<BasePhaseSystem>::read() -{ - if (BasePhaseSystem::read()) - { - return true; - } - - return false; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C deleted file mode 100644 index 608a4d09d7cb05a6acab3df4cce1cca5d5e6d344..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C +++ /dev/null @@ -1,294 +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 "InterfaceCompositionPhaseChangePhaseSystem.H" -#include "interfaceCompositionModel.H" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: -InterfaceCompositionPhaseChangePhaseSystem -( - const fvMesh& mesh -) -: - HeatAndMassTransferPhaseSystem<BasePhaseSystem>(mesh) -{ - this->generatePairsAndSubModels - ( - "interfaceComposition", - interfaceCompositionModels_ - ); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: -~InterfaceCompositionPhaseChangePhaseSystem() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::massTransferTable> -Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: -massTransfer() const -{ - // Create a mass transfer matrix for each species of each phase - auto eqnsPtr = autoPtr<phaseSystem::massTransferTable>::New(); - auto& eqns = *eqnsPtr; - - for (const phaseModel& phase : this->phaseModels_) - { - const PtrList<volScalarField>& Yi = phase.Y(); - - forAll(Yi, i) - { - eqns.set - ( - Yi[i].name(), - new fvScalarMatrix(Yi[i], dimMass/dimTime) - ); - } - } - - // Reset the interfacial mass flow rates - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - *this->dmdt_[pair] = - *this->dmdtExplicit_[pair]; - - *this->dmdtExplicit_[pair] = - dimensionedScalar(dimDensity/dimTime, Zero); - } - - // Sum up the contribution from each interface composition model - forAllConstIters(interfaceCompositionModels_, modelIter) - { - const phasePair& pair = *(this->phasePairs_[modelIter.key()]); - - const interfaceCompositionModel& compositionModel = *(modelIter.val()); - - const phaseModel& phase = pair.phase1(); - const phaseModel& otherPhase = pair.phase2(); - const phasePairKey key(phase.name(), otherPhase.name()); - - const volScalarField& Tf(*this->Tf_[key]); - - volScalarField& dmdtExplicit(*this->dmdtExplicit_[key]); - volScalarField& dmdt(*this->dmdt_[key]); - - scalar dmdtSign(Pair<word>::compare(this->dmdt_.find(key).key(), key)); - - const volScalarField K - ( - this->massTransferModels_[key][phase.name()]->K() - ); - - for (const word& member : compositionModel.species()) - { - const word name - ( - IOobject::groupName(member, phase.name()) - ); - - const word otherName - ( - IOobject::groupName(member, otherPhase.name()) - ); - - const volScalarField KD - ( - K*compositionModel.D(member) - ); - - const volScalarField Yf - ( - compositionModel.Yf(member, Tf) - ); - - // Implicit transport through the phase - *eqns[name] += - phase.rho()*KD*Yf - - fvm::Sp(phase.rho()*KD, eqns[name]->psi()); - - // Sum the mass transfer rate - dmdtExplicit += dmdtSign*phase.rho()*KD*Yf; - dmdt -= dmdtSign*phase.rho()*KD*eqns[name]->psi(); - - // Explicit transport out of the other phase - if (eqns.found(otherName)) - { - *eqns[otherName] -= - otherPhase.rho()*KD*compositionModel.dY(member, Tf); - } - } - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -void Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: -correctThermo() -{ - BasePhaseSystem::correctThermo(); - - // This loop solves for the interface temperatures, Tf, and updates the - // interface composition models. - // - // The rate of heat transfer to the interface must equal the latent heat - // consumed at the interface, i.e.: - // - // H1*(T1 - Tf) + H2*(T2 - Tf) == mDotL - // == K*rho*(Yfi - Yi)*Li - // - // Yfi is likely to be a strong non-linear (typically exponential) function - // of Tf, so the solution for the temperature is newton-accelerated - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phasePairKey key12(pair.first(), pair.second(), true); - const phasePairKey key21(pair.second(), pair.first(), true); - - volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K()); - volScalarField H2(this->heatTransferModels_[pair][pair.second()]->K()); - dimensionedScalar HSmall("small", heatTransferModel::dimK, SMALL); - - volScalarField mDotL - ( - IOobject - ( - "mDotL", - this->mesh().time().timeName(), - this->mesh() - ), - this->mesh(), - dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero) - ); - volScalarField mDotLPrime - ( - IOobject - ( - "mDotLPrime", - this->mesh().time().timeName(), - this->mesh() - ), - this->mesh(), - dimensionedScalar(mDotL.dimensions()/dimTemperature, Zero) - ); - - volScalarField& Tf = *this->Tf_[pair]; - - // Add latent heats from forward and backward models - if (this->interfaceCompositionModels_.found(key12)) - { - this->interfaceCompositionModels_[key12]->addMDotL - ( - this->massTransferModels_[pair][pair.first()]->K(), - Tf, - mDotL, - mDotLPrime - ); - } - if (this->interfaceCompositionModels_.found(key21)) - { - this->interfaceCompositionModels_[key21]->addMDotL - ( - this->massTransferModels_[pair][pair.second()]->K(), - Tf, - mDotL, - mDotLPrime - ); - } - - // Update the interface temperature by applying one step of newton's - // method to the interface relation - Tf -= - ( - H1*(Tf - pair.phase1().thermo().T()) - + H2*(Tf - pair.phase2().thermo().T()) - + mDotL - ) - /( - max(H1 + H2 + mDotLPrime, HSmall) - ); - - Tf.correctBoundaryConditions(); - - Info<< "Tf." << pair.name() - << ": min = " << min(Tf.primitiveField()) - << ", mean = " << average(Tf.primitiveField()) - << ", max = " << max(Tf.primitiveField()) - << endl; - - // Update the interface compositions - if (this->interfaceCompositionModels_.found(key12)) - { - this->interfaceCompositionModels_[key12]->update(Tf); - } - if (this->interfaceCompositionModels_.found(key21)) - { - this->interfaceCompositionModels_[key21]->update(Tf); - } - } -} - - -template<class BasePhaseSystem> -bool Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::read() -{ - if (BasePhaseSystem::read()) - { - return true; - } - - return false; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C deleted file mode 100644 index c00e6322f91d70df5bd06e3366b9d640b2d892d3..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C +++ /dev/null @@ -1,604 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ 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 "MomentumTransferPhaseSystem.H" - -#include "BlendedInterfacialModel.H" -#include "dragModel.H" -#include "virtualMassModel.H" -#include "liftModel.H" -#include "wallLubricationModel.H" -#include "turbulentDispersionModel.H" - -#include "HashPtrTable.H" - -#include "fvmDdt.H" -#include "fvmDiv.H" -#include "fvmSup.H" -#include "fvcDiv.H" -#include "fvcSnGrad.H" -#include "fvMatrix.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>:: -MomentumTransferPhaseSystem -( - const fvMesh& mesh -) -: - BasePhaseSystem(mesh) -{ - this->generatePairsAndSubModels - ( - "drag", - dragModels_ - ); - - this->generatePairsAndSubModels - ( - "virtualMass", - virtualMassModels_ - ); - - this->generatePairsAndSubModels - ( - "lift", - liftModels_ - ); - - this->generatePairsAndSubModels - ( - "wallLubrication", - wallLubricationModels_ - ); - - this->generatePairsAndSubModels - ( - "turbulentDispersion", - turbulentDispersionModels_ - ); - - forAllConstIters(dragModels_, dragModelIter) - { - const phasePair& pair = - *(this->phasePairs_[dragModelIter.key()]); - - Kds_.set - ( - pair, - new volScalarField - ( - IOobject::groupName("Kd", pair.name()), - dragModelIter()->K() - ) - ); - } - - forAllConstIters(virtualMassModels_, virtualMassModelIter) - { - const phasePair& pair = - *(this->phasePairs_[virtualMassModelIter.key()]); - - Vms_.set - ( - pair, - new volScalarField - ( - IOobject::groupName("Vm", pair.name()), - virtualMassModelIter()->K() - ) - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>:: -~MomentumTransferPhaseSystem() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd -( - const phasePairKey& key -) const -{ - return dragModels_[key]->K(); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::surfaceScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kdf -( - const phasePairKey& key -) const -{ - return dragModels_[key]->Kf(); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd -( - const Foam::phaseModel& phase -) const -{ - tmp<volScalarField> tKd - ( - new volScalarField - ( - IOobject - ( - IOobject::groupName("Kd", phase.name()), - this->mesh_.time().timeName(), - this->mesh_ - ), - this->mesh_, - dimensionedScalar(dimensionSet(1, -3, -1, 0, 0), Zero) - ) - ); - - forAllConstIters(Kds_, KdIter) - { - const phasePair& pair = *(this->phasePairs_[KdIter.key()]); - - const volScalarField& K(*KdIter()); - - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIters(pair, iter) - { - if (phase1 == &phase) - { - tKd.ref() += K; - } - - Swap(phase1, phase2); - } - } - - return tKd; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Vm -( - const phasePairKey& key -) const -{ - if (virtualMassModels_.found(key)) - { - return virtualMassModels_[key]->K(); - } - - return tmp<volScalarField>::New - ( - IOobject - ( - virtualMassModel::typeName + ":K", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar(virtualMassModel::dimK, Zero) - ); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::surfaceScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Vmf -( - const phasePairKey& key -) const -{ - if (virtualMassModels_.found(key)) - { - return virtualMassModels_[key]->Kf(); - } - - return tmp<surfaceScalarField>::New - ( - IOobject - ( - virtualMassModel::typeName + ":Kf", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar(virtualMassModel::dimK, Zero) - ); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volVectorField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::F -( - const phasePairKey& key -) const -{ - if (liftModels_.found(key) && wallLubricationModels_.found(key)) - { - return - liftModels_[key]->template F<vector>() - + wallLubricationModels_[key]->template F<vector>(); - } - else if (liftModels_.found(key)) - { - return liftModels_[key]->template F<vector>(); - } - else if (wallLubricationModels_.found(key)) - { - return wallLubricationModels_[key]->template F<vector>(); - } - - return tmp<volVectorField>::New - ( - IOobject - ( - liftModel::typeName + ":F", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedVector(liftModel::dimF, Zero) - ); -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::surfaceScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Ff -( - const phasePairKey& key -) const -{ - if (liftModels_.found(key) && wallLubricationModels_.found(key)) - { - return - liftModels_[key]->Ff() - + wallLubricationModels_[key]->Ff(); - } - else if (liftModels_.found(key)) - { - return liftModels_[key]->Ff(); - } - else if (wallLubricationModels_.found(key)) - { - return wallLubricationModels_[key]->Ff(); - } - else - { - tmp<surfaceScalarField> tFf - ( - new surfaceScalarField - ( - IOobject - ( - liftModel::typeName + ":Ff", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar(liftModel::dimF*dimArea, Zero) - ) - ); - - tFf.ref().setOriented(); - - return tFf; - } -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::D -( - const phasePairKey& key -) const -{ - if (turbulentDispersionModels_.found(key)) - { - return turbulentDispersionModels_[key]->D(); - } - - return tmp<volScalarField>::New - ( - IOobject - ( - turbulentDispersionModel::typeName + ":D", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar(turbulentDispersionModel::dimD, Zero) - ); -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::momentumTransferTable> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const -{ - // Create a momentum transfer matrix for each phase - auto eqnsPtr = autoPtr<phaseSystem::momentumTransferTable>::New(); - auto& eqns = *eqnsPtr; - - for (const phaseModel& phase : this->phaseModels_) - { - eqns.set - ( - phase.name(), - new fvVectorMatrix(phase.U(), dimMass*dimVelocity/dimTime) - ); - } - - // Update the drag coefficients - forAllConstIters(dragModels_, dragModelIter) - { - *Kds_[dragModelIter.key()] = dragModelIter()->K(); - } - - // Add the implicit part of the drag force - forAllConstIters(Kds_, KdIter) - { - const phasePair& pair = *(this->phasePairs_[KdIter.key()]); - - const volScalarField& K(*KdIter()); - - const phaseModel* phase = &pair.phase1(); - const phaseModel* otherPhase = &pair.phase2(); - - forAllConstIters(pair, iter) - { - const volVectorField& U = phase->U(); - - *eqns[phase->name()] -= fvm::Sp(K, U); - - Swap(phase, otherPhase); - } - } - - // Update the virtual mass coefficients - forAllConstIters(virtualMassModels_, virtualMassModelIter) - { - *Vms_[virtualMassModelIter.key()] = virtualMassModelIter()->K(); - } - - // Add the virtual mass force - forAllConstIters(Vms_, VmIter) - { - const phasePair& pair = *(this->phasePairs_[VmIter.key()]); - - const volScalarField& Vm(*VmIter()); - - const phaseModel* phase = &pair.phase1(); - const phaseModel* otherPhase = &pair.phase2(); - - forAllConstIters(pair, iter) - { - const volVectorField& U = phase->U(); - const surfaceScalarField& phi = phase->phi(); - - *eqns[phase->name()] -= - Vm - *( - fvm::ddt(U) - + fvm::div(phi, U) - - fvm::Sp(fvc::div(phi), U) - - otherPhase->DUDt() - ) - + this->MRF_.DDt(Vm, U - otherPhase->U()); - - Swap(phase, otherPhase); - } - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -Foam::volVectorField& Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::setF -( - PtrList<volVectorField>& Fs, const label phasei -) const -{ - if (!Fs.set(phasei)) - { - Fs.set - ( - phasei, - new volVectorField - ( - IOobject - ( - liftModel::typeName + ":F", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedVector(liftModel::dimF, Zero) - ) - ); - } - - return Fs[phasei]; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::PtrList<Foam::volVectorField>> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Fs() const -{ - auto tFs = autoPtr<PtrList<volVectorField>>::New(this->phases().size()); - auto& Fs = *tFs; - - // Add the lift force - forAllConstIters(liftModels_, modelIter) - { - const phasePair& pair = *(this->phasePairs_[modelIter.key()]); - - const volVectorField F(modelIter()->template F<vector>()); - - setF(Fs, pair.phase1().index()) += F; - setF(Fs, pair.phase2().index()) -= F; - } - - // Add the wall lubrication force - forAllConstIters(wallLubricationModels_, modelIter) - { - const phasePair& pair = *(this->phasePairs_[modelIter.key()]); - - const volVectorField F(modelIter()->template F<vector>()); - - setF(Fs, pair.phase1().index()) += F; - setF(Fs, pair.phase2().index()) -= F; - } - - return tFs; -} - - -template<class BasePhaseSystem> -Foam::surfaceScalarField& -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::setPhiD -( - PtrList<surfaceScalarField>& phiDs, const label phasei -) const -{ - if (!phiDs.set(phasei)) - { - phiDs.set - ( - phasei, - new surfaceScalarField - ( - IOobject - ( - turbulentDispersionModel::typeName + ":phiD", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar - ( - dimTime*dimArea*turbulentDispersionModel::dimF/dimDensity, - Zero - ) - ) - ); - - phiDs[phasei].setOriented(); - } - - return phiDs[phasei]; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::PtrList<Foam::surfaceScalarField>> -Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiDs -( - const PtrList<volScalarField>& rAUs -) const -{ - auto tphiDs = - autoPtr<PtrList<surfaceScalarField>>::New(this->phases().size()); - auto& phiDs = *tphiDs; - - // Add the turbulent dispersion force - forAllConstIters(turbulentDispersionModels_, turbulentDispersionModelIter) - { - const phasePair& pair = - *(this->phasePairs_[turbulentDispersionModelIter.key()]); - - const volScalarField D(turbulentDispersionModelIter()->D()); - const surfaceScalarField snGradAlpha1 - ( - fvc::snGrad(pair.phase1())*this->mesh_.magSf() - ); - - setPhiD(phiDs, pair.phase1().index()) += - fvc::interpolate(rAUs[pair.phase1().index()]*D)*snGradAlpha1; - setPhiD(phiDs, pair.phase2().index()) -= - fvc::interpolate(rAUs[pair.phase2().index()]*D)*snGradAlpha1; - } - - return tphiDs; -} - - -template<class BasePhaseSystem> -bool Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::read() -{ - if (BasePhaseSystem::read()) - { - return true; - } - - return false; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C deleted file mode 100644 index 37787896fed9b6588cdea26e9c07168d8566f4bd..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ /dev/null @@ -1,497 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ 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 "ThermalPhaseChangePhaseSystem.H" -#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" -#include "fvcVolumeIntegrate.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>:: -ThermalPhaseChangePhaseSystem -( - const fvMesh& mesh -) -: - HeatAndMassTransferPhaseSystem<BasePhaseSystem>(mesh), - volatile_(this->lookup("volatile")), - saturationModel_(saturationModel::New(this->subDict("saturationModel"))), - massTransfer_(this->template get<bool>("massTransfer")) -{ - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - // Initially assume no mass transfer - iDmdt_.set - ( - pair, - new volScalarField - ( - IOobject - ( - IOobject::groupName("iDmdt", pair.name()), - this->mesh().time().timeName(), - this->mesh(), - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ) - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>:: -~ThermalPhaseChangePhaseSystem() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class BasePhaseSystem> -const Foam::saturationModel& -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::saturation() const -{ - return *saturationModel_; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::heatTransferTable> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const -{ - typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField - alphatPhaseChangeWallFunction; - - autoPtr<phaseSystem::heatTransferTable> eqnsPtr = - Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer(); - - phaseSystem::heatTransferTable& eqns = eqnsPtr(); - - // Accumulate mDotL contributions from boundaries - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel& phase = pair.phase1(); - const phaseModel& otherPhase = pair.phase2(); - - volScalarField mDotL - ( - IOobject - ( - "mDotL", - phase.mesh().time().timeName(), - phase.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - phase.mesh(), - dimensionedScalar(dimensionSet(1,-1,-3,0,0), Zero) - ); - - const volScalarField* alphatPtr = - otherPhase.mesh().findObject<volScalarField> - ( - "alphat." + otherPhase.name() - ); - - if (alphatPtr) - { - const volScalarField& alphat = *alphatPtr; - - const fvPatchList& patches = this->mesh().boundary(); - forAll(patches, patchi) - { - const fvPatch& currPatch = patches[patchi]; - - if - ( - isA<alphatPhaseChangeWallFunction> - ( - alphat.boundaryField()[patchi] - ) - ) - { - const scalarField& patchMDotL = - refCast<const alphatPhaseChangeWallFunction> - ( - alphat.boundaryField()[patchi] - ).mDotL(); - - forAll(patchMDotL,facei) - { - label faceCelli = currPatch.faceCells()[facei]; - mDotL[faceCelli] = patchMDotL[facei]; - } - } - } - } - - *eqns[otherPhase.name()] -= mDotL; - - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -Foam::autoPtr<Foam::phaseSystem::massTransferTable> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const -{ - // Create a mass transfer matrix for each species of each phase - auto eqnsPtr = autoPtr<phaseSystem::massTransferTable>::New(); - auto& eqns = *eqnsPtr; - - for (const phaseModel& phase : this->phaseModels_) - { - const PtrList<volScalarField>& Yi = phase.Y(); - - forAll(Yi, i) - { - eqns.set - ( - Yi[i].name(), - new fvScalarMatrix(Yi[i], dimMass/dimTime) - ); - } - } - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel& phase = pair.phase1(); - const phaseModel& otherPhase = pair.phase2(); - - const word thisName - ( - IOobject::groupName(volatile_, phase.name()) - ); - - const word otherName - ( - IOobject::groupName(volatile_, otherPhase.name()) - ); - - const volScalarField dmdt(this->dmdt(pair)); - const volScalarField dmdt12(posPart(dmdt)); - const volScalarField dmdt21(negPart(dmdt)); - - *eqns[thisName] += fvm::Sp(dmdt21, eqns[thisName]->psi()) - dmdt21; - *eqns[otherName] += dmdt12 - fvm::Sp(dmdt12, eqns[otherName]->psi()); - } - - return eqnsPtr; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt -( - const phasePairKey& key -) const -{ - const scalar dmdtSign(Pair<word>::compare(iDmdt_.find(key).key(), key)); - - return dmdtSign**iDmdt_[key]; -} - - -template<class BasePhaseSystem> -Foam::tmp<Foam::volScalarField> -Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt -( - const Foam::phaseModel& phase -) const -{ - tmp<volScalarField> tiDmdt - ( - new volScalarField - ( - IOobject - ( - IOobject::groupName("iDmdt", phase.name()), - this->mesh_.time().timeName(), - this->mesh_ - ), - this->mesh_, - dimensionedScalar(dimDensity/dimTime, Zero) - ) - ); - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIters(pair, iter) - { - if (phase1 == &phase) - { - tiDmdt.ref() += this->iDmdt(pair); - } - - Swap(phase1, phase2); - } - } - - return tiDmdt; -} - - -template<class BasePhaseSystem> -void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo() -{ - typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField - alphatPhaseChangeWallFunction; - - BasePhaseSystem::correctThermo(); - - forAllConstIters(this->phasePairs_, phasePairIter) - { - const phasePair& pair = *(phasePairIter.val()); - - if (pair.ordered()) - { - continue; - } - - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); - - Info<< phase1.name() << " min/max T " - << min(phase1.thermo().T()).value() - << " - " - << max(phase1.thermo().T()).value() - << endl; - - Info<< phase2.name() << " min/max T " - << min(phase2.thermo().T()).value() - << " - " - << max(phase2.thermo().T()).value() - << endl; - - const volScalarField& T1(phase1.thermo().T()); - const volScalarField& T2(phase2.thermo().T()); - - const volScalarField& he1(phase1.thermo().he()); - const volScalarField& he2(phase2.thermo().he()); - - volScalarField& dmdt(*this->dmdt_[pair]); - volScalarField& iDmdt(*this->iDmdt_[pair]); - - volScalarField& Tf = *this->Tf_[pair]; - - volScalarField hef1(phase1.thermo().he(phase1.thermo().p(), Tf)); - volScalarField hef2(phase2.thermo().he(phase2.thermo().p(), Tf)); - - volScalarField L - ( - min - ( - (pos0(iDmdt)*he2 + neg(iDmdt)*hef2) - - (neg(iDmdt)*he1 + pos0(iDmdt)*hef1), - 0.3*mag(hef2 - hef1) - ) - ); - - volScalarField iDmdtNew(iDmdt); - - if (massTransfer_) - { - volScalarField H1 - ( - this->heatTransferModels_[pair][pair.first()]->K(0) - ); - - volScalarField H2 - ( - this->heatTransferModels_[pair][pair.second()]->K(0) - ); - - Tf = saturationModel_->Tsat(phase1.thermo().p()); - - iDmdtNew = - (H1*(Tf - T1) + H2*(Tf - T2))/L; - - } - else - { - iDmdtNew == dimensionedScalar(dmdt.dimensions(), Zero); - } - - volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K()); - volScalarField H2(this->heatTransferModels_[pair][pair.second()]->K()); - - // Limit the H[12] boundary field to avoid /0 - const scalar HLimit = 1e-4; - H1.boundaryFieldRef() = - max(H1.boundaryField(), phase1.boundaryField()*HLimit); - H2.boundaryFieldRef() = - max(H2.boundaryField(), phase2.boundaryField()*HLimit); - - Tf = (H1*T1 + H2*T2 + iDmdtNew*L)/(H1 + H2); - - Info<< "Tf." << pair.name() - << ": min = " << min(Tf.primitiveField()) - << ", mean = " << average(Tf.primitiveField()) - << ", max = " << max(Tf.primitiveField()) - << endl; - - scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt")); - iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew; - - if (massTransfer_ ) - { - Info<< "iDmdt." << pair.name() - << ": min = " << min(iDmdt.primitiveField()) - << ", mean = " << average(iDmdt.primitiveField()) - << ", max = " << max(iDmdt.primitiveField()) - << ", integral = " << fvc::domainIntegrate(iDmdt).value() - << endl; - } - - // Accumulate dmdt contributions from boundaries - volScalarField wDmdt - ( - IOobject - ( - IOobject::groupName("wDmdt", pair.name()), - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE, - false - ), - this->mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ); - - const volScalarField* alphatPtr = - phase2.mesh().findObject<volScalarField> - ( - "alphat." + phase2.name() - ); - - if (alphatPtr) - { - const volScalarField& alphat = *alphatPtr; - - const fvPatchList& patches = this->mesh().boundary(); - forAll(patches, patchi) - { - const fvPatch& currPatch = patches[patchi]; - - if - ( - isA<alphatPhaseChangeWallFunction> - ( - alphat.boundaryField()[patchi] - ) - ) - { - const scalarField& patchDmdt = - refCast<const alphatPhaseChangeWallFunction> - ( - alphat.boundaryField()[patchi] - ).dmdt(); - - forAll(patchDmdt,facei) - { - label faceCelli = currPatch.faceCells()[facei]; - wDmdt[faceCelli] += patchDmdt[facei]; - } - } - } - - Info<< "wDmdt." << pair.name() - << ": min = " << min(wDmdt.primitiveField()) - << ", mean = " << average(wDmdt.primitiveField()) - << ", max = " << max(wDmdt.primitiveField()) - << ", integral = " << fvc::domainIntegrate(wDmdt).value() - << endl; - } - - dmdt = wDmdt + iDmdt; - - Info<< "dmdt." << pair.name() - << ": min = " << min(dmdt.primitiveField()) - << ", mean = " << average(dmdt.primitiveField()) - << ", max = " << max(dmdt.primitiveField()) - << ", integral = " << fvc::domainIntegrate(dmdt).value() - << endl; - } -} - - -template<class BasePhaseSystem> -bool Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::read() -{ - if (BasePhaseSystem::read()) - { - return true; - } - - return false; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H deleted file mode 100644 index d9265c8c5fcec682ae4425c4cebfd7b6cf23989c..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H +++ /dev/null @@ -1,377 +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::phaseSystem - -Description - Class to represent a system of phases and model interfacial transfers - between them. - -SourceFiles - phaseSystem.C - -\*---------------------------------------------------------------------------*/ - -#ifndef phaseSystem_H -#define phaseSystem_H - -#include "IOdictionary.H" - -#include "phaseModel.H" -#include "phasePair.H" -#include "orderedPhasePair.H" -#include "HashPtrTable.H" -#include "PtrListDictionary.H" - -#include "IOMRFZoneList.H" -#include "fvOptions.H" - -#include "volFields.H" -#include "surfaceFields.H" -#include "fvMatricesFwd.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class blendingMethod; -template<class modelType> class BlendedInterfacialModel; -class surfaceTensionModel; -class aspectRatioModel; - -/*---------------------------------------------------------------------------*\ - Class phaseSystem Declaration -\*---------------------------------------------------------------------------*/ - -class phaseSystem -: - public IOdictionary -{ -public: - - // Public typedefs - - typedef - HashPtrTable - < - volScalarField, - phasePairKey, - phasePairKey::hash - > - KdTable; - - typedef - HashPtrTable - < - volScalarField, - phasePairKey, - phasePairKey::hash - > - VmTable; - - typedef - HashPtrTable - < - fvVectorMatrix, - word, - string::hash - > - momentumTransferTable; - - typedef - HashPtrTable - < - fvScalarMatrix, - word, - string::hash - > - heatTransferTable; - - typedef - HashPtrTable - < - fvScalarMatrix, - word, - string::hash - > - massTransferTable; - - typedef PtrListDictionary<phaseModel> phaseModelList; - - -protected: - - // Protected typedefs - - typedef - HashTable<dictionary, phasePairKey, phasePairKey::hash> - dictTable; - - typedef - HashTable<autoPtr<phasePair>, phasePairKey, phasePairKey::hash> - phasePairTable; - - typedef - HashTable<autoPtr<blendingMethod>> - blendingMethodTable; - - typedef - HashTable - < - autoPtr<surfaceTensionModel>, - phasePairKey, - phasePairKey::hash - > - surfaceTensionModelTable; - - typedef - HashTable - < - autoPtr<aspectRatioModel>, - phasePairKey, - phasePairKey::hash - > - aspectRatioModelTable; - - - // Protected data - - //- Reference to the mesh - const fvMesh& mesh_; - - //- Phase models - phaseModelList phaseModels_; - - //- Phase pairs - phasePairTable phasePairs_; - - //- Total volumetric flux - surfaceScalarField phi_; - - //- Rate of change of pressure - volScalarField dpdt_; - - //- Optional MRF zones - IOMRFZoneList MRF_; - - //- Blending methods - blendingMethodTable blendingMethods_; - - - // Sub Models - - //- Surface tension models - surfaceTensionModelTable surfaceTensionModels_; - - //- Aspect ratio models - aspectRatioModelTable aspectRatioModels_; - - - // Protected member functions - - //- Calculate and return the mixture flux - tmp<surfaceScalarField> calcPhi - ( - const phaseModelList& phaseModels - ) const; - - //- Generate pairs - void generatePairs - ( - const dictTable& modelDicts - ); - - //- Generate pairs and sub-model tables - template<class modelType> - void createSubModels - ( - const dictTable& modelDicts, - HashTable - < - autoPtr<modelType>, - phasePairKey, - phasePairKey::hash - >& models - ); - - //- Generate pairs and sub-model tables - template<class modelType> - void generatePairsAndSubModels - ( - const word& modelName, - HashTable - < - autoPtr<modelType>, - phasePairKey, - phasePairKey::hash - >& models - ); - - //- Generate pairs and blended sub-model tables - template<class modelType> - void generatePairsAndSubModels - ( - const word& modelName, - HashTable - < - autoPtr<BlendedInterfacialModel<modelType>>, - phasePairKey, - phasePairKey::hash - >& models - ); - - //- Generate pairs and per-phase sub-model tables - template<class modelType> - void generatePairsAndSubModels - ( - const word& modelName, - HashTable - < - HashTable<autoPtr<modelType>>, - phasePairKey, - phasePairKey::hash - >& models - ); - - -public: - - //- Runtime type information - TypeName("phaseSystem"); - - //- Default name of the phase properties dictionary - static const word propertiesName; - - - // Constructors - - //- Construct from fvMesh - phaseSystem(const fvMesh& mesh); - - - //- Destructor - virtual ~phaseSystem(); - - - // Member Functions - - //- Constant access the mesh - inline const fvMesh& mesh() const; - - //- Constant access the phase models - inline const phaseModelList& phases() const; - - //- Access the phase models - inline phaseModelList& phases(); - - //- Constant access the phase pairs - inline const phasePairTable& phasePairs() const; - - //- Return the mixture density - tmp<volScalarField> rho() const; - - //- Return the mixture velocity - tmp<volVectorField> U() const; - - //- Constant access the mixture flux - inline const surfaceScalarField& phi() const; - - //- Access the mixture flux - inline surfaceScalarField& phi(); - - //- Constant access the rate of change of the pressure - inline const volScalarField& dpdt() const; - - //- Access the rate of change of the pressure - inline volScalarField& dpdt(); - - //- Return the aspect-ratio - tmp<volScalarField> E(const phasePairKey& key) const; - - //- Return the surface tension coefficient - tmp<volScalarField> sigma(const phasePairKey& key) const; - - //- Return MRF zones - inline const IOMRFZoneList& MRF() const; - - //- Optional FV-options - inline fv::options& fvOptions() const; - - //- Access a sub model between a phase pair - template<class modelType> - const modelType& lookupSubModel(const phasePair& key) const; - - //- Access a sub model between two phases - template<class modelType> - const modelType& lookupSubModel - ( - const phaseModel& dispersed, - const phaseModel& continuous - ) const; - - //- Solve for the phase fractions - virtual void solve(); - - //- Correct the fluid properties other than the thermo and turbulence - virtual void correct(); - - //- Correct the kinematics - virtual void correctKinematics(); - - //- Correct the thermodynamics - virtual void correctThermo(); - - //- Correct the turbulence - virtual void correctTurbulence(); - - //- Correct the energy transport e.g. alphat - virtual void correctEnergyTransport(); - - //- Read base phaseProperties dictionary - virtual bool read(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "phaseSystemI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "phaseSystemTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C deleted file mode 100644 index cdf6e4f73a0d5165eaa007aa3c4d6f4c109bef23..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C +++ /dev/null @@ -1,225 +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 "BlendedInterfacialModel.H" - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -template<class modelType> -void Foam::phaseSystem::createSubModels -( - const dictTable& modelDicts, - HashTable - < - autoPtr<modelType>, - phasePairKey, - phasePairKey::hash - >& models -) -{ - forAllConstIters(modelDicts, iter) - { - const phasePairKey& key = iter.key(); - - models.insert - ( - key, - modelType::New - ( - iter.val(), - phasePairs_[key]() - ) - ); - } -} - - -template<class modelType> -void Foam::phaseSystem::generatePairsAndSubModels -( - const word& modelName, - HashTable - < - autoPtr<modelType>, - phasePairKey, - phasePairKey::hash - >& models -) -{ - dictTable modelDicts(lookup(modelName)); - - generatePairs(modelDicts); - - createSubModels(modelDicts, models); -} - - -template<class modelType> -void Foam::phaseSystem::generatePairsAndSubModels -( - const word& modelName, - HashTable - < - autoPtr<BlendedInterfacialModel<modelType>>, - phasePairKey, - phasePairKey::hash - >& models -) -{ - typedef - HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash> - modelTypeTable; - - modelTypeTable tempModels; - generatePairsAndSubModels(modelName, tempModels); - - const blendingMethod& blending - ( - blendingMethods_.found(modelName) - ? *(blendingMethods_[modelName]) - : *(blendingMethods_["default"]) - ); - - autoPtr<modelType> noModel; - - forAllConstIters(tempModels, iter) - { - if (!iter().valid()) - { - continue; - } - - const phasePairKey key(iter.key().first(), iter.key().second()); - const phasePairKey key1In2(key.first(), key.second(), true); - const phasePairKey key2In1(key.second(), key.first(), true); - - models.insert - ( - key, - autoPtr<BlendedInterfacialModel<modelType>> - ( - new BlendedInterfacialModel<modelType> - ( - phaseModels_[key.first()], - phaseModels_[key.second()], - blending, - tempModels.found(key ) ? tempModels[key ] : noModel, - tempModels.found(key1In2) ? tempModels[key1In2] : noModel, - tempModels.found(key2In1) ? tempModels[key2In1] : noModel - ) - ) - ); - - if (!phasePairs_.found(key)) - { - phasePairs_.insert - ( - key, - autoPtr<phasePair> - ( - new phasePair - ( - phaseModels_[key.first()], - phaseModels_[key.second()] - ) - ) - ); - } - } -} - - -template<class modelType> -void Foam::phaseSystem::generatePairsAndSubModels -( - const word& modelName, - HashTable - < - HashTable<autoPtr<modelType>>, - phasePairKey, - phasePairKey::hash - >& models -) -{ - typedef - HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash> - modelTypeTable; - - for (const phaseModel& phase : phaseModels_) - { - modelTypeTable tempModels; - generatePairsAndSubModels - ( - IOobject::groupName(modelName, phase.name()), - tempModels - ); - - forAllConstIters(tempModels, tempModelIter) - { - const phasePairKey& key = tempModelIter.key(); - - if (!models.found(key)) - { - models.insert - ( - key, - HashTable<autoPtr<modelType>>() - ); - } - - models[tempModelIter.key()].insert - ( - phase.name(), - *tempModelIter - ); - } - } -} - -template<class modelType> -const modelType& Foam::phaseSystem::lookupSubModel(const phasePair& key) const -{ - return - mesh().lookupObject<modelType> - ( - IOobject::groupName(modelType::typeName, key.name()) - ); -} - - -template<class modelType> -const modelType& Foam::phaseSystem::lookupSubModel -( - const phaseModel& dispersed, - const phaseModel& continuous -) const -{ - return lookupSubModel<modelType>(orderedPhasePair(dispersed, continuous)); -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake index 5ad18fcf7095aafdc7e026f60e07e2284f097c3f..2471b6d55ab7eef9d59961f2d83b4f3d41ef8205 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake @@ -1,11 +1,9 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +cd ${0%/*} || exit 1 # Run from this directory -#------------------------------------------------------------------------------ +# Parse arguments for library compilation +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -wmake $targetType multiphaseSystem -wmake $targetType multiphaseCompressibleTurbulenceModels wmake $targetType #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/CourantNo.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/CourantNo.H index 78636757c1cdd9a9627527e24aadd88dfbf6f6a5..383ed6304aee024887218866ffb6711d0b2d2cda 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/CourantNo.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/CourantNo.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H index dc53815cf4173c948447e16c2f3b5a3d80abdc8b..22d875dce77ce6bc24f9b8a413992411e6089aa1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H @@ -7,32 +7,27 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++) phaseSystem::heatTransferTable& heatTransfer = heatTransferPtr(); - forAll(phases, phasei) + forAll(fluid.anisothermalPhases(), anisothermalPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.anisothermalPhases()[anisothermalPhasei]; const volScalarField& alpha = phase; const volScalarField& rho = phase.rho(); const volVectorField& U = phase.U(); - tmp<fvScalarMatrix> EEqn(phase.heEqn()); - - if (EEqn.valid()) - { - EEqn = - ( - EEqn - == - *heatTransfer[phase.name()] - + alpha*rho*(U&g) - + fvOptions(alpha, rho, phase.thermo().he()) - ); - - EEqn->relax(); - fvOptions.constrain(EEqn.ref()); - EEqn->solve(); - fvOptions.correct(phase.thermo().he()); - } + fvScalarMatrix EEqn + ( + phase.heEqn() + == + *heatTransfer[phase.name()] + + alpha*rho*(U&g) + + fvOptions(alpha, rho, phase.thermoRef().he()) + ); + + EEqn.relax(); + fvOptions.constrain(EEqn); + EEqn.solve(); + fvOptions.correct(phase.thermoRef().he()); } fluid.correctThermo(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options index e49d1e409bd924f79848f5501f8557f12f9c463e..e13ba154846b1a156d6808e2e689e9704c176fdd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options @@ -1,15 +1,17 @@ EXE_INC = \ - -ImultiphaseSystem/lnInclude \ - -I../phaseSystems/lnInclude \ - -I../interfacialModels/lnInclude \ - -I../interfacialCompositionModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialModels/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/turbulentFluidThermoModels/turbulentFluidFvPatchFields/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude EXE_LIBS = \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/YEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/YEqns.H index 4094e185af08d0cd0ecd9832d61c4eaddf828b11..73eb99dd8c7edaf5bd676711977c5c6227547fd4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/YEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/YEqns.H @@ -5,33 +5,26 @@ phaseSystem::massTransferTable& massTransfer(massTransferPtr()); - forAll(phases, phasei) + forAll(fluid.multiComponentPhases(), multiComponentPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.multiComponentPhases()[multiComponentPhasei]; - PtrList<volScalarField>& Y = phase.Y(); + UPtrList<volScalarField>& Y = phase.YActiveRef(); const volScalarField& alpha = phase; const volScalarField& rho = phase.rho(); forAll(Y, i) { - tmp<fvScalarMatrix> YiEqn(phase.YiEqn(Y[i])); + fvScalarMatrix YiEqn + ( + phase.YiEqn(Y[i]) + == + *massTransfer[Y[i].name()] + + fvOptions(alpha, rho, Y[i]) + ); - if (YiEqn.valid()) - { - YiEqn = - ( - YiEqn - == - *massTransfer[Y[i].name()] - + fvOptions(alpha, rho, Y[i]) - ); - - YiEqn->relax(); - YiEqn->solve(mesh.solver("Yi")); - } + YiEqn.relax(); + YiEqn.solve(mesh.solver("Yi")); } } - - fluid.massTransfer(); // updates interfacial mass flow rates } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H index 1fc5b19ca79b2428efad815482774125ee4a40b1..50f1ed519137e93d0587aa0b452a67cfd68b923f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H @@ -20,7 +20,7 @@ dimensionedScalar pMin #include "gh.H" -volScalarField& p = phases[0].thermo().p(); +volScalarField& p = phases[0].thermoRef().p(); Info<< "Reading field p_rgh\n" << endl; volScalarField p_rgh diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/UEqns.H index cf70a99e188a7418356c15cf4b73925576f754bd..bb439af80896cdff72af387a499bb196f31c6827 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/UEqns.H @@ -9,17 +9,17 @@ PtrList<fvVectorMatrix> UEqns(phases.size()); phaseSystem::momentumTransferTable& momentumTransfer(momentumTransferPtr()); - forAll(phases, phasei) + forAll(fluid.movingPhases(), movingPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.movingPhases()[movingPhasei]; const volScalarField& alpha = phase; const volScalarField& rho = phase.rho(); - volVectorField& U = phase.U(); + volVectorField& U = phase.URef(); UEqns.set ( - phasei, + phase.index(), new fvVectorMatrix ( phase.UEqn() @@ -29,8 +29,8 @@ PtrList<fvVectorMatrix> UEqns(phases.size()); ) ); - UEqns[phasei].relax(); - fvOptions.constrain(UEqns[phasei]); + UEqns[phase.index()].relax(); + fvOptions.constrain(UEqns[phase.index()]); fvOptions.correct(U); } } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H index 16a7a193580a0ae679fd0183de515fcec0ffcd28..5e488110b036eaf05630dbb4b06ea9ff2b26744b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H @@ -1,7 +1,5 @@ +// Face volume fractions PtrList<surfaceScalarField> alphafs(phases.size()); -PtrList<volScalarField> rAUs(phases.size()); -PtrList<surfaceScalarField> alpharAUfs(phases.size()); - forAll(phases, phasei) { phaseModel& phase = phases[phasei]; @@ -9,21 +7,37 @@ forAll(phases, phasei) alphafs.set(phasei, fvc::interpolate(alpha).ptr()); alphafs[phasei].rename("pEqn" + alphafs[phasei].name()); +} + +// Diagonal coefficients +PtrList<volScalarField> rAUs(phases.size()); +forAll(fluid.movingPhases(), movingPhasei) +{ + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + const volScalarField& alpha = phase; rAUs.set ( - phasei, + phase.index(), new volScalarField ( IOobject::groupName("rAU", phase.name()), 1.0 /( - UEqns[phasei].A() - + max(phase.residualAlpha() - alpha, scalar(0)) - *phase.rho()/runTime.deltaT() + UEqns[phase.index()].A() + + byDt(max(phase.residualAlpha() - alpha, scalar(0))*phase.rho()) ) ) ); +} +fluid.fillFields("rAU", dimTime/dimDensity, rAUs); + +// Phase diagonal coefficients +PtrList<surfaceScalarField> alpharAUfs(phases.size()); +forAll(phases, phasei) +{ + phaseModel& phase = phases[phasei]; + const volScalarField& alpha = phase; alpharAUfs.set ( @@ -34,127 +48,127 @@ forAll(phases, phasei) ); } -// Lift, wall-lubrication and turbulent diffusion fluxes -PtrList<surfaceScalarField> phiFs(phases.size()); +// Explicit force fluxes +PtrList<surfaceScalarField> phiFs(fluid.phiFs(rAUs)); + +// --- Pressure corrector loop +while (pimple.correct()) { - autoPtr<PtrList<volVectorField>> Fs = fluid.Fs(); + volScalarField rho("rho", fluid.rho()); - forAll(phases, phasei) + // Correct p_rgh for consistency with p and the updated densities + p_rgh = p - rho*gh; + + // Correct fixed-flux BCs to be consistent with the velocity BCs + forAll(fluid.movingPhases(), movingPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + MRF.correctBoundaryFlux(phase.U(), phase.phiRef()); + } + + // Combined buoyancy and force fluxes + PtrList<surfaceScalarField> phigFs(phases.size()); + { + const surfaceScalarField ghSnGradRho + ( + "ghSnGradRho", + ghf*fvc::snGrad(rho)*mesh.magSf() + ); - if (Fs().set(phasei)) + forAll(phases, phasei) { - phiFs.set + phaseModel& phase = phases[phasei]; + + phigFs.set ( phasei, - new surfaceScalarField ( - IOobject::groupName("phiF", phase.name()), - fvc::flux(rAUs[phasei]*Fs()[phasei]) - ) + alpharAUfs[phasei] + *( + ghSnGradRho + - (fvc::interpolate(phase.rho() - rho))*(g & mesh.Sf()) + - fluid.surfaceTension(phase)*mesh.magSf() + ) + ).ptr() ); - } - } -} -{ - autoPtr<PtrList<surfaceScalarField>> phiDs = fluid.phiDs(rAUs); - forAll(phases, phasei) - { - phaseModel& phase = phases[phasei]; - - if (phiDs().set(phasei)) - { if (phiFs.set(phasei)) { - phiFs[phasei] += phiDs()[phasei]; - } - else - { - phiFs.set - ( - phasei, - new surfaceScalarField - ( - IOobject::groupName("phiF", phase.name()), - phiDs()[phasei] - ) - ); + phigFs[phasei] += phiFs[phasei]; } } } -} - -// --- Pressure corrector loop -while (pimple.correct()) -{ - volScalarField rho("rho", fluid.rho()); - - // Correct p_rgh for consistency with p and the updated densities - p_rgh = p - rho*gh; + // Predicted velocities and fluxes for each phase PtrList<volVectorField> HbyAs(phases.size()); - - forAll(phases, phasei) + PtrList<surfaceScalarField> phiHbyAs(phases.size()); { - phaseModel& phase = phases[phasei]; - const volScalarField& alpha = phase; + // Correction force fluxes + PtrList<surfaceScalarField> ddtCorrByAs(fluid.ddtCorrByAs(rAUs)); - // Correct fixed-flux BCs to be consistent with the velocity BCs - MRF.correctBoundaryFlux(phase.U(), phase.phi()); + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + const volScalarField& alpha = phase; - HbyAs.set - ( - phasei, - new volVectorField + HbyAs.set ( - IOobject::groupName("HbyA", phase.name()), - phase.U() - ) - ); - - HbyAs[phasei] = - rAUs[phasei] - *( - UEqns[phasei].H() - + max(phase.residualAlpha() - alpha, scalar(0)) - *phase.rho()*phase.U().oldTime()/runTime.deltaT() + phase.index(), + new volVectorField + ( + IOobject::groupName("HbyA", phase.name()), + phase.U() + ) ); - } - - surfaceScalarField ghSnGradRho - ( - "ghSnGradRho", - ghf*fvc::snGrad(rho)*mesh.magSf() - ); - PtrList<surfaceScalarField> phigFs(phases.size()); - forAll(phases, phasei) - { - phaseModel& phase = phases[phasei]; + HbyAs[phase.index()] = + rAUs[phase.index()] + *( + UEqns[phase.index()].H() + + byDt + ( + max(phase.residualAlpha() - alpha, scalar(0)) + *phase.rho() + ) + *phase.U()().oldTime() + ); - phigFs.set - ( - phasei, + phiHbyAs.set ( - alpharAUfs[phasei] - *( - ghSnGradRho - - (fvc::interpolate(phase.rho() - rho))*(g & mesh.Sf()) - - fluid.surfaceTension(phase)*mesh.magSf() + phase.index(), + new surfaceScalarField + ( + IOobject::groupName("phiHbyA", phase.name()), + fvc::flux(HbyAs[phase.index()]) + - phigFs[phase.index()] + - ddtCorrByAs[phase.index()] ) - ).ptr() - ); + ); + } + } + fluid.fillFields("HbyA", dimVelocity, HbyAs); + fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs); - if (phiFs.set(phasei)) + // Add explicit drag forces and fluxes if not doing partial elimination + if (!partialElimination) + { + PtrList<volVectorField> KdUByAs(fluid.KdUByAs(rAUs)); + PtrList<surfaceScalarField> phiKdPhis(fluid.phiKdPhis(rAUs)); + + forAll(phases, phasei) { - phigFs[phasei] += phiFs[phasei]; + if (KdUByAs.set(phasei)) + { + HbyAs[phasei] -= KdUByAs[phasei]; + } + if (phiKdPhis.set(phasei)) + { + phiHbyAs[phasei] -= phiKdPhis[phasei]; + } } } - PtrList<surfaceScalarField> phiHbyAs(phases.size()); - + // Total predicted flux surfaceScalarField phiHbyA ( IOobject @@ -166,82 +180,26 @@ while (pimple.correct()) IOobject::AUTO_WRITE ), mesh, - dimensionedScalar(dimArea*dimVelocity, Zero) + dimensionedScalar("phiHbyA", dimArea*dimVelocity, 0) ); forAll(phases, phasei) { - phaseModel& phase = phases[phasei]; - const volScalarField& alpha = phase; - - // ddtPhiCorr filter -- only apply in pure(ish) phases - surfaceScalarField alphafBar - ( - fvc::interpolate(fvc::average(alphafs[phasei])) - ); - surfaceScalarField phiCorrCoeff(pos0(alphafBar - 0.99)); - - surfaceScalarField::Boundary& phiCorrCoeffBf = - phiCorrCoeff.boundaryFieldRef(); - - forAll(mesh.boundary(), patchi) - { - // Set ddtPhiCorr to 0 on non-coupled boundaries - if - ( - !mesh.boundary()[patchi].coupled() - || isA<cyclicAMIFvPatch>(mesh.boundary()[patchi]) - ) - { - phiCorrCoeffBf[patchi] = 0; - } - } + phiHbyA += alphafs[phasei]*phiHbyAs[phasei]; + } - phiHbyAs.set - ( - phasei, - new surfaceScalarField - ( - IOobject::groupName("phiHbyA", phase.name()), - fvc::flux(HbyAs[phasei]) - + phiCorrCoeff - *fvc::interpolate - ( - alpha.oldTime()*phase.rho()().oldTime()*rAUs[phasei] - ) - *( - MRF.absolute(phase.phi().oldTime()) - - fvc::flux(phase.U().oldTime()) - )/runTime.deltaT() - - phigFs[phasei] - ) - ); + // Add explicit drag fluxes if doing partial elimination + if (partialElimination) + { + PtrList<surfaceScalarField> phiKdPhis(fluid.phiKdPhis(rAUs)); - forAllConstIters(fluid.Kds(), KdIter) + forAll(phases, phasei) { - const volScalarField& K(*KdIter()); - - const phasePair& pair = *(fluid.phasePairs()[KdIter.key()]); - - const phaseModel* phase1 = &pair.phase1(); - const phaseModel* phase2 = &pair.phase2(); - - forAllConstIters(pair, iter) + if (phiKdPhis.set(phasei)) { - if (phase1 == &phase) - { - phiHbyAs[phasei] += - fvc::interpolate(rAUs[phasei]*K) - *MRF.absolute(phase2->phi()); - - HbyAs[phasei] += rAUs[phasei]*K*phase2->U(); - } - - Swap(phase1, phase2); + phiHbyA -= alphafs[phasei]*phiKdPhis[phasei]; } } - - phiHbyA += alphafs[phasei]*phiHbyAs[phasei]; } MRF.makeRelative(phiHbyA); @@ -256,15 +214,15 @@ while (pimple.correct()) mesh ), mesh, - dimensionedScalar(dimensionSet(-1, 3, 1, 0, 0), Zero) + dimensionedScalar("rAUf", dimensionSet(-1, 3, 1, 0, 0), 0) ); forAll(phases, phasei) { rAUf += alphafs[phasei]*alpharAUfs[phasei]; } - rAUf = mag(rAUf); + rAUf = mag(rAUf); // Update the fixedFluxPressure BCs to ensure flux consistency { @@ -273,7 +231,8 @@ while (pimple.correct()) forAll(phases, phasei) { phaseModel& phase = phases[phasei]; - phib += alphafs[phasei].boundaryField()*phase.phi().boundaryField(); + phib += + alphafs[phasei].boundaryField()*phase.phi()().boundaryField(); } setSnGrad<fixedFluxPressureFvPatchScalarField> @@ -285,12 +244,14 @@ while (pimple.correct()) ); } + // Compressible pressure equations PtrList<fvScalarMatrix> pEqnComps(phases.size()); + PtrList<volScalarField> dmdts(fluid.dmdts()); forAll(phases, phasei) { phaseModel& phase = phases[phasei]; const volScalarField& alpha = phase; - volScalarField& rho = phase.thermo().rho(); + volScalarField& rho = phase.thermoRef().rho(); if (phase.compressible()) { @@ -307,7 +268,7 @@ while (pimple.correct()) phasei, ( ( - phase.continuityError() + fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()) - fvc::Sp ( fvc::ddt(alpha) + fvc::div(phase.alphaPhi()), @@ -335,7 +296,7 @@ while (pimple.correct()) phasei, ( ( - phase.continuityError() + fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()) - fvc::Sp ( (fvc::ddt(alpha) + fvc::div(phase.alphaPhi())), @@ -348,27 +309,38 @@ while (pimple.correct()) ); } } - else + + // Add option sources + if (fvOptions.appliesToField(rho.name())) { - pEqnComps.set - ( - phasei, - fvm::Su(-(fvOptions(alpha, rho)&rho)/rho, p_rgh).ptr() - ); + tmp<fvScalarMatrix> optEqn = fvOptions(alpha, rho); + if (pEqnComps.set(phasei)) + { + pEqnComps[phasei] -= (optEqn&rho)/rho; + } + else + { + pEqnComps.set + ( + phasei, + fvm::Su(- (optEqn&rho)/rho, p_rgh).ptr() + ); + } } - if (fluid.transfersMass(phase)) + // Add mass transfer + if (dmdts.set(phasei)) { if (pEqnComps.set(phasei)) { - pEqnComps[phasei] -= fluid.dmdt(phase)/rho; + pEqnComps[phasei] -= dmdts[phasei]/rho; } else { pEqnComps.set ( phasei, - fvm::Su(-fluid.dmdt(phase)/rho, p_rgh) + fvm::Su(- dmdts[phasei]/rho, p_rgh) ); } } @@ -412,16 +384,18 @@ while (pimple.correct()) surfaceScalarField mSfGradp("mSfGradp", pEqnIncomp.flux()/rAUf); - forAll(phases, phasei) + forAll(fluid.movingPhases(), movingPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.movingPhases()[movingPhasei]; - phase.phi() = phiHbyAs[phasei] + alpharAUfs[phasei]*mSfGradp; + phase.phiRef() = + phiHbyAs[phase.index()] + + alpharAUfs[phase.index()]*mSfGradp; // Set the phase dilatation rates - if (pEqnComps.set(phasei)) + if (pEqnComps.set(phase.index())) { - phase.divU(-pEqnComps[phasei] & p_rgh); + phase.divU(-pEqnComps[phase.index()] & p_rgh); } } @@ -430,19 +404,30 @@ while (pimple.correct()) mSfGradp = pEqnIncomp.flux()/rAUf; - forAll(phases, phasei) + forAll(fluid.movingPhases(), movingPhasei) { - phaseModel& phase = phases[phasei]; + phaseModel& phase = fluid.movingPhases()[movingPhasei]; - phase.U() = - HbyAs[phasei] + phase.URef() = + HbyAs[phase.index()] + fvc::reconstruct ( - alpharAUfs[phasei]*mSfGradp - - phigFs[phasei] + alpharAUfs[phase.index()]*mSfGradp + - phigFs[phase.index()] ); - phase.U().correctBoundaryConditions(); - fvOptions.correct(phase.U()); + } + + if (partialElimination) + { + fluid.partialElimination(rAUs); + } + + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + phase.URef().correctBoundaryConditions(); + fvOptions.correct(phase.URef()); } } } @@ -457,7 +442,7 @@ while (pimple.correct()) forAll(phases, phasei) { phaseModel& phase = phases[phasei]; - phase.thermo().rho() += phase.thermo().psi()*(p_rgh - p_rgh_0); + phase.thermoRef().rho() += phase.thermo().psi()*(p_rgh - p_rgh_0); } // Correct p_rgh for consistency with p and the updated densities diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H new file mode 100644 index 0000000000000000000000000000000000000000..cf72498e990996b8bd4e8d142f6b3b82e1198011 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/UEqns.H @@ -0,0 +1,40 @@ +Info<< "Constructing face momentum equations" << endl; + +PtrList<fvVectorMatrix> UEqns(phases.size()); + +{ + fluid.momentumTransfer(); // !!! Update coefficients shouldn't be necessary + // This should be done on demand + + autoPtr<phaseSystem::momentumTransferTable> + momentumTransferPtr(fluid.momentumTransferf()); + + phaseSystem::momentumTransferTable& + momentumTransfer(momentumTransferPtr()); + + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + const volScalarField& alpha = phase; + const volScalarField& rho = phase.rho(); + volVectorField& U = phase.URef(); + + UEqns.set + ( + phase.index(), + new fvVectorMatrix + ( + phase.UfEqn() + == + *momentumTransfer[phase.name()] + + fvOptions(alpha, rho, U) + ) + ); + + UEqns[phase.index()].relax(); + fvOptions.constrain(UEqns[phase.index()]); + U.correctBoundaryConditions(); + fvOptions.correct(U); + } +} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..98da1ded9ba46e3019b710d3180cb0906f64c3bc --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pUf/pEqn.H @@ -0,0 +1,428 @@ +// Face volume fractions +PtrList<surfaceScalarField> alphafs(phases.size()); +PtrList<surfaceScalarField> alphaRho0fs(phases.size()); +forAll(phases, phasei) +{ + phaseModel& phase = phases[phasei]; + const volScalarField& alpha = phase; + + alphafs.set(phasei, fvc::interpolate(alpha).ptr()); + alphafs[phasei].rename("pEqn" + alphafs[phasei].name()); + + alphaRho0fs.set + ( + phasei, + ( + fvc::interpolate + ( + max(alpha.oldTime(), phase.residualAlpha()) + *phase.rho()().oldTime() + ) + ).ptr() + ); +} + +// Diagonal coefficients +PtrList<surfaceScalarField> rAUfs(phases.size()); +{ + PtrList<surfaceScalarField> AFfs(fluid.AFfs()); + + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + rAUfs.set + ( + phase.index(), + new surfaceScalarField + ( + IOobject::groupName("rAUf", phase.name()), + 1.0 + /( + byDt(alphaRho0fs[phase.index()]) + + fvc::interpolate(UEqns[phase.index()].A()) + + AFfs[phase.index()] + ) + ) + ); + } +} +fluid.fillFields("rAUf", dimTime/dimDensity, rAUfs); + +// Phase diagonal coefficients +PtrList<surfaceScalarField> alpharAUfs(phases.size()); +forAll(phases, phasei) +{ + phaseModel& phase = phases[phasei]; + alpharAUfs.set + ( + phase.index(), + ( + max(alphafs[phase.index()], phase.residualAlpha()) + *rAUfs[phase.index()] + ).ptr() + ); +} + +// Explicit force fluxes +PtrList<surfaceScalarField> phiFfs(fluid.phiFfs(rAUfs)); + +// --- Pressure corrector loop +while (pimple.correct()) +{ + volScalarField rho("rho", fluid.rho()); + + // Correct p_rgh for consistency with p and the updated densities + p_rgh = p - rho*gh; + + // Correct fixed-flux BCs to be consistent with the velocity BCs + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + MRF.correctBoundaryFlux(phase.U(), phase.phiRef()); + } + + // Combined buoyancy and force fluxes + PtrList<surfaceScalarField> phigFs(phases.size()); + { + const surfaceScalarField ghSnGradRho + ( + "ghSnGradRho", + ghf*fvc::snGrad(rho)*mesh.magSf() + ); + + forAll(phases, phasei) + { + phaseModel& phase = phases[phasei]; + + phigFs.set + ( + phasei, + ( + alpharAUfs[phasei] + *( + ghSnGradRho + - (fvc::interpolate(phase.rho() - rho))*(g & mesh.Sf()) + - fluid.surfaceTension(phase)*mesh.magSf() + ) + ).ptr() + ); + + if (phiFfs.set(phasei)) + { + phigFs[phasei] += phiFfs[phasei]; + } + } + } + + // Predicted fluxes for each phase + PtrList<surfaceScalarField> phiHbyAs(phases.size()); + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + phiHbyAs.set + ( + phase.index(), + new surfaceScalarField + ( + IOobject::groupName("phiHbyA", phase.name()), + rAUfs[phase.index()] + *( + fvc::flux(UEqns[phase.index()].H()) + + alphaRho0fs[phase.index()] + *byDt(MRF.absolute(phase.phi()().oldTime())) + ) + - phigFs[phase.index()] + ) + ); + } + fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs); + + // Add explicit drag forces and fluxes if not doing partial elimination + if (!partialElimination) + { + PtrList<surfaceScalarField> phiKdPhifs(fluid.phiKdPhifs(rAUfs)); + + forAll(phases, phasei) + { + if (phiKdPhifs.set(phasei)) + { + phiHbyAs[phasei] -= phiKdPhifs[phasei]; + } + } + } + + // Total predicted flux + surfaceScalarField phiHbyA + ( + IOobject + ( + "phiHbyA", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("phiHbyA", dimArea*dimVelocity, 0) + ); + + forAll(phases, phasei) + { + phiHbyA += alphafs[phasei]*phiHbyAs[phasei]; + } + + // Add explicit drag fluxes if doing partial elimination + if (partialElimination) + { + PtrList<surfaceScalarField> phiKdPhifs(fluid.phiKdPhifs(rAUfs)); + + forAll(phases, phasei) + { + if (phiKdPhifs.set(phasei)) + { + phiHbyA -= alphafs[phasei]*phiKdPhifs[phasei]; + } + } + } + + MRF.makeRelative(phiHbyA); + + // Construct pressure "diffusivity" + surfaceScalarField rAUf + ( + IOobject + ( + "rAUf", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("rAUf", dimensionSet(-1, 3, 1, 0, 0), 0) + ); + + forAll(phases, phasei) + { + rAUf += alphafs[phasei]*alpharAUfs[phasei]; + } + + rAUf = mag(rAUf); + + // Update the fixedFluxPressure BCs to ensure flux consistency + { + surfaceScalarField::Boundary phib(phi.boundaryField()); + phib = 0; + forAll(phases, phasei) + { + phaseModel& phase = phases[phasei]; + phib += + alphafs[phasei].boundaryField()*phase.phi()().boundaryField(); + } + + setSnGrad<fixedFluxPressureFvPatchScalarField> + ( + p_rgh.boundaryFieldRef(), + ( + phiHbyA.boundaryField() - phib + )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) + ); + } + + // Compressible pressure equations + PtrList<fvScalarMatrix> pEqnComps(phases.size()); + PtrList<volScalarField> dmdts(fluid.dmdts()); + forAll(phases, phasei) + { + phaseModel& phase = phases[phasei]; + const volScalarField& alpha = phase; + volScalarField& rho = phase.thermoRef().rho(); + + if (phase.compressible()) + { + if (pimple.transonic()) + { + surfaceScalarField phid + ( + IOobject::groupName("phid", phase.name()), + fvc::interpolate(phase.thermo().psi())*phase.phi() + ); + + pEqnComps.set + ( + phasei, + ( + ( + fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()) + - fvc::Sp + ( + fvc::ddt(alpha) + fvc::div(phase.alphaPhi()), + rho + ) + )/rho + + correction + ( + (alpha/rho)* + ( + phase.thermo().psi()*fvm::ddt(p_rgh) + + fvm::div(phid, p_rgh) + - fvm::Sp(fvc::div(phid), p_rgh) + ) + ) + ).ptr() + ); + + deleteDemandDrivenData + ( + pEqnComps[phasei].faceFluxCorrectionPtr() + ); + + pEqnComps[phasei].relax(); + } + else + { + pEqnComps.set + ( + phasei, + ( + ( + fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()) + - fvc::Sp + ( + (fvc::ddt(alpha) + fvc::div(phase.alphaPhi())), + rho + ) + )/rho + + (alpha*phase.thermo().psi()/rho) + *correction(fvm::ddt(p_rgh)) + ).ptr() + ); + } + } + + if (fvOptions.appliesToField(rho.name())) + { + tmp<fvScalarMatrix> optEqn = fvOptions(alpha, rho); + if (pEqnComps.set(phasei)) + { + pEqnComps[phasei] -= (optEqn&rho)/rho; + } + else + { + pEqnComps.set + ( + phasei, + fvm::Su(- (optEqn&rho)/rho, p_rgh).ptr() + ); + } + } + + if (dmdts.set(phasei)) + { + if (pEqnComps.set(phasei)) + { + pEqnComps[phasei] -= dmdts[phasei]/rho; + } + else + { + pEqnComps.set + ( + phasei, + fvm::Su(- dmdts[phasei]/rho, p_rgh) + ); + } + } + } + + // Cache p prior to solve for density update + volScalarField p_rgh_0(p_rgh); + + // Iterate over the pressure equation to correct for non-orthogonality + while (pimple.correctNonOrthogonal()) + { + // Construct the transport part of the pressure equation + fvScalarMatrix pEqnIncomp + ( + fvc::div(phiHbyA) + - fvm::laplacian(rAUf, p_rgh) + ); + + { + fvScalarMatrix pEqn(pEqnIncomp); + + forAll(phases, phasei) + { + if (pEqnComps.set(phasei)) + { + pEqn += pEqnComps[phasei]; + } + } + + solve + ( + pEqn, + mesh.solver(p_rgh.select(pimple.finalInnerIter())) + ); + } + + // Correct fluxes and velocities on last non-orthogonal iteration + if (pimple.finalNonOrthogonalIter()) + { + phi = phiHbyA + pEqnIncomp.flux(); + + surfaceScalarField mSfGradp("mSfGradp", pEqnIncomp.flux()/rAUf); + + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + phase.phiRef() = + phiHbyAs[phase.index()] + + alpharAUfs[phase.index()]*mSfGradp; + + // Set the phase dilatation rates + if (pEqnComps.set(phase.index())) + { + phase.divU(-pEqnComps[phase.index()] & p_rgh); + } + } + + if (partialElimination) + { + fluid.partialEliminationf(rAUfs); + } + + // Optionally relax pressure for velocity correction + p_rgh.relax(); + + mSfGradp = pEqnIncomp.flux()/rAUf; + + forAll(fluid.movingPhases(), movingPhasei) + { + phaseModel& phase = fluid.movingPhases()[movingPhasei]; + + phase.URef() = fvc::reconstruct(MRF.absolute(phase.phi())); + phase.URef().correctBoundaryConditions(); + fvOptions.correct(phase.URef()); + } + } + } + + // Update and limit the static pressure + p = max(p_rgh + rho*gh, pMin); + + // Limit p_rgh + p_rgh = p - rho*gh; + + // Update densities from change in p_rgh + forAll(phases, phasei) + { + phaseModel& phase = phases[phasei]; + phase.thermoRef().rho() += phase.thermo().psi()*(p_rgh - p_rgh_0); + } + + // Correct p_rgh for consistency with p and the updated densities + rho = fluid.rho(); + p_rgh = p - rho*gh; + p_rgh.correctBoundaryConditions(); +} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C index 6329b0cbc36a8eeca61ac20ee384bd341065f17c..27d86efc6fa9bec4e435b0f42e9e93123e45778a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,9 +26,6 @@ License Application reactingMultiphaseEulerFoam -Group - grpMultiphaseSolvers - Description Solver for a system of any number of compressible fluid phases with a common pressure, but otherwise separate properties. The type of phase model @@ -40,6 +37,7 @@ Description #include "fvCFD.H" #include "multiphaseSystem.H" +#include "phaseCompressibleTurbulenceModel.H" #include "pimpleControl.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" @@ -48,16 +46,10 @@ Description int main(int argc, char *argv[]) { - argList::addNote - ( - "Solver for a system of any number of compressible fluid phases with a" - " common pressure, but otherwise separate properties." - ); - #include "postProcess.H" #include "addCheckCaseOptions.H" - #include "setRootCaseLists.H" + #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createControl.H" @@ -71,20 +63,14 @@ int main(int argc, char *argv[]) #include "setInitialDeltaT.H" } - // bool faceMomentum - // ( - // pimple.dict().lookupOrDefault("faceMomentum", false) - // ); - - // bool implicitPhasePressure - // ( - // mesh.solverDict(alpha1.name()).lookupOrDefault - // ( - // "implicitPhasePressure", false - // ) - // ); - - //#include "pUf/createDDtU.H" + Switch faceMomentum + ( + pimple.dict().lookupOrDefault<Switch>("faceMomentum", false) + ); + Switch partialElimination + ( + pimple.dict().lookupOrDefault<Switch>("partialElimination", false) + ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -109,7 +95,7 @@ int main(int argc, char *argv[]) #include "setDeltaT.H" } - ++runTime; + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; // --- Pressure-velocity PIMPLE corrector loop @@ -120,14 +106,13 @@ int main(int argc, char *argv[]) #include "YEqns.H" - // if (faceMomentum) - // { - // #include "pUf/UEqns.H" - // #include "EEqns.H" - // #include "pUf/pEqn.H" - // #include "pUf/DDtU.H" - // } - // else + if (faceMomentum) + { + #include "pUf/UEqns.H" + #include "EEqns.H" + #include "pUf/pEqn.H" + } + else { #include "pU/UEqns.H" #include "EEqns.H" @@ -144,7 +129,9 @@ int main(int argc, char *argv[]) runTime.write(); - runTime.printExecutionTime(Info); + Info<< "ExecutionTime = " + << runTime.elapsedCpuTime() + << " s\n\n" << endl; } Info<< "End\n" << endl; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean index 2d0f2fde9e7a254d7b7e5eda3cb599fea8e5243e..e74b99935d9510ea5acb7de3405107636f133fe7 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean @@ -1,8 +1,6 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -wclean libso twoPhaseSystem -wclean libso twoPhaseCompressibleTurbulenceModels wclean #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake index ffbeaacbfdbd7267c4f3c4677688aa66258d7b54..ecb7039b93a994de65d349fce9bea25d936eea56 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake @@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory #------------------------------------------------------------------------------ -wmake $targetType twoPhaseSystem -wmake $targetType twoPhaseCompressibleTurbulenceModels wmake $targetType #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H index 246bea1fb4da0ff81d918201e033fc079b2d0fa2..5dfc536aaddf4ec1beef94c6084b8ef662fd5678 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H @@ -8,46 +8,38 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++) phaseSystem::heatTransferTable& heatTransfer = heatTransferPtr(); + if (!phase1.isothermal()) { - tmp<fvScalarMatrix> E1Eqn(phase1.heEqn()); - - if (E1Eqn.valid()) - { - E1Eqn = - ( - E1Eqn - == - *heatTransfer[phase1.name()] - + alpha1*rho1*(U1&g) - + fvOptions(alpha1, rho1, phase1.thermo().he()) - ); - - E1Eqn->relax(); - fvOptions.constrain(E1Eqn.ref()); - E1Eqn->solve(); - fvOptions.correct(phase1.thermo().he()); - } + fvScalarMatrix E1Eqn + ( + phase1.heEqn() + == + *heatTransfer[phase1.name()] + + alpha1*rho1*(U1&g) + + fvOptions(alpha1, rho1, thermo1.he()) + ); + + E1Eqn.relax(); + fvOptions.constrain(E1Eqn); + E1Eqn.solve(); + fvOptions.correct(thermo1.he()); } + if (!phase2.isothermal()) { - tmp<fvScalarMatrix> E2Eqn(phase2.heEqn()); - - if (E2Eqn.valid()) - { - E2Eqn = - ( - E2Eqn - == - *heatTransfer[phase2.name()] - + alpha2*rho2*(U2&g) - + fvOptions(alpha2, rho2, phase2.thermo().he()) - ); - - E2Eqn->relax(); - fvOptions.constrain(E2Eqn.ref()); - E2Eqn->solve(); - fvOptions.correct(phase2.thermo().he()); - } + fvScalarMatrix E2Eqn + ( + phase2.heEqn() + == + *heatTransfer[phase2.name()] + + alpha2*rho2*(U2&g) + + fvOptions(alpha2, rho2, phase2.thermoRef().he()) + ); + + E2Eqn.relax(); + fvOptions.constrain(E2Eqn); + E2Eqn.solve(); + fvOptions.correct(thermo2.he()); } fluid.correctThermo(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options index 6aef4dd2f7a52d15d951e65326a7e34a69bbca1f..81c44f8898a427de4b5eedbad2b6cb2c9e1e88ad 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options @@ -1,12 +1,12 @@ EXE_INC = \ - -ItwoPhaseSystem/lnInclude \ - -I../phaseSystems/lnInclude \ - -I../interfacialModels/lnInclude \ - -I../interfacialCompositionModels/lnInclude \ - -ItwoPhaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialModels/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/YEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/YEqns.H index 176f491f372912615197bb9f1d23b6581598ac93..ba1ee2328d7f3fb2c5e3f8e8949d649a15a7bc82 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/YEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/YEqns.H @@ -5,46 +5,41 @@ phaseSystem::massTransferTable& massTransfer(massTransferPtr()); - PtrList<volScalarField>& Y1 = phase1.Y(); - PtrList<volScalarField>& Y2 = phase2.Y(); - - forAll(Y1, i) + if (!phase1.pure()) { - tmp<fvScalarMatrix> Y1iEqn(phase1.YiEqn(Y1[i])); + UPtrList<volScalarField>& Y1 = phase1.YActiveRef(); - if (Y1iEqn.valid()) + forAll(Y1, i) { - Y1iEqn = + fvScalarMatrix Y1iEqn ( - Y1iEqn + phase1.YiEqn(Y1[i]) == - *massTransfer[Y1[i].name()] - + fvOptions(alpha1, rho1, Y1[i]) + *massTransfer[Y1[i].name()] + + fvOptions(alpha1, rho1, Y1[i]) ); - Y1iEqn->relax(); - Y1iEqn->solve(mesh.solver("Yi")); + Y1iEqn.relax(); + Y1iEqn.solve(mesh.solver("Yi")); } } - forAll(Y2, i) + if (!phase2.pure()) { - tmp<fvScalarMatrix> Y2iEqn(phase2.YiEqn(Y2[i])); + UPtrList<volScalarField>& Y2 = phase2.YActiveRef(); - if (Y2iEqn.valid()) + forAll(Y2, i) { - Y2iEqn = + fvScalarMatrix Y2iEqn ( - Y2iEqn + phase2.YiEqn(Y2[i]) == *massTransfer[Y2[i].name()] + fvOptions(alpha2, rho2, Y2[i]) ); - Y2iEqn->relax(); - Y2iEqn->solve(mesh.solver("Yi")); + Y2iEqn.relax(); + Y2iEqn.solve(mesh.solver("Yi")); } } - - fluid.massTransfer(); // updates interfacial mass flow rates } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFieldRefs.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFieldRefs.H index 96cbabfe8e43d4223d6abee6312eee704b15f91c..edad54fa18c15af65171cbefbe03a2b2c11433b5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFieldRefs.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFieldRefs.H @@ -1,22 +1,21 @@ phaseModel& phase1 = fluid.phase1(); phaseModel& phase2 = fluid.phase2(); -volScalarField& alpha1 = phase1; -volScalarField& alpha2 = phase2; - -volVectorField& U1 = phase1.U(); -surfaceScalarField& phi1 = phase1.phi(); -surfaceScalarField& alphaPhi1 = phase1.alphaPhi(); -surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi(); - -volVectorField& U2 = phase2.U(); -surfaceScalarField& phi2 = phase2.phi(); -surfaceScalarField& alphaPhi2 = phase2.alphaPhi(); -surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi(); +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.thermo(); -rhoThermo& thermo2 = phase2.thermo(); +rhoThermo& thermo1 = phase1.thermoRef(); +rhoThermo& thermo2 = phase2.thermoRef(); volScalarField& rho1 = thermo1.rho(); const volScalarField& psi1 = thermo1.psi(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H index 697269ff40dd670a0e64176bbd3c8e7e345b26e4..df7c20a798bbc3663575aee20c06e4058fdd2b20 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H @@ -19,7 +19,7 @@ dimensionedScalar pMin #include "gh.H" -volScalarField& p = fluid.phase1().thermo().p(); +volScalarField& p = fluid.phase1().thermoRef().p(); Info<< "Reading field p_rgh\n" << endl; volScalarField p_rgh diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H index 93c6e3b58976241fc589e7c0aede56d17e7c182e..9ffc0daba4d60c35bff2fc7b8401458d41e89883 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H @@ -1,82 +1,54 @@ -surfaceScalarField alphaf1("alphaf1", fvc::interpolate(alpha1)); -surfaceScalarField alphaf2("alphaf2", scalar(1) - alphaf1); +const surfaceScalarField alphaf1("alphaf1", fvc::interpolate(alpha1)); +const surfaceScalarField alphaf2("alphaf2", scalar(1) - alphaf1); -volScalarField rAU1 +PtrList<volScalarField> rAUs; +rAUs.append ( - IOobject::groupName("rAU", phase1.name()), - 1.0 - /( - U1Eqn.A() - + byDt(max(phase1.residualAlpha() - alpha1, scalar(0))*rho1) + new volScalarField + ( + IOobject::groupName("rAU", phase1.name()), + 1.0 + /( + U1Eqn.A() + + byDt(max(phase1.residualAlpha() - alpha1, scalar(0))*rho1) + ) ) ); -volScalarField rAU2 +rAUs.append ( - IOobject::groupName("rAU", phase2.name()), - 1.0 - /( - U2Eqn.A() - + byDt(max(phase2.residualAlpha() - alpha2, scalar(0))*rho2) + new volScalarField + ( + IOobject::groupName("rAU", phase2.name()), + 1.0 + /( + U2Eqn.A() + + byDt(max(phase2.residualAlpha() - alpha2, scalar(0))*rho2) + ) ) ); +const volScalarField& rAU1 = rAUs[0]; +const volScalarField& rAU2 = rAUs[1]; -surfaceScalarField alpharAUf1 +const surfaceScalarField alpharAUf1 ( fvc::interpolate(max(alpha1, phase1.residualAlpha())*rAU1) ); -surfaceScalarField alpharAUf2 +const surfaceScalarField alpharAUf2 ( fvc::interpolate(max(alpha2, phase2.residualAlpha())*rAU2) ); -volScalarField Kd(fluid.Kd()); - -// Turbulent diffusion, particle-pressure, lift and wall-lubrication fluxes -tmp<surfaceScalarField> phiF1; -tmp<surfaceScalarField> phiF2; -{ - // Turbulent-dispersion diffusivity - volScalarField D(fluid.D()); - - // Phase-1 turbulent dispersion and particle-pressure flux - tmp<surfaceScalarField> DbyA1 - ( - fvc::interpolate - ( - rAU1*(D + phase1.turbulence().pPrime()) - ) - ); - - // Phase-2 turbulent dispersion and particle-pressure flux - tmp<surfaceScalarField> DbyA2 - ( - fvc::interpolate - ( - rAU2*(D + phase2.turbulence().pPrime()) - ) - ); - - // Lift and wall-lubrication forces - volVectorField F(fluid.F()); - - // Phase-fraction face-gradient - surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1)*mesh.magSf()); - - // Phase-1 dispersion, lift and wall-lubrication flux - phiF1 = DbyA1()*snGradAlpha1 + fvc::flux(rAU1*F); - - // Phase-2 dispersion, lift and wall-lubrication flux - phiF2 = - DbyA2()*snGradAlpha1 - fvc::flux(rAU2*F); - - // Cache the phase diffusivities for implicit treatment in the - // phase-fraction equation - if (implicitPhasePressure) - { - phase1.DbyA(DbyA1); - phase2.DbyA(DbyA2); - } -} +// Drag coefficients +const volScalarField Kd(fluid.Kd()); +const volScalarField rAUKd1(rAU1*Kd); +const volScalarField rAUKd2(rAU2*Kd); +const surfaceScalarField phiKd1(fvc::interpolate(rAUKd1)); +const surfaceScalarField phiKd2(fvc::interpolate(rAUKd2)); +// Explicit force fluxes +PtrList<surfaceScalarField> phiFs(fluid.phiFs(rAUs)); +const surfaceScalarField& phiF1 = phiFs[0]; +const surfaceScalarField& phiF2 = phiFs[1]; // --- Pressure corrector loop while (pimple.correct()) @@ -90,6 +62,34 @@ while (pimple.correct()) MRF.correctBoundaryFlux(U1, phi1); MRF.correctBoundaryFlux(U2, phi2); + // Combined buoyancy and force fluxes + const surfaceScalarField ghSnGradRho + ( + "ghSnGradRho", + ghf*fvc::snGrad(rho)*mesh.magSf() + ); + + const surfaceScalarField phigF1 + ( + alpharAUf1 + *( + ghSnGradRho + - alphaf2*fvc::interpolate(rho1 - rho2)*(g & mesh.Sf()) + ) + + phiF1 + ); + + const surfaceScalarField phigF2 + ( + alpharAUf2 + *( + ghSnGradRho + - alphaf1*fvc::interpolate(rho2 - rho1)*(g & mesh.Sf()) + ) + + phiF2 + ); + + // Predicted velocities volVectorField HbyA1 ( IOobject::groupName("HbyA", phase1.name()), @@ -116,98 +116,42 @@ while (pimple.correct()) *U2.oldTime() ); - surfaceScalarField ghSnGradRho - ( - "ghSnGradRho", - ghf*fvc::snGrad(rho)*mesh.magSf() - ); + // Correction force fluxes + PtrList<surfaceScalarField> ddtCorrByAs(fluid.ddtCorrByAs(rAUs)); - surfaceScalarField phig1 - ( - alpharAUf1 - *( - ghSnGradRho - - alphaf2*fvc::interpolate(rho1 - rho2)*(g & mesh.Sf()) - ) - ); - - surfaceScalarField phig2 - ( - alpharAUf2 - *( - ghSnGradRho - - alphaf1*fvc::interpolate(rho2 - rho1)*(g & mesh.Sf()) - ) - ); - - - // ddtPhiCorr filter -- only apply in pure(ish) phases - surfaceScalarField alphaf1Bar(fvc::interpolate(fvc::average(alphaf1))); - surfaceScalarField phiCorrCoeff1(pos0(alphaf1Bar - 0.99)); - surfaceScalarField phiCorrCoeff2(pos0(0.01 - alphaf1Bar)); - - { - surfaceScalarField::Boundary& phiCorrCoeff1Bf = - phiCorrCoeff1.boundaryFieldRef(); - - surfaceScalarField::Boundary& phiCorrCoeff2Bf = - phiCorrCoeff2.boundaryFieldRef(); - - forAll(mesh.boundary(), patchi) - { - // Set ddtPhiCorr to 0 on non-coupled boundaries - if - ( - !mesh.boundary()[patchi].coupled() - || isA<cyclicAMIFvPatch>(mesh.boundary()[patchi]) - ) - { - phiCorrCoeff1Bf[patchi] = 0; - phiCorrCoeff2Bf[patchi] = 0; - } - } - } - - // Phase-1 predicted flux - surfaceScalarField phiHbyA1 + // Predicted fluxes + const surfaceScalarField phiHbyA1 ( IOobject::groupName("phiHbyA", phase1.name()), - fvc::flux(HbyA1) - + phiCorrCoeff1 - *fvc::interpolate(byDt(alpha1.oldTime()*rho1.oldTime()*rAU1)) - *(MRF.absolute(phi1.oldTime()) - fvc::flux(U1.oldTime())) - - phiF1() - - phig1 + fvc::flux(HbyA1) - phigF1 - ddtCorrByAs[0] ); - // Phase-2 predicted flux - surfaceScalarField phiHbyA2 + const surfaceScalarField phiHbyA2 ( IOobject::groupName("phiHbyA", phase2.name()), - fvc::flux(HbyA2) - + phiCorrCoeff2 - *fvc::interpolate(byDt(alpha2.oldTime()*rho2.oldTime()*rAU2)) - *(MRF.absolute(phi2.oldTime()) - fvc::flux(U2.oldTime())) - - phiF2() - - phig2 + fvc::flux(HbyA2) - phigF2 - ddtCorrByAs[1] ); - // Face-drag coefficients - surfaceScalarField rAUKd1(fvc::interpolate(rAU1*Kd)); - surfaceScalarField rAUKd2(fvc::interpolate(rAU2*Kd)); + ddtCorrByAs.clear(); + + // Drag fluxes + PtrList<surfaceScalarField> phiKdPhis(fluid.phiKdPhis(rAUs)); + const surfaceScalarField& phiKdPhi1 = phiKdPhis[0]; + const surfaceScalarField& phiKdPhi2 = phiKdPhis[1]; - // Construct the mean predicted flux - // including explicit drag contributions based on absolute fluxes + // Total predicted flux surfaceScalarField phiHbyA ( "phiHbyA", - alphaf1*(phiHbyA1 + rAUKd1*MRF.absolute(phi2)) - + alphaf2*(phiHbyA2 + rAUKd2*MRF.absolute(phi1)) + alphaf1*(phiHbyA1 - phiKdPhi1) + alphaf2*(phiHbyA2 - phiKdPhi2) ); + MRF.makeRelative(phiHbyA); + phiKdPhis.clear(); + // Construct pressure "diffusivity" - surfaceScalarField rAUf + const surfaceScalarField rAUf ( "rAUf", mag(alphaf1*alpharAUf1 + alphaf2*alpharAUf2) @@ -226,16 +170,13 @@ while (pimple.correct()) )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) ); - tmp<fvScalarMatrix> pEqnComp1; - tmp<fvScalarMatrix> pEqnComp2; - // Construct the compressibility parts of the pressure equation - + tmp<fvScalarMatrix> pEqnComp1, pEqnComp2; if (phase1.compressible()) { if (pimple.transonic()) { - surfaceScalarField phid1 + const surfaceScalarField phid1 ( IOobject::groupName("phid", phase1.name()), fvc::interpolate(psi1)*phi1 @@ -243,7 +184,7 @@ while (pimple.correct()) pEqnComp1 = ( - phase1.continuityError() + fvc::ddt(alpha1, rho1) + fvc::div(phase1.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 + correction @@ -261,22 +202,17 @@ while (pimple.correct()) { pEqnComp1 = ( - phase1.continuityError() + fvc::ddt(alpha1, rho1) + fvc::div(phase1.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 + (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)); } } - else - { - pEqnComp1 = fvm::Su(-(fvOptions(alpha1, rho1)&rho1)/rho1, p_rgh); - } - if (phase2.compressible()) { if (pimple.transonic()) { - surfaceScalarField phid2 + const surfaceScalarField phid2 ( IOobject::groupName("phid", phase2.name()), fvc::interpolate(psi2)*phi2 @@ -284,7 +220,7 @@ while (pimple.correct()) pEqnComp2 = ( - phase2.continuityError() + fvc::ddt(alpha2, rho2) + fvc::div(phase2.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 + correction @@ -302,40 +238,70 @@ while (pimple.correct()) { pEqnComp2 = ( - phase2.continuityError() + fvc::ddt(alpha2, rho2) + fvc::div(phase2.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 + (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)); } } - else - { - pEqnComp2 = fvm::Su(-(fvOptions(alpha2, rho2)&rho2)/rho2, p_rgh); - } - if (fluid.transfersMass()) + // Add option sources { - if (pEqnComp1.valid()) + if (fvOptions.appliesToField(rho1.name())) { - pEqnComp1.ref() -= fluid.dmdt()/rho1; + tmp<fvScalarMatrix> optEqn1 = fvOptions(alpha1, rho1); + if (pEqnComp1.valid()) + { + pEqnComp1.ref() -= (optEqn1 & rho1)/rho1; + } + else + { + pEqnComp1 = fvm::Su(- (optEqn1 & rho1)/rho1, p_rgh); + } } - else + if (fvOptions.appliesToField(rho2.name())) { - pEqnComp1 = fvm::Su(-fluid.dmdt()/rho1, p_rgh); + tmp<fvScalarMatrix> optEqn2 = fvOptions(alpha2, rho2); + if (pEqnComp2.valid()) + { + pEqnComp2.ref() -= (optEqn2 & rho2)/rho2; + } + else + { + pEqnComp2 = fvm::Su(- (optEqn2 & rho2)/rho2, p_rgh); + } } + } - if (pEqnComp2.valid()) + // Add mass transfer + { + PtrList<volScalarField> dmdts(fluid.dmdts()); + if (dmdts.set(0)) { - pEqnComp2.ref() += fluid.dmdt()/rho2; + if (pEqnComp1.valid()) + { + pEqnComp1.ref() -= dmdts[0]/rho1; + } + else + { + pEqnComp1 = fvm::Su(- dmdts[0]/rho1, p_rgh); + } } - else + if (dmdts.set(1)) { - pEqnComp2 = fvm::Su(fluid.dmdt()/rho2, p_rgh); + if (pEqnComp2.valid()) + { + pEqnComp2.ref() -= dmdts[1]/rho2; + } + else + { + pEqnComp2 = fvm::Su(- dmdts[1]/rho2, p_rgh); + } } } // Cache p prior to solve for density update - volScalarField p_rgh_0(p_rgh); + const volScalarField p_rgh_0(p_rgh); // Iterate over the pressure equation to correct for non-orthogonality while (pimple.correctNonOrthogonal()) @@ -360,11 +326,7 @@ while (pimple.correct()) pEqn += pEqnComp2(); } - solve - ( - pEqn, - mesh.solver(p_rgh.select(pimple.finalInnerIter())) - ); + pEqn.solve(); } // Correct fluxes and velocities on last non-orthogonal iteration @@ -372,24 +334,28 @@ while (pimple.correct()) { phi = phiHbyA + pEqnIncomp.flux(); - surfaceScalarField mSfGradp("mSfGradp", pEqnIncomp.flux()/rAUf); + surfaceScalarField mSfGradp + ( + "mSfGradp", + pEqnIncomp.flux()/rAUf + ); // Partial-elimination phase-flux corrector { - surfaceScalarField phi1s + const surfaceScalarField phi1s ( phiHbyA1 + alpharAUf1*mSfGradp ); - surfaceScalarField phi2s + const surfaceScalarField phi2s ( phiHbyA2 + alpharAUf2*mSfGradp ); surfaceScalarField phir ( - ((phi1s + rAUKd1*phi2s) - (phi2s + rAUKd2*phi1s)) - /(1 - rAUKd1*rAUKd2) + ((phi1s + phiKd1*phi2s) - (phi2s + phiKd2*phi1s)) + /(1 - phiKd1*phiKd2) ); phi1 = phi + alphaf2*phir; @@ -413,23 +379,27 @@ while (pimple.correct()) // Partial-elimination phase-velocity corrector { - volVectorField Us1 + const volVectorField Us1 ( HbyA1 - + fvc::reconstruct(alpharAUf1*mSfGradp - phiF1() - phig1) + + fvc::reconstruct(alpharAUf1*mSfGradp - phigF1) ); - volVectorField Us2 + const volVectorField Us2 ( HbyA2 - + fvc::reconstruct(alpharAUf2*mSfGradp - phiF2() - phig2) + + fvc::reconstruct(alpharAUf2*mSfGradp - phigF2) ); - volScalarField D1(rAU1*Kd); - volScalarField D2(rAU2*Kd); + const volVectorField U + ( + alpha1*(Us1 + rAUKd1*U2) + alpha2*(Us2 + rAUKd2*U1) + ); - volVectorField U(alpha1*(Us1 + D1*U2) + alpha2*(Us2 + D2*U1)); - volVectorField Ur(((1 - D2)*Us1 - (1 - D1)*Us2)/(1 - D1*D2)); + const volVectorField Ur + ( + ((1 - rAUKd2)*Us1 - (1 - rAUKd1)*Us2)/(1 - rAUKd1*rAUKd2) + ); U1 = U + alpha2*Ur; U1.correctBoundaryConditions(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H deleted file mode 100644 index 557eb02678c560ccd8d32ce9dca262b5f05ac4f0..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H +++ /dev/null @@ -1,2 +0,0 @@ -tddtPhi1 = fvc::ddt(phi1); -tddtPhi2 = fvc::ddt(phi2); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H index 160212a069ac1b1d2f833225f1059cdfa19974b6..34ea288c5cac02d8734b8f32cb032fe3fa42abe3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H @@ -4,33 +4,22 @@ fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVolume/dimTime); fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime); { - volScalarField Vm(fluid.Vm()); + fluid.momentumTransfer(); // !!! Update coefficients shouldn't be necessary + // This should be done on demand - fvVectorMatrix UgradU1 - ( - fvm::div(phi1, U1) - fvm::Sp(fvc::div(phi1), U1) - + MRF.DDt(U1) - ); + autoPtr<phaseSystem::momentumTransferTable> + momentumTransferPtr(fluid.momentumTransferf()); - fvVectorMatrix UgradU2 - ( - fvm::div(phi2, U2) - fvm::Sp(fvc::div(phi2), U2) - + MRF.DDt(U2) - ); - - const volScalarField dmdt21(posPart(fluid.dmdt())); - const volScalarField dmdt12(negPart(fluid.dmdt())); + phaseSystem::momentumTransferTable& + momentumTransfer(momentumTransferPtr()); { U1Eqn = ( - fvm::div(alphaRhoPhi1, U1) - fvm::Sp(fvc::div(alphaRhoPhi1), U1) - + fvm::Sp(dmdt21, U1) - dmdt21*U2 - + MRF.DDt(alpha1*rho1, U1) - + phase1.turbulence().divDevRhoReff(U1) - + Vm*(UgradU1 - (UgradU2 & U2)) - - fvOptions(alpha1, rho1, U1) - + fvm::SuSp(fvOptions(alpha1, rho1)&rho1,U1) + phase1.UfEqn() + == + *momentumTransfer[phase1.name()] + + fvOptions(alpha1, rho1, U1) ); U1Eqn.relax(); fvOptions.constrain(U1Eqn); @@ -41,13 +30,10 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVolume/dimTime); { U2Eqn = ( - fvm::div(alphaRhoPhi2, U2) - fvm::Sp(fvc::div(alphaRhoPhi2), U2) - - fvm::Sp(dmdt12, U2) + dmdt12*U1 - + MRF.DDt(alpha2*rho2, U2) - + phase2.turbulence().divDevRhoReff(U2) - + Vm*(UgradU2 - (UgradU1 & U1)) - - fvOptions(alpha2, rho2, U2) - + fvm::SuSp(fvOptions(alpha2, rho2)&rho2,U2) + phase2.UfEqn() + == + *momentumTransfer[phase2.name()] + + fvOptions(alpha2, rho2, U2) ); U2Eqn.relax(); fvOptions.constrain(U2Eqn); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H deleted file mode 100644 index e461616b290d9163cbe4a2214320137a7296042c..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H +++ /dev/null @@ -1,7 +0,0 @@ -tmp<surfaceScalarField> tddtPhi1; -tmp<surfaceScalarField> tddtPhi2; - -if (faceMomentum) -{ - #include "pUf/DDtU.H" -} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H index b0c8e46b1c83bbff9bfffcabb9468303e209a1d1..0be323eb88dcfb76bd557efcc4df0224279c43a8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H @@ -22,73 +22,47 @@ surfaceScalarField alphaRhof20 ); // Drag coefficient -surfaceScalarField Kdf("Kdf", fluid.Kdf()); +const surfaceScalarField Kdf("Kdf", fluid.Kdf()); -// Virtual-mass coefficient -surfaceScalarField Vmf("Vmf", fluid.Vmf()); +// Diagonal coefficients +PtrList<surfaceScalarField> AFfs(fluid.AFfs()); -surfaceScalarField rAUf1 +PtrList<surfaceScalarField> rAUfs; +rAUfs.append ( - IOobject::groupName("rAUf", phase1.name()), - 1.0 - /( - byDt(alphaRhof10 + Vmf) - + fvc::interpolate(U1Eqn.A()) - + Kdf + new surfaceScalarField + ( + IOobject::groupName("rAUf", phase1.name()), + 1.0 + /( + byDt(alphaRhof10) + + fvc::interpolate(U1Eqn.A()) + + AFfs[0] + ) ) ); - -surfaceScalarField rAUf2 +rAUfs.append ( - IOobject::groupName("rAUf", phase2.name()), - 1.0 - /( - byDt(alphaRhof20 + Vmf) - + fvc::interpolate(U2Eqn.A()) - + Kdf + new surfaceScalarField + ( + IOobject::groupName("rAUf", phase2.name()), + 1.0 + /( + byDt(alphaRhof20) + + fvc::interpolate(U2Eqn.A()) + + AFfs[0] + ) ) ); +const surfaceScalarField& rAUf1 = rAUfs[0]; +const surfaceScalarField& rAUf2 = rAUfs[1]; +AFfs.clear(); -// Turbulent dispersion, particle-pressure, lift and wall-lubrication forces -tmp<surfaceScalarField> Ff1; -tmp<surfaceScalarField> Ff2; -{ - // Turbulent-dispersion diffusivity - volScalarField D(fluid.D()); - - // Phase-1 turbulent dispersion and particle-pressure diffusivity - surfaceScalarField Df1 - ( - fvc::interpolate(D + phase1.turbulence().pPrime()) - ); - - // Phase-2 turbulent dispersion and particle-pressure diffusivity - surfaceScalarField Df2 - ( - fvc::interpolate(D + phase2.turbulence().pPrime()) - ); - - // Cache the phase diffusivities for implicit treatment in the - // phase-fraction equation - if (implicitPhasePressure) - { - phase1.DbyA(rAUf1*Df1); - phase2.DbyA(rAUf2*Df2); - } - - // Lift and wall-lubrication forces - surfaceScalarField Ff(fluid.Ff()); - - // Phase-fraction face-gradient - surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1)*mesh.magSf()); - - // Phase-1 dispersion, lift and wall-lubrication force - Ff1 = Df1*snGradAlpha1 + Ff; - - // Phase-2 dispersion, lift and wall-lubrication force - Ff2 = -Df2*snGradAlpha1 - Ff; -} +// Explicit force fluxes +PtrList<surfaceScalarField> phiFfs(fluid.phiFfs(rAUfs)); +const surfaceScalarField& phiFf1 = phiFfs[0]; +const surfaceScalarField& phiFf2 = phiFfs[1]; while (pimple.correct()) @@ -105,48 +79,47 @@ while (pimple.correct()) MRF.correctBoundaryFlux(U1, phi1); MRF.correctBoundaryFlux(U2, phi2); - surfaceScalarField alpharAUf1 + const surfaceScalarField alpharAUf1 ( IOobject::groupName("alpharAUf", phase1.name()), max(alphaf1, phase1.residualAlpha())*rAUf1 ); - surfaceScalarField alpharAUf2 + const surfaceScalarField alpharAUf2 ( IOobject::groupName("alpharAUf", phase2.name()), max(alphaf2, phase2.residualAlpha())*rAUf2 ); - surfaceScalarField ghSnGradRho + // Combined buoyancy and force fluxes + const surfaceScalarField ghSnGradRho ( "ghSnGradRho", ghf*fvc::snGrad(rho)*mesh.magSf() ); - // Phase-1 buoyancy flux - surfaceScalarField phig1 + const surfaceScalarField phigF1 ( - IOobject::groupName("phig", phase1.name()), alpharAUf1 *( ghSnGradRho - alphaf2*(rhof1 - rhof2)*(g & mesh.Sf()) ) + + phiFf1 ); - // Phase-2 buoyancy flux - surfaceScalarField phig2 + const surfaceScalarField phigF2 ( - IOobject::groupName("phig", phase2.name()), alpharAUf2 *( ghSnGradRho - alphaf1*(rhof2 - rhof1)*(g & mesh.Sf()) ) + + phiFf2 ); - // Phase-1 predicted flux + // Predicted fluxes surfaceScalarField phiHbyA1 ( IOobject::groupName("phiHbyA", phase1.name()), @@ -156,15 +129,11 @@ while (pimple.correct()) phiHbyA1 = rAUf1 *( - (alphaRhof10 + Vmf) - *byDt(MRF.absolute(phi1.oldTime())) + alphaRhof10*byDt(MRF.absolute(phi1.oldTime())) + fvc::flux(U1Eqn.H()) - + Vmf*tddtPhi2() - + Kdf*MRF.absolute(phi2) - - Ff1() - ); + ) + - phigF1; - // Phase-2 predicted flux surfaceScalarField phiHbyA2 ( IOobject::groupName("phiHbyA", phase2.name()), @@ -174,31 +143,34 @@ while (pimple.correct()) phiHbyA2 = rAUf2 *( - (alphaRhof20 + Vmf) - *byDt(MRF.absolute(phi2.oldTime())) + alphaRhof20*byDt(MRF.absolute(phi2.oldTime())) + fvc::flux(U2Eqn.H()) - + Vmf*tddtPhi1() - + Kdf*MRF.absolute(phi1) - - Ff2() - ); + ) + - phigF2; + // Drag fluxes + PtrList<surfaceScalarField> phiKdPhifs(fluid.phiKdPhifs(rAUfs)); + const surfaceScalarField& phiKdPhif1 = phiKdPhifs[0]; + const surfaceScalarField& phiKdPhif2 = phiKdPhifs[1]; + // Total predicted flux surfaceScalarField phiHbyA ( "phiHbyA", - alphaf1*(phiHbyA1 - phig1) + alphaf2*(phiHbyA2 - phig2) + alphaf1*(phiHbyA1 - phiKdPhif1) + alphaf2*(phiHbyA2 - phiKdPhif2) ); MRF.makeRelative(phiHbyA); - phiHbyA1 -= phig1; - phiHbyA2 -= phig2; + phiKdPhifs.clear(); - surfaceScalarField rAUf + // Construct pressure "diffusivity" + const surfaceScalarField rAUf ( "rAUf", mag(alphaf1*alpharAUf1 + alphaf2*alpharAUf2) ); + // Update the fixedFluxPressure BCs to ensure flux consistency setSnGrad<fixedFluxPressureFvPatchScalarField> ( @@ -212,10 +184,8 @@ while (pimple.correct()) )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) ); - tmp<fvScalarMatrix> pEqnComp1; - tmp<fvScalarMatrix> pEqnComp2; - // Construct the compressibility parts of the pressure equation + tmp<fvScalarMatrix> pEqnComp1, pEqnComp2; if (phase1.compressible()) { @@ -229,7 +199,7 @@ while (pimple.correct()) pEqnComp1 = ( - phase1.continuityError() + fvc::ddt(alpha1, rho1) + fvc::div(phase1.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 + correction @@ -247,16 +217,12 @@ while (pimple.correct()) { pEqnComp1 = ( - phase1.continuityError() + fvc::ddt(alpha1, rho1) + fvc::div(phase1.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 + (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)); } } - else - { - pEqnComp1 = fvm::Su(-(fvOptions(alpha1, rho1)&rho1)/rho1, p_rgh); - } if (phase2.compressible()) { @@ -270,7 +236,7 @@ while (pimple.correct()) pEqnComp2 = ( - phase2.continuityError() + fvc::ddt(alpha2, rho2) + fvc::div(phase2.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 + correction @@ -288,35 +254,66 @@ while (pimple.correct()) { pEqnComp2 = ( - phase2.continuityError() + fvc::ddt(alpha2, rho2) + fvc::div(phase2.alphaRhoPhi()) - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 + (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)); } } - else - { - pEqnComp2 = fvm::Su(-(fvOptions(alpha2, rho2)&rho2)/rho2, p_rgh); - } - if (fluid.transfersMass()) + // Add option sources { - if (pEqnComp1.valid()) + if (fvOptions.appliesToField(rho1.name())) { - pEqnComp1.ref() -= fluid.dmdt()/rho1; + tmp<fvScalarMatrix> optEqn1 = fvOptions(alpha1, rho1); + if (pEqnComp1.valid()) + { + pEqnComp1.ref() -= (optEqn1 & rho1)/rho1; + } + else + { + pEqnComp1 = fvm::Su(- (optEqn1 & rho1)/rho1, p_rgh); + } } - else + if (fvOptions.appliesToField(rho2.name())) { - pEqnComp1 = fvm::Su(-fluid.dmdt()/rho1, p_rgh); + tmp<fvScalarMatrix> optEqn2 = fvOptions(alpha2, rho2); + if (pEqnComp2.valid()) + { + pEqnComp2.ref() -= (optEqn2 & rho2)/rho2; + } + else + { + pEqnComp2 = fvm::Su(- (optEqn2 & rho2)/rho2, p_rgh); + } } + } - if (pEqnComp2.valid()) + + // Add mass transfer + { + PtrList<volScalarField> dmdts(fluid.dmdts()); + if (dmdts.set(0)) { - pEqnComp2.ref() += fluid.dmdt()/rho2; + if (pEqnComp1.valid()) + { + pEqnComp1.ref() -= dmdts[0]/rho1; + } + else + { + pEqnComp1 = fvm::Su(- dmdts[0]/rho1, p_rgh); + } } - else + if (dmdts.set(1)) { - pEqnComp2 = fvm::Su(fluid.dmdt()/rho2, p_rgh); + if (pEqnComp2.valid()) + { + pEqnComp2.ref() -= dmdts[1]/rho2; + } + else + { + pEqnComp2 = fvm::Su(- dmdts[1]/rho2, p_rgh); + } } } @@ -357,18 +354,14 @@ while (pimple.correct()) phi = phiHbyA + pEqnIncomp.flux(); - surfaceScalarField phi1s + const surfaceScalarField phi1s ( - phiHbyA1 - + alpharAUf1*mSfGradp - - rAUf1*Kdf*MRF.absolute(phi2) + phiHbyA1 + alpharAUf1*mSfGradp ); - surfaceScalarField phi2s + const surfaceScalarField phi2s ( - phiHbyA2 - + alpharAUf2*mSfGradp - - rAUf2*Kdf*MRF.absolute(phi1) + phiHbyA2 + alpharAUf2*mSfGradp ); surfaceScalarField phir diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C index 9076053a3b8752d93b2d9567c4eec72014b40833..e8112a3e8961c4c5e9b34cc84c1ea19e49e61875 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C @@ -45,33 +45,6 @@ Description #include "localEulerDdtScheme.H" #include "fvcSmooth.H" -namespace Foam -{ - tmp<volScalarField> byDt(const volScalarField& vf) - { - if (fv::localEulerDdt::enabled(vf.mesh())) - { - return fv::localEulerDdt::localRDeltaT(vf.mesh())*vf; - } - else - { - return vf/vf.mesh().time().deltaT(); - } - } - - tmp<surfaceScalarField> byDt(const surfaceScalarField& sf) - { - if (fv::localEulerDdt::enabled(sf.mesh())) - { - return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf; - } - else - { - return sf/sf.mesh().time().deltaT(); - } - } -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -105,16 +78,7 @@ int main(int argc, char *argv[]) pimple.dict().lookupOrDefault("faceMomentum", false) ); - bool implicitPhasePressure - ( - mesh.solverDict(alpha1.name()).lookupOrDefault - ( - "implicitPhasePressure", false - ) - ); - #include "pUf/createRDeltaTf.H" - #include "pUf/createDDtU.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -159,7 +123,6 @@ int main(int argc, char *argv[]) #include "pUf/UEqns.H" #include "EEqns.H" #include "pUf/pEqn.H" - #include "pUf/DDtU.H" } else { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C deleted file mode 100644 index 88fc77a82a2847a31f8c6f90917c66db18d7b7f7..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,657 +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 "alphatWallBoilingWallFunctionFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "addToRunTimeSelectionTable.H" - -#include "twoPhaseSystem.H" -#include "phaseSystem.H" -#include "ThermalPhaseChangePhaseSystem.H" -#include "MomentumTransferPhaseSystem.H" -#include "compressibleTurbulenceModel.H" -#include "ThermalDiffusivity.H" -#include "PhaseCompressibleTurbulenceModel.H" -#include "saturationModel.H" -#include "wallFvPatch.H" -#include "uniformDimensionedFields.H" -#include "mathematicalConstants.H" - -using namespace Foam::constant::mathematical; - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -const Foam::Enum -< - Foam::compressible:: - alphatWallBoilingWallFunctionFvPatchScalarField::phaseType -> -Foam::compressible:: -alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_ -({ - { phaseType::vaporPhase, "vapor" }, - { phaseType::liquidPhase, "liquid" }, -}); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -alphatWallBoilingWallFunctionFvPatchScalarField:: -alphatWallBoilingWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF), - phaseType_(liquidPhase), - relax_(0.5), - AbyV_(p.size(), 0), - alphatConv_(p.size(), 0), - dDep_(p.size(), 1e-5), - qq_(p.size(), 0), - partitioningModel_(nullptr), - nucleationSiteModel_(nullptr), - departureDiamModel_(nullptr), - departureFreqModel_(nullptr) -{ - AbyV_ = this->patch().magSf(); - forAll(AbyV_, facei) - { - const label faceCelli = this->patch().faceCells()[facei]; - AbyV_[facei] /= iF.mesh().V()[faceCelli]; - } -} - - -alphatWallBoilingWallFunctionFvPatchScalarField:: -alphatWallBoilingWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict), - phaseType_(phaseTypeNames_.get("phaseType", dict)), - relax_(dict.lookupOrDefault<scalar>("relax", 0.5)), - AbyV_(p.size(), 0), - alphatConv_(p.size(), 0), - dDep_(p.size(), 1e-5), - qq_(p.size(), 0), - partitioningModel_(nullptr), - nucleationSiteModel_(nullptr), - departureDiamModel_(nullptr), - departureFreqModel_(nullptr) -{ - switch (phaseType_) - { - case vaporPhase: - { - partitioningModel_ = - wallBoilingModels::partitioningModel::New - ( - dict.subDict("partitioningModel") - ); - - dmdt_ = 0; - - break; - } - case liquidPhase: - { - partitioningModel_ = - wallBoilingModels::partitioningModel::New - ( - dict.subDict("partitioningModel") - ); - - nucleationSiteModel_ = - wallBoilingModels::nucleationSiteModel::New - ( - dict.subDict("nucleationSiteModel") - ); - - departureDiamModel_ = - wallBoilingModels::departureDiameterModel::New - ( - dict.subDict("departureDiamModel") - ); - - departureFreqModel_ = - wallBoilingModels::departureFrequencyModel::New - ( - dict.subDict("departureFreqModel") - ); - - if (dict.found("dDep")) - { - dDep_ = scalarField("dDep", dict, p.size()); - } - - if (dict.found("qQuenching")) - { - qq_ = scalarField("qQuenching", dict, p.size()); - } - - break; - } - } - - if (dict.found("alphatConv")) - { - alphatConv_ = scalarField("alphatConv", dict, p.size()); - } - - AbyV_ = this->patch().magSf(); - forAll(AbyV_, facei) - { - const label faceCelli = this->patch().faceCells()[facei]; - AbyV_[facei] /= iF.mesh().V()[faceCelli]; - } -} - - -alphatWallBoilingWallFunctionFvPatchScalarField:: -alphatWallBoilingWallFunctionFvPatchScalarField -( - const alphatWallBoilingWallFunctionFvPatchScalarField& psf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField - ( - psf, - p, - iF, - mapper - ), - relax_(psf.relax_), - AbyV_(psf.AbyV_), - alphatConv_(psf.alphatConv_, mapper), - dDep_(psf.dDep_, mapper), - qq_(psf.qq_, mapper), - partitioningModel_(psf.partitioningModel_), - nucleationSiteModel_(psf.nucleationSiteModel_), - departureDiamModel_(psf.departureDiamModel_), - departureFreqModel_(psf.departureFreqModel_) -{} - - -alphatWallBoilingWallFunctionFvPatchScalarField:: -alphatWallBoilingWallFunctionFvPatchScalarField -( - const alphatWallBoilingWallFunctionFvPatchScalarField& psf -) -: - alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf), - relax_(psf.relax_), - AbyV_(psf.AbyV_), - alphatConv_(psf.alphatConv_), - dDep_(psf.dDep_), - qq_(psf.qq_), - partitioningModel_(psf.partitioningModel_), - nucleationSiteModel_(psf.nucleationSiteModel_), - departureDiamModel_(psf.departureDiamModel_), - departureFreqModel_(psf.departureFreqModel_) -{} - - -alphatWallBoilingWallFunctionFvPatchScalarField:: -alphatWallBoilingWallFunctionFvPatchScalarField -( - const alphatWallBoilingWallFunctionFvPatchScalarField& psf, - const DimensionedField<scalar, volMesh>& iF -) -: - alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF), - relax_(psf.relax_), - AbyV_(psf.AbyV_), - alphatConv_(psf.alphatConv_), - dDep_(psf.dDep_), - qq_(psf.qq_), - partitioningModel_(psf.partitioningModel_), - nucleationSiteModel_(psf.nucleationSiteModel_), - departureDiamModel_(psf.departureDiamModel_), - departureFreqModel_(psf.departureFreqModel_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - // Check that partitioningModel has been constructed - if (!partitioningModel_.valid()) - { - FatalErrorInFunction - << "partitioningModel has not been constructed!" - << abort(FatalError); - } - - // Lookup the fluid model - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - >& fluid = - refCast - < - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - > - > - ( - db().lookupObject<phaseSystem>("phaseProperties") - ); - - const label patchi = patch().index(); - - switch (phaseType_) - { - case vaporPhase: - { - const phaseModel& vapor - ( - fluid.phase1().name() == internalField().group() - ? fluid.phase1() - : fluid.phase2() - ); - - const phaseModel& liquid(fluid.otherPhase(vapor)); - - // Liquid phase fraction at the wall - const scalarField liquidw(liquid.boundaryField()[patchi]); - - // Vapor Liquid phase fraction at the wall - const scalarField vaporw(vapor.boundaryField()[patchi]); - - const scalarField fLiquid - ( - partitioningModel_->fLiquid(liquidw) - ); - - operator== - ( - calcAlphat(*this)*(1 - fLiquid)/max(vaporw, scalar(1e-8)) - ); - break; - } - case liquidPhase: - { - // Check that nucleationSiteModel has been constructed - if (!nucleationSiteModel_.valid()) - { - FatalErrorInFunction - << "nucleationSiteModel has not been constructed!" - << abort(FatalError); - } - - // Check that departureDiameterModel has been constructed - if (!departureDiamModel_.valid()) - { - FatalErrorInFunction - << "departureDiameterModel has not been constructed!" - << abort(FatalError); - } - - // Check that nucleationSiteModel has been constructed - if (!departureFreqModel_.valid()) - { - FatalErrorInFunction - << "departureFrequencyModel has not been constructed!" - << abort(FatalError); - } - - const phaseModel& liquid - ( - fluid.phase1().name() == internalField().group() - ? fluid.phase1() - : fluid.phase2() - ); - - const phaseModel& vapor(fluid.otherPhase(liquid)); - - // Retrieve turbulence properties from model - const phaseCompressibleTurbulenceModel& turbModel = - liquid.turbulence(); - - const tmp<scalarField> tnutw = turbModel.nut(patchi); - - const scalar Cmu25(pow025(Cmu_)); - - const scalarField& y = turbModel.y()[patchi]; - - const tmp<scalarField> tmuw = turbModel.mu(patchi); - const scalarField& muw = tmuw(); - - const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi); - const scalarField& alphaw = talphaw(); - - const tmp<volScalarField> tk = turbModel.k(); - const volScalarField& k = tk(); - const fvPatchScalarField& kw = k.boundaryField()[patchi]; - - const fvPatchVectorField& Uw = - turbModel.U().boundaryField()[patchi]; - const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField magGradUw(mag(Uw.snGrad())); - - const fvPatchScalarField& rhow = - turbModel.rho().boundaryField()[patchi]; - const fvPatchScalarField& hew = - liquid.thermo().he().boundaryField()[patchi]; - - const fvPatchScalarField& Tw = - liquid.thermo().T().boundaryField()[patchi]; - const scalarField Tc(Tw.patchInternalField()); - - const scalarField uTau(Cmu25*sqrt(kw)); - - const scalarField yPlus(uTau*y/(muw/rhow)); - - const scalarField Pr(muw/alphaw); - - // Molecular-to-turbulent Prandtl number ratio - const scalarField Prat(Pr/Prt_); - - // Thermal sublayer thickness - const scalarField P(this->Psmooth(Prat)); - - const scalarField yPlusTherm(this->yPlusTherm(P, Prat)); - - const fvPatchScalarField& rhoLiquidw = - liquid.turbulence().rho().boundaryField()[patchi]; - - const fvPatchScalarField& rhoVaporw = - vapor.turbulence().rho().boundaryField()[patchi]; - - tmp<volScalarField> tCp = liquid.thermo().Cp(); - const volScalarField& Cp = tCp(); - const fvPatchScalarField& Cpw = Cp.boundaryField()[patchi]; - - // Saturation temperature - const tmp<volScalarField> tTsat = - fluid.saturation().Tsat(liquid.thermo().p()); - const volScalarField& Tsat = tTsat(); - const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]); - const scalarField Tsatc(Tsatw.patchInternalField()); - - const fvPatchScalarField& pw = - liquid.thermo().p().boundaryField()[patchi]; - - const scalarField L - ( - vapor.thermo().he(pw,Tsatc,patchi)-hew.patchInternalField() - ); - - // Liquid phase fraction at the wall - const scalarField liquidw(liquid.boundaryField()[patchi]); - - const scalarField fLiquid(partitioningModel_->fLiquid(liquidw)); - - // Convective thermal diffusivity - alphatConv_ = calcAlphat(alphatConv_); - - for (label i=0; i<10; i++) - { - // Liquid temperature at y+=250 is estimated from logarithmic - // thermal wall function (Koncar, Krepper & Egorov, 2005) - const scalarField Tplus_y250(Prt_*(log(E_*250)/kappa_ + P)); - - const scalarField Tplus(Prt_*(log(E_*yPlus)/kappa_ + P)); - scalarField Tl(Tw - (Tplus_y250/Tplus)*(Tw - Tc)); - Tl = max(Tc - 40, Tl); - - // Nucleation site density: - const scalarField N - ( - nucleationSiteModel_->N - ( - liquid, - vapor, - patchi, - Tl, - Tsatw, - L - ) - ); - - // Bubble departure diameter: - dDep_ = departureDiamModel_->dDeparture - ( - liquid, - vapor, - patchi, - Tl, - Tsatw, - L - ); - - // Bubble departure frequency: - const scalarField fDep - ( - departureFreqModel_->fDeparture - ( - liquid, - vapor, - patchi, - dDep_ - ) - ); - - // Area fractions: - - // Del Valle & Kenning (1985) - const scalarField Ja - ( - rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L) - ); - const scalarField Al - ( - fLiquid*4.8*exp( min(-Ja/80,log(VGREAT))) - ); - - const scalarField A2(min(pi*sqr(dDep_)*N*Al/4, scalar(1))); - const scalarField A1(max(1 - A2, scalar(1e-4))); - const scalarField A2E(min(pi*sqr(dDep_)*N*Al/4, scalar(5))); - - // Volumetric mass source in the near wall cell due to the - // wall boiling - dmdt_ = - (1 - relax_)*dmdt_ - + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_; - - // Volumetric source in the near wall cell due to the wall - // boiling - mDotL_ = dmdt_*L; - - // Quenching heat transfer coefficient - const scalarField hQ - ( - 2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(pi*alphaw/rhow)) - ); - - // Quenching heat flux - qq_ = (A2*hQ*max(Tw - Tl, scalar(0))); - - // Effective thermal diffusivity that corresponds to the - // calculated convective, quenching and evaporative heat fluxes - - operator== - ( - ( - A1*alphatConv_ - + (qq_ + qe())/max(hew.snGrad(), scalar(1e-16)) - ) - /max(liquidw, scalar(1e-8)) - ); - - scalarField TsupPrev(max((Tw - Tsatw),scalar(0))); - const_cast<fvPatchScalarField&>(Tw).evaluate(); - scalarField TsupNew(max((Tw - Tsatw),scalar(0))); - - scalar maxErr(max(mag(TsupPrev - TsupNew))); - - if (maxErr < 1e-1) - { - if (i > 0) - { - Info<< "Wall boiling wall function iterations: " - << i + 1 << endl; - } - break; - } - - if (debug) - { - const scalarField qc - ( - fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad() - ); - - const scalarField qEff - ( - liquidw*(*this + alphaw)*hew.snGrad() - ); - - Info<< " L: " << gMin(L) << " - " << gMax(L) << endl; - Info<< " Tl: " << gMin(Tl) << " - " << gMax(Tl) << endl; - Info<< " N: " << gMin(N) << " - " << gMax(N) << endl; - Info<< " dDep_: " << gMin(dDep_) << " - " - << gMax(dDep_) << endl; - Info<< " fDep: " << gMin(fDep) << " - " - << gMax(fDep) << endl; - Info<< " Al: " << gMin(Al) << " - " << gMax(Al) << endl; - Info<< " A1: " << gMin(A1) << " - " << gMax(A1) << endl; - Info<< " A2: " << gMin(A2) << " - " << gMax(A2) << endl; - Info<< " A2E: " << gMin(A2E) << " - " - << gMax(A2E) << endl; - Info<< " dmdtW: " << gMin(dmdt_) << " - " - << gMax(dmdt_) << endl; - Info<< " qc: " << gMin(qc) << " - " << gMax(qc) << endl; - Info<< " qq: " << gMin(fLiquid*qq()) << " - " - << gMax(fLiquid*qq()) << endl; - Info<< " qe: " << gMin(fLiquid*qe()) << " - " - << gMax(fLiquid*qe()) << endl; - Info<< " qEff: " << gMin(qEff) << " - " - << gMax(qEff) << endl; - Info<< " alphat: " << gMin(*this) << " - " - << gMax(*this) << endl; - Info<< " alphatConv: " << gMin(alphatConv_) - << " - " << gMax(alphatConv_) << endl; - } - } - break; - } - default: - { - FatalErrorInFunction - << "Unknown phase type. Valid types are: " - << phaseTypeNames_ << nl << exit(FatalError); - } - } - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField<scalar>::write(os); - - os.writeEntry("phaseType", phaseTypeNames_[phaseType_]); - - os.writeEntry("relax", relax_); - - switch (phaseType_) - { - case vaporPhase: - { - os.beginBlock("partitioningModel"); - partitioningModel_->write(os); - os.endBlock(); - break; - } - case liquidPhase: - { - os.beginBlock("partitioningModel"); - partitioningModel_->write(os); - os.endBlock(); - - os.beginBlock("nucleationSiteModel"); - nucleationSiteModel_->write(os); - os.endBlock(); - - os.beginBlock("departureDiamModel"); - departureDiamModel_->write(os); - os.endBlock(); - - os.beginBlock("departureFreqModel"); - departureFreqModel_->write(os); - os.endBlock(); - - break; - } - } - - dmdt_.writeEntry("dmdt", os); - dDep_.writeEntry("dDep", os); - qq_.writeEntry("qQuenching", os); - alphatConv_.writeEntry("alphatConv", os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - alphatWallBoilingWallFunctionFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index 5344fb75f29a9de76c3cac6e3af945270575bd56..6e9888c1c5b5d59aef3cdb3411a34df7eb3bf7fc 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -12,7 +12,15 @@ ) ); - MULES::explicitSolve(alpha1, phi, alphaPhi, 1, 0); + MULES::explicitSolve + ( + geometricOneField(), + alpha1, + phi, + alphaPhi, + oneField(), + zeroField() + ); rhoPhi = alphaPhi*(rho1 - rho2) + phi*rho2; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 3067df13d605873753ec739a13c63263806abfc3..7de1f78434911503d6fbf13ac9bdbcba8424cd08 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -345,12 +345,12 @@ Foam::RASModels::kineticTheoryModel::divDevRhoReff void Foam::RASModels::kineticTheoryModel::correct() { // Local references + const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(phase_.fluid()); volScalarField alpha(max(alpha_, scalar(0))); const volScalarField& rho = phase_.rho(); const surfaceScalarField& alphaRhoPhi = alphaRhoPhi_; const volVectorField& U = U_; - const volVectorField& Uc_ = - refCast<const twoPhaseSystem>(phase_.fluid()).otherPhase(phase_).U(); + const volVectorField& Uc_ = fluid.otherPhase(phase_).U(); const scalar sqrtPi = sqrt(constant::mathematical::pi); dimensionedScalar ThetaSmall("ThetaSmall", Theta_.dimensions(), 1.0e-6); @@ -394,7 +394,11 @@ void Foam::RASModels::kineticTheoryModel::correct() // Drag volScalarField beta ( - refCast<const twoPhaseSystem>(phase_.fluid()).drag(phase_).K() + fluid.lookupSubModel<dragModel> + ( + phase_, + fluid.otherPhase(phase_) + ).K() ); // Eq. 3.25, p. 50 Js = J1 - J2 diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H index 5d70e9299c3bbcb69a7cdb30ef7f83cc1899a794..587201e8067bdafb94c51fac6f75f8c99916c06a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H @@ -56,7 +56,7 @@ class hyperbolic // Private data //- Maximum fraction of phases which can be considered dispersed - HashTable<dimensionedScalar> maxDispersedAlpha_; + HashTable<dimensionedScalar, word, word::hash> maxDispersedAlpha_; //- Width of the transition const dimensionedScalar transitionAlphaScale_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H index e78c197a42b6c68ec64ed5981c039220da8e6599..92920b492de63b09dc0bce40def9e314b6f1cbf0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H @@ -56,10 +56,12 @@ class linear // Private data //- Maximum fraction of phases which can be considered fully dispersed - HashTable<dimensionedScalar> maxFullyDispersedAlpha_; + HashTable<dimensionedScalar, word, word::hash> + maxFullyDispersedAlpha_; //- Maximum fraction of phases which can be considered partly dispersed - HashTable<dimensionedScalar> maxPartlyDispersedAlpha_; + HashTable<dimensionedScalar, word, word::hash> + maxPartlyDispersedAlpha_; public: diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index 1cee315664e7dea258387e806274f5b366ec5faa..3ed4c2aecd3a121cdaef9526b2f91b7606bff680 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -210,6 +210,18 @@ public: return thermo_->kappa(); } + //- Thermal diffusivity for energy of mixture [kg/m/s] + tmp<volScalarField> alphahe() const + { + return thermo_->alphahe(); + } + + //- Thermal diffusivity for energy of mixture for patch [kg/m/s] + tmp<scalarField> alphahe(const label patchi) const + { + return thermo_->alphahe(patchi); + } + //- Return the laminar thermal conductivity tmp<volScalarField> kappaEff ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C index 433f76daf901f7fa16bf9a2f1d3397909c20feac..6352bcd66d3b0b99950d645cf526382d2ccb89ab 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C @@ -29,6 +29,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phasePairKey::hash::hash() +{} + + +Foam::phasePairKey::phasePairKey() +{} + + Foam::phasePairKey::phasePairKey ( const word& name1, @@ -41,12 +50,10 @@ Foam::phasePairKey::phasePairKey {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -bool Foam::phasePairKey::ordered() const -{ - return ordered_; -} +Foam::phasePairKey::~phasePairKey() +{} // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // @@ -65,8 +72,12 @@ Foam::label Foam::phasePairKey::hash::operator() word::hash()(key.second()) ); } - - return word::hash()(key.first()) + word::hash()(key.second()); + else + { + return + word::hash()(key.first()) + + word::hash()(key.second()); + } } @@ -78,13 +89,14 @@ bool Foam::operator== const phasePairKey& b ) { - const auto cmp = Pair<word>::compare(a,b); + const auto c = Pair<word>::compare(a,b); return - ( (a.ordered_ == b.ordered_) - && (a.ordered_ ? (cmp == 1) : cmp) - ); + && ( + (a.ordered_ && (c == 1)) + || (!a.ordered_ && (c != 0)) + ); } @@ -116,11 +128,11 @@ Foam::Istream& Foam::operator>>(Istream& is, phasePairKey& key) } else { - FatalErrorInFunction + FatalErrorInFunction << "Phase pair type is not recognised. " << temp - << "Use (phaseDispersed in phaseContinuous) for an ordered pair, " - << "or (phase1 and phase2) for an unordered pair." + << "Use (phaseDispersed in phaseContinuous) for an ordered" + << "pair, or (phase1 and pase2) for an unordered pair." << exit(FatalError); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H index 7dcde0188d6c8586bbda76ebae2683d031d8d425..a9324c99ffb932124efd17a3f1edc6411297f5ae 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H @@ -59,6 +59,29 @@ class phasePairKey : public Pair<word> { +public: + + class hash + : + public Hash<phasePairKey> + { + public: + + // Constructors + + // Construct null + hash(); + + + // Member operators + + // Generate a hash from a phase pair key + label operator()(const phasePairKey& key) const; + }; + + +private: + // Private data //- Flag to indicate whether ordering is important @@ -66,30 +89,23 @@ class phasePairKey public: - //- Ordered or unordered hashing of word pair - struct hash - { - //- Generate a hash from a phase pair key - label operator()(const phasePairKey& key) const; - }; - // Constructors //- Construct null - phasePairKey() {} // = default + phasePairKey(); - //- Construct from names and optional ordering flag + //- Construct from names and the ordering flag phasePairKey ( const word& name1, const word& name2, - const bool ordered = false + const bool ordered ); //- Destructor - virtual ~phasePairKey() = default; + virtual ~phasePairKey(); // Access diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index f940eb7da5f7f33e4052ab48cea5cc39f9ef8b30..bdab72d50ca153df9641b1f8e1bc582b28f718fd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2017 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,6 +47,7 @@ License #include "fixedValueFvsPatchFields.H" #include "blendingMethod.H" #include "HashPtrTable.H" +#include "UniformField.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -108,21 +109,21 @@ Foam::twoPhaseSystem::twoPhaseSystem IOobject::AUTO_WRITE ), mesh, - dimensionedScalar(dimless/dimTime, Zero) + dimensionedScalar("dgdt", dimless/dimTime, 0) ) { phase2_.volScalarField::operator=(scalar(1) - phase1_); // Blending - for (const entry& dEntry : subDict("blending")) + forAllConstIter(dictionary, subDict("blending"), iter) { blendingMethods_.insert ( - dEntry.dict().dictName(), + iter().dict().dictName(), blendingMethod::New ( - dEntry.dict(), + iter().dict(), wordList(lookup("phases")) ) ); @@ -134,7 +135,7 @@ Foam::twoPhaseSystem::twoPhaseSystem phasePair::scalarTable sigmaTable(lookup("sigma")); phasePair::dictTable aspectRatioTable(lookup("aspectRatio")); - pair_.reset + pair_.set ( new phasePair ( @@ -145,7 +146,7 @@ Foam::twoPhaseSystem::twoPhaseSystem ) ); - pair1In2_.reset + pair1In2_.set ( new orderedPhasePair ( @@ -157,7 +158,7 @@ Foam::twoPhaseSystem::twoPhaseSystem ) ); - pair2In1_.reset + pair2In1_.set ( new orderedPhasePair ( @@ -172,100 +173,100 @@ Foam::twoPhaseSystem::twoPhaseSystem // Models - drag_.reset + drag_.set ( new BlendedInterfacialModel<dragModel> ( lookup("drag"), ( blendingMethods_.found("drag") - ? *(blendingMethods_["drag"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["drag"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_, + pair_, + pair1In2_, + pair2In1_, false // Do not zero drag coefficient at fixed-flux BCs ) ); - virtualMass_.reset + virtualMass_.set ( new BlendedInterfacialModel<virtualMassModel> ( lookup("virtualMass"), ( blendingMethods_.found("virtualMass") - ? *(blendingMethods_["virtualMass"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["virtualMass"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_ + pair_, + pair1In2_, + pair2In1_ ) ); - heatTransfer_.reset + heatTransfer_.set ( new BlendedInterfacialModel<heatTransferModel> ( lookup("heatTransfer"), ( blendingMethods_.found("heatTransfer") - ? *(blendingMethods_["heatTransfer"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["heatTransfer"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_ + pair_, + pair1In2_, + pair2In1_ ) ); - lift_.reset + lift_.set ( new BlendedInterfacialModel<liftModel> ( lookup("lift"), ( blendingMethods_.found("lift") - ? *(blendingMethods_["lift"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["lift"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_ + pair_, + pair1In2_, + pair2In1_ ) ); - wallLubrication_.reset + wallLubrication_.set ( new BlendedInterfacialModel<wallLubricationModel> ( lookup("wallLubrication"), ( blendingMethods_.found("wallLubrication") - ? *(blendingMethods_["wallLubrication"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["wallLubrication"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_ + pair_, + pair1In2_, + pair2In1_ ) ); - turbulentDispersion_.reset + turbulentDispersion_.set ( new BlendedInterfacialModel<turbulentDispersionModel> ( lookup("turbulentDispersion"), ( blendingMethods_.found("turbulentDispersion") - ? *(blendingMethods_["turbulentDispersion"]) - : *(blendingMethods_["default"]) + ? blendingMethods_["turbulentDispersion"] + : blendingMethods_["default"] ), - *pair_, - *pair1In2_, - *pair2In1_ + pair_, + pair1In2_, + pair2In1_ ) ); } @@ -274,7 +275,7 @@ Foam::twoPhaseSystem::twoPhaseSystem // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::twoPhaseSystem::~twoPhaseSystem() -{} // Define here (incomplete type in header) +{} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // @@ -362,8 +363,8 @@ void Foam::twoPhaseSystem::solve() alpha1.name() ); - label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles")); - label nAlphaCorr(alphaControls.get<label>("nAlphaCorr")); + label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); + label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); word alphaScheme("div(phi," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')'); @@ -401,7 +402,7 @@ void Foam::twoPhaseSystem::solve() mesh_ ), mesh_, - dimensionedScalar(dgdt_.dimensions(), Zero) + dimensionedScalar("Sp", dgdt_.dimensions(), 0.0) ); volScalarField::Internal Su @@ -466,8 +467,8 @@ void Foam::twoPhaseSystem::solve() alphaPhic10, (alphaSubCycle.index()*Sp)(), (Su - (alphaSubCycle.index() - 1)*Sp*alpha1)(), - phase1_.alphaMax(), - 0 + UniformField<scalar>(phase1_.alphaMax()), + zeroField() ); if (alphaSubCycle.index() == 1) @@ -492,8 +493,8 @@ void Foam::twoPhaseSystem::solve() alphaPhic1, Sp, Su, - phase1_.alphaMax(), - 0 + UniformField<scalar>(phase1_.alphaMax()), + zeroField() ); phase1_.alphaPhi() = alphaPhic1; @@ -568,19 +569,6 @@ bool Foam::twoPhaseSystem::read() } -const Foam::dragModel& Foam::twoPhaseSystem::drag(const phaseModel& phase) const -{ - return drag_->phaseModel(phase); -} - - -const Foam::virtualMassModel& -Foam::twoPhaseSystem::virtualMass(const phaseModel& phase) const -{ - return virtualMass_->phaseModel(phase); -} - - const Foam::dimensionedScalar& Foam::twoPhaseSystem::sigma() const { return pair_->sigma(); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H index ad9c7e77b143e3b197bb13b188e7d915338fe81e..34d75fcf6cc152aa730a85bcef68fc7b13d8b01d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H @@ -96,7 +96,7 @@ class twoPhaseSystem autoPtr<orderedPhasePair> pair2In1_; //- Blending methods - HashTable<autoPtr<blendingMethod>> blendingMethods_; + HashTable<autoPtr<blendingMethod>, word, word::hash> blendingMethods_; //- Drag model autoPtr<BlendedInterfacialModel<dragModel>> drag_; @@ -184,11 +184,17 @@ public: // Access - //- Return the drag model for the given phase - const dragModel& drag(const phaseModel& phase) const; + //- Access a sub model between a phase pair + template<class modelType> + const modelType& lookupSubModel(const phasePair& key) const; - //- Return the virtual mass model for the given phase - const virtualMassModel& virtualMass(const phaseModel& phase) const; + //- Access a sub model between two phases + template<class modelType> + const modelType& lookupSubModel + ( + const phaseModel& dispersed, + const phaseModel& continuous + ) const; //- Return the surface tension coefficient const dimensionedScalar& sigma() const; @@ -238,6 +244,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "twoPhaseSystemTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemTemplates.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..ea51ec8d32789455c2abd46745d3584a238c9553 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemTemplates.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "BlendedInterfacialModel.H" +#include "dragModel.H" +#include "virtualMassModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class modelType> +const modelType& twoPhaseSystem::lookupSubModel +( + const phasePair& key +) const +{ + return + mesh().lookupObject<modelType> + ( + IOobject::groupName(modelType::typeName, key.name()) + ); +} + + +template<> +inline const dragModel& twoPhaseSystem::lookupSubModel<dragModel> +( + const phaseModel& dispersed, + const phaseModel& continuous +) const +{ + return drag_->phaseModel(dispersed); +} + + +template<> +inline const virtualMassModel& twoPhaseSystem::lookupSubModel<virtualMassModel> +( + const phaseModel& dispersed, + const phaseModel& continuous +) const +{ + return virtualMass_->phaseModel(dispersed); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/etc/bashrc b/etc/bashrc index f4268e1ff72f1f3dba1343e542dffb71c1f37f21..03365014635ff8402bb48cab0d62458bebbe79dd 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -98,7 +98,7 @@ export WM_COMPILE_OPTION=Opt # = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPI | MPICH | MPICH-GM | # HPMPI | CRAY-MPICH | FJMPI | QSMPI | SGIMPI | INTELMPI | USERMPI # Also possible to use INTELMPI-xyz etc and define your own wmake rule -export WM_MPLIB=SYSTEMOPENMPI +export WM_MPLIB=OPENMPI #------------------------------------------------------------------------------ diff --git a/src/Allwmake b/src/Allwmake index 5797c9eeda461117c66d71c44dffe29e1c3e0e20..31ff2e265a86d5c191b393a754069a689b101ec8 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -108,6 +108,9 @@ wmake $targetType rigidBodyMeshMotion wmake $targetType semiPermeableBaffle wmake $targetType atmosphericModels +phaseSystemModels/Allwmake $targetType $* +wmake $targetType TurbulenceModels/compressible/turbulentFluidThermoModels/ + # Needs access to Turbulence wmake $targetType thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 8fee47ce9a7c63597b3529a95744aff48ac68d2c..13d86b664ba5f28003e1633ef2508e9ae2a2ddd4 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -58,6 +58,7 @@ $(ints)/lists/labelListIOList.C primitives/Scalar/doubleScalar/doubleScalar.C primitives/Scalar/floatScalar/floatScalar.C primitives/Scalar/scalar/scalar.C +primitives/Scalar/scalar/incGamma.C primitives/Scalar/scalar/invIncGamma.C primitives/Scalar/lists/scalarList.C primitives/Scalar/lists/scalarIOList.C diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 79bb51634fec2741eb0ba3e06de9512fbbc0e450..390b8d212c21383e3a5f03ceb446b44c259bf8b4 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -245,6 +245,36 @@ Foam::IOobject Foam::IOobject::selectIO } +Foam::word Foam::IOobject::group(const word& name) +{ + word::size_type i = name.find_last_of('.'); + + if (i == word::npos || i == 0) + { + return word::null; + } + else + { + return name.substr(i+1, word::npos); + } +} + + +Foam::word Foam::IOobject::member(const word& name) +{ + word::size_type i = name.find_last_of('.'); + + if (i == word::npos || i == 0) + { + return name; + } + else + { + return name.substr(0, i); + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::IOobject::IOobject diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index be81dcf4ef6599de3b128e15489cfb0b632def62..60be6238fdf9995f40288da2f238b251e551e78f 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -229,6 +229,13 @@ public: template<class StringType> static inline word groupName(StringType name, const word& group); + + //- Return group (extension part of name) + static word group(const word& name); + + //- Return member (name without the extension) + static word member(const word& name); + //- Return the IOobject, but also consider an alternative file name. // // \param io The expected IOobject to use diff --git a/src/OpenFOAM/fields/Fields/uniformField/UniformField.H b/src/OpenFOAM/fields/Fields/uniformField/UniformField.H index e1d4138a8ea310af591c04e43488f2fd6b4c7fbe..9b89678a9149ce6d3544d886366763135edbf9c3 100644 --- a/src/OpenFOAM/fields/Fields/uniformField/UniformField.H +++ b/src/OpenFOAM/fields/Fields/uniformField/UniformField.H @@ -63,6 +63,9 @@ public: // Member Operators + + inline operator Type() const; + inline Type operator[](const label) const; inline UniformField field() const; diff --git a/src/OpenFOAM/fields/Fields/uniformField/UniformFieldI.H b/src/OpenFOAM/fields/Fields/uniformField/UniformFieldI.H index 0ab95ef82f11d3d55e800f60c310be430bbd7d61..42b20780a9fa89be48bf1720ed91c9126e3409d3 100644 --- a/src/OpenFOAM/fields/Fields/uniformField/UniformFieldI.H +++ b/src/OpenFOAM/fields/Fields/uniformField/UniformFieldI.H @@ -36,6 +36,13 @@ inline Foam::UniformField<Type>::UniformField(const Type& value) {} +template<class Type> +inline Foam::UniformField<Type>::operator Type() const +{ + return value_; +} + + template<class Type> inline Type Foam::UniformField<Type>::operator[](const label) const { @@ -50,4 +57,65 @@ inline Foam::UniformField<Type> Foam::UniformField<Type>::field() const } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> +inline UniformField<Type> min +( + const UniformField<Type>& u1, + const UniformField<Type>& u2 +) +{ + return UniformField<Type>(min(u1.operator Type(), u2.operator Type())); +} + + +template<class Type, class OtherType> +inline OtherType min(const UniformField<Type>& u, const OtherType& o) +{ + return min(u.operator Type(), o); +} + + +template<class Type, class OtherType> +inline OtherType min(const OtherType& o, const UniformField<Type>& u) +{ + return min(o, u.operator Type()); +} + + +template<class Type> +inline UniformField<Type> max +( + const UniformField<Type>& u1, + const UniformField<Type>& u2 +) +{ + return UniformField<Type>(max(u1.operator Type(), u2.operator Type())); +} + + +template<class Type, class OtherType> +inline OtherType max(const UniformField<Type>& u, const OtherType& o) +{ + return max(u.operator Type(), o); +} + + +template<class Type, class OtherType> +inline OtherType max(const OtherType& o, const UniformField<Type>& u) +{ + return max(o, u.operator Type()); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + // ************************************************************************* // diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index 846949ed63fd547649e0a21c4633712b4dd260ea..722e891e7c15d7cd2a68df562af78ac99b8b01bb 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -698,6 +698,161 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::clone() const } +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::GeometricField<Type, PatchField, GeoMesh>::New +( + const word& name, + const Mesh& mesh, + const dimensionSet& ds, + const word& patchFieldType +) +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + name, + mesh.thisDb().time().timeName(), + mesh.thisDb(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + ds, + patchFieldType + ) + ); +} + + +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::GeometricField<Type, PatchField, GeoMesh>::New +( + const word& name, + const Mesh& mesh, + const dimensioned<Type>& dt, + const word& patchFieldType +) +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + name, + mesh.thisDb().time().timeName(), + mesh.thisDb(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dt, + patchFieldType + ) + ); +} + + + +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::GeometricField<Type, PatchField, GeoMesh>::New +( + const word& name, + const Mesh& mesh, + const dimensioned<Type>& dt, + const wordList& patchFieldTypes, + const wordList& actualPatchTypes +) +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + name, + mesh.thisDb().time().timeName(), + mesh.thisDb(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dt, + patchFieldTypes, + actualPatchTypes + ) + ); +} + + +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::GeometricField<Type, PatchField, GeoMesh>::New +( + const word& newName, + const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf +) +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + newName, + tgf().instance(), + tgf().local(), + tgf().db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + tgf + ) + ); +} + + +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::GeometricField<Type, PatchField, GeoMesh>::New +( + const word& newName, + const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf, + const wordList& patchFieldTypes, + const wordList& actualPatchTypes +) +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + newName, + tgf().instance(), + tgf().local(), + tgf().db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + tgf, + patchFieldTypes, + actualPatchTypes + ) + ); +} + // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * * // template<class Type, template<class> class PatchField, class GeoMesh> diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index b51742a7e3a9f2f0f40d1d03a6ee87d4d3a6da6e..e0ccc24bc3856d05744d5f4208832659fd2e5fa3 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -461,6 +461,53 @@ public: //- Clone tmp<GeometricField<Type, PatchField, GeoMesh>> clone() const; + //- Return a temporary field constructed from name, mesh, dimensionSet + // and patch type. + static tmp<GeometricField<Type, PatchField, GeoMesh>> New + ( + const word& name, + const Mesh&, + const dimensionSet&, + const word& patchFieldType=PatchField<Type>::calculatedType() + ); + + //- Return a temporary field constructed from mesh, dimensioned<Type> + // and patch type. + static tmp<GeometricField<Type, PatchField, GeoMesh>> New + ( + const word& name, + const Mesh&, + const dimensioned<Type>&, + const word& patchFieldType=PatchField<Type>::calculatedType() + ); + + //- Return a temporary field constructed from mesh, dimensioned<Type> + // and patch types. + static tmp<GeometricField<Type, PatchField, GeoMesh>> New + ( + const word& name, + const Mesh&, + const dimensioned<Type>&, + const wordList& patchFieldTypes, + const wordList& actualPatchTypes = wordList() + ); + + //- Rename temporary field and return + static tmp<GeometricField<Type, PatchField, GeoMesh>> New + ( + const word& newName, + const tmp<GeometricField<Type, PatchField, GeoMesh>>& + ); + + //- Rename and reset patch fields types of temporary field and return + static tmp<GeometricField<Type, PatchField, GeoMesh>> New + ( + const word& newName, + const tmp<GeometricField<Type, PatchField, GeoMesh>>&, + const wordList& patchFieldTypes, + const wordList& actualPatchTypes = wordList() + ); + //- Destructor virtual ~GeometricField(); diff --git a/src/OpenFOAM/primitives/Scalar/scalar/incGamma.C b/src/OpenFOAM/primitives/Scalar/scalar/incGamma.C new file mode 100644 index 0000000000000000000000000000000000000000..e315100c9b5b3749e7bff9e667190851a2612990 --- /dev/null +++ b/src/OpenFOAM/primitives/Scalar/scalar/incGamma.C @@ -0,0 +1,456 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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/>. + +Global + Foam::incGamma + +Description + Calculates the upper and lower incomplete gamma functions as well as their + normalized versions. + + The algorithm is described in detail in DiDonato et al. (1986). + + \verbatim + DiDonato, A. R., & Morris Jr, A. H. (1986). + Computation of the incomplete gamma function ratios and their inverse. + ACM Transactions on Mathematical Software (TOMS), 12(4), 377-393. + \endverbatim + + All equation numbers in the following code refer to the above paper. + The algorithm in function 'incGammaRatio_Q' is described in section 3. + The accuracy parameter IND is set to a value of 1. + +\*---------------------------------------------------------------------------*/ + +#include "mathematicalConstants.H" + +using namespace Foam::constant::mathematical; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Eqn. (13) +static scalar calcQE11(const scalar a, const scalar x, const int e = 30) +{ + scalar a_2n = 0; + scalar b_2n = 1; + + scalar a_2np1 = 1; + scalar b_2np1 = x; + + int n = 1; + for (n = 1; (2*n) <= e; n++) + { + const scalar a_2nm1 = a_2np1; + const scalar b_2nm1 = b_2np1; + + a_2n = a_2nm1 + (n - a)*a_2n; + b_2n = b_2nm1 + (n - a)*b_2n; + + a_2np1 = x*a_2n + n*a_2nm1; + b_2np1 = x*b_2n + n*b_2nm1; + } + + if (2*(n - 1) < e) + { + return a_2np1/b_2np1; + } + else + { + return a_2n/b_2n; + } +} + + +// Eqn. (15) +static scalar calcPE15(const scalar a, const scalar x, const int nmax = 20) +{ + scalar prod = 1; + scalar sum = 0; + + for (int n = 1; n <= nmax; n++) + { + prod *= (a + n); + sum += pow(x, n)/prod; + } + + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R/a*(1 + sum); +} + + +// Eq. (16) +static scalar calcQE16(const scalar a, const scalar x, const int N = 20) +{ + scalar an = 1; + scalar sum = 0; + + for (int n = 1; n <= (N - 1); n++) + { + an *= (a - n); + sum += an/pow(x, n); + } + + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R/x*(1 + sum); +} + + +// Eq. (18) +static scalar calcTE18 +( + const scalar a, + const scalar e0, + const scalar x, + const scalar lambda, + const scalar sigma, + const scalar phi +) +{ + static const scalar D0[] = + { + -0.333333333333333E-00, + 0.833333333333333E-01, + -0.148148148148148E-01, + 0.115740740740741E-02, + 0.352733686067019E-03, + -0.178755144032922E-03, + 0.391926317852244E-04, + -0.218544851067999E-05, + -0.185406221071516E-05, + 0.829671134095309E-06, + -0.176659527368261E-06, + 0.670785354340150E-08, + 0.102618097842403E-07, + -0.438203601845335E-08 + }; + + static const scalar D1[] = + { + -0.185185185185185E-02, + -0.347222222222222E-02, + 0.264550264550265E-02, + -0.990226337448560E-03, + 0.205761316872428E-03, + -0.401877572016461E-06, + -0.180985503344900E-04, + 0.764916091608111E-05, + -0.161209008945634E-05, + 0.464712780280743E-08, + 0.137863344691572E-06, + -0.575254560351770E-07, + 0.119516285997781E-07 + }; + + static const scalar D2[] = + { + 0.413359788359788E-02, + -0.268132716049383E-02, + 0.771604938271605E-03, + 0.200938786008230E-05, + -0.107366532263652E-03, + 0.529234488291201E-04, + -0.127606351886187E-04, + 0.342357873409614E-07, + 0.137219573090629E-05, + -0.629899213838006E-06, + 0.142806142060642E-06 + }; + + const scalar u = 1/a; + scalar z = sqrt(2*phi); + + if (lambda < 1) + { + z = -z; + } + + if (sigma > (e0/sqrt(a))) + { + const scalar C0 = + D0[6]*pow6(z) + D0[5]*pow5(z) + D0[4]*pow4(z) + + D0[3]*pow3(z) + D0[2]*sqr(z) + D0[1]*z + D0[0]; + + const scalar C1 = + D1[4]*pow4(z) + D1[3]*pow3(z) + D1[2]*sqr(z) + D1[1]*z + D1[0]; + + const scalar C2 = D2[1]*z + D2[0]; + + return C2*sqr(u) + C1*u + C0; + } + else + { + const scalar C0 = D0[2]*sqr(z) + D0[1]*z + D0[0]; + const scalar C1 = D1[1]*z + D1[0]; + const scalar C2 = D2[1]*z + D2[0]; + + return C2*sqr(u) + C1*u + C0; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::scalar Foam::incGammaRatio_Q(const scalar a, const scalar x) +{ + const scalar BIG = 14; + const scalar x0 = 17; + const scalar e0 = 0.025; + + if (a < 1) + { + if (a == 0.5) + { + // Eqn. (8) + if (x < 0.25) + { + return 1 - erf(sqrt(x)); + } + else + { + return erfc(sqrt(x)); + } + } + else if ( x < 1.1) + { + // Eqn. (12) + scalar alpha = x/2.59; + + if (x < 0.5) + { + alpha = log(sqrt(0.765))/log(x); + } + + scalar sum = 0; + + for (int n = 1; n <= 10; n++) + { + sum += pow((-x), n)/((a + n)*factorial(n)); + } + + const scalar J = -a*sum; + + if (a > alpha || a == alpha) + { + // Eqn. (9) + return 1 - (pow(x, a)*(1 - J))/tgamma(a + 1); + } + else + { + // Eqn. (10) + const scalar L = exp(a*log(x)) - 1; + const scalar H = 1/(tgamma(a + 1)) - 1; + + return (pow(x, a)*J - L)/tgamma(a + 1) - H; + } + } + else + { + // Eqn. (11) + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R*calcQE11(a, x); + } + } + else if (a >= BIG) + { + const scalar sigma = fabs(1 - x/a); + + if (sigma <= e0/sqrt(a)) + { + // Eqn. (19) + const scalar lambda = x/a; + const scalar phi = lambda - 1 - log(lambda); + const scalar y = a*phi; + + const scalar E = 0.5 - (1 - y/3)*sqrt(y/pi); + + if (lambda <= 1) + { + return + 1 + - ( + E + - (1 - y)/sqrt(2*pi*a) + *calcTE18(a, e0, x, lambda, sigma, phi) + ); + } + else + { + return + E + + (1 - y)/sqrt(2*pi*a) + *calcTE18(a, e0, x, lambda, sigma, phi); + } + } + else + { + if (sigma <= 0.4) + { + // Eqn. (17) + const scalar lambda = x/a; + const scalar phi = lambda - 1 - log(lambda); + const scalar y = a*phi; + + if (lambda <= 1) + { + return + 1 + - (0.5*erfc(sqrt(y)) + - exp(-y)/sqrt(2*pi*a) + *calcTE18(a, e0, x, lambda, sigma, phi)); + } + else + { + return + 0.5*erfc(sqrt(y)) + + exp(-y)/sqrt(2*pi*a) + *calcTE18(a, e0, x, lambda, sigma, phi); + } + } + else + { + if (x <= max(a, log(10.0))) + { + // Eqn. (15) + return 1 - calcPE15(a, x); + } + else if (x < x0) + { + // Eqn. (11) + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R*calcQE11(a, x); + } + else + { + // Eqn. (16) + return calcQE16(a, x); + } + } + } + } + else + { + if (a > x || x >= x0) + { + if (x <= max(a, log(10.0))) + { + // Eqn. (15) + return 1 - calcPE15(a, x); + } + else if ( x < x0) + { + // Eqn. (11) + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R*calcQE11(a, x); + } + else + { + // Eqn. (16) + return calcQE16(a, x); + } + } + else + { + if (floor(2*a) == 2*a) + { + // Eqn. (14) + if (floor(a) == a) + { + scalar sum = 0; + + for (int n = 0; n <= (a - 1); n++) + { + sum += pow(x, n)/factorial(n); + } + + return exp(-x)*sum; + } + else + { + int i = a - 0.5; + scalar prod = 1; + scalar sum = 0; + + for (int n = 1; n <= i; n++) + { + prod *= (n - 0.5); + sum += pow(x, n)/prod; + } + + return erfc(sqrt(x)) + exp(-x)/sqrt(pi*x)*sum; + } + } + else if (x <= max(a, log(10.0))) + { + // Eqn. (15) + return 1 - calcPE15(a, x); + } + else if ( x < x0) + { + // Eqn. (11) + const scalar R = (exp(-x)*pow(x, a))/tgamma(a); + + return R*calcQE11(a, x); + } + else + { + // Eqn. (16) + return calcQE16(a, x); + } + } + } +} + + +Foam::scalar Foam::incGammaRatio_P(const scalar a, const scalar x) +{ + return 1 - incGammaRatio_Q(a, x); +} + + +Foam::scalar Foam::incGamma_Q(const scalar a, const scalar x) +{ + return incGammaRatio_Q(a, x)*tgamma(a); +} + + +Foam::scalar Foam::incGamma_P(const scalar a, const scalar x) +{ + return incGammaRatio_P(a, x)*tgamma(a); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H index f14586dc87da22849babd6b2db77cc3e8477a9b4..cc9009df83a34eca6a7c377eb1f1fde685e6a5aa 100644 --- a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H +++ b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H @@ -136,6 +136,18 @@ namespace Foam { //- Inverse normalized incomplete gamma function scalar invIncGamma(const scalar a, const scalar P); + + //- Normalized upper incomplete gamma function + scalar incGammaRatio_Q(const scalar a, const scalar x); + + //- Normalized lower incomplete gamma function + scalar incGammaRatio_P(const scalar a, const scalar x); + + //- Upper incomplete gamma function + scalar incGamma_Q(const scalar a, const scalar x); + + //- Lower incomplete gamma function + scalar incGamma_P(const scalar a, const scalar x); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/one/oneI.H b/src/OpenFOAM/primitives/one/oneI.H index fc81d4419761a95ce35398378cd7e019cd578563..97d074873603b1c89424a55edfe0443a611574fe 100644 --- a/src/OpenFOAM/primitives/one/oneI.H +++ b/src/OpenFOAM/primitives/one/oneI.H @@ -42,6 +42,25 @@ public: typedef arg2 type; }; +inline scalar operator+(const scalar& t, const one&) noexcept +{ + return t + 1; +} + +inline scalar operator+(const one&, const scalar& t) noexcept +{ + return 1 + t; +} + +inline scalar operator-(const scalar& t, const one&) noexcept +{ + return t - 1; +} + +inline scalar operator-(const one&, const scalar& t) noexcept +{ + return 1 - t; +} inline constexpr const one& operator*(const one& o, const one&) noexcept { @@ -83,6 +102,39 @@ inline constexpr const Type& operator/(const Type& val, const one&) noexcept return val; } +inline constexpr const one& min(const one& o, const one&) noexcept +{ + return o; +} + +template<class Type> +inline Type min(const one&, const Type& t) noexcept +{ + return min(scalar(1), t); +} + +template<class Type> +inline Type min(const Type& t, const one&) noexcept +{ + return min(t, scalar(1)); +} + +inline constexpr const one& max(const one& o, const one&) noexcept +{ + return o; +} + +template<class Type> +inline Type max(const one&, const Type& t) noexcept +{ + return max(scalar(1), t); +} + +template<class Type> +inline Type max(const Type& t, const one&) noexcept +{ + return max(t, scalar(1)); +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/zero/zeroI.H b/src/OpenFOAM/primitives/zero/zeroI.H index 9a5e4e32109a0a08e1005b89d94a5138a4eeb41c..843ff7c7063b1c86a2480a517c35c81572efc420 100644 --- a/src/OpenFOAM/primitives/zero/zeroI.H +++ b/src/OpenFOAM/primitives/zero/zeroI.H @@ -25,6 +25,9 @@ License \*---------------------------------------------------------------------------*/ +#include "zero.H" +#include "scalar.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -89,6 +92,39 @@ inline constexpr zero operator/(const zero&, const Type& val) noexcept return Zero; } +inline zero min(const zero&, const zero&) +{ + return Zero; +} + +template<class Type> +inline Type min(const zero&, const Type& t) +{ + return min(scalar(0), t); +} + +template<class Type> +inline Type min(const Type& t, const zero&) +{ + return min(t, scalar(0)); +} + +inline zero max(const zero&, const zero&) +{ + return Zero; +} + +template<class Type> +inline Type max(const zero&, const Type& t) +{ + return max(scalar(0), t); +} + +template<class Type> +inline Type max(const Type& t, const zero&) +{ + return max(t, scalar(0)); +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/TurbulenceModels/compressible/Make/files b/src/TurbulenceModels/compressible/Make/files index 44cc2ab1111101aa7b3d93882e07c37b47d4b9cf..50a25f81c57f10545c8a8ede8c99dd32dc8d0920 100644 --- a/src/TurbulenceModels/compressible/Make/files +++ b/src/TurbulenceModels/compressible/Make/files @@ -2,21 +2,22 @@ compressibleTurbulenceModel.C turbulentFluidThermoModels/turbulentFluidThermoModels.C BCs = turbulentFluidThermoModels/derivedFvPatchFields -$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C -$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C + $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C $(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C -$(BCs)/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C $(BCs)/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C $(BCs)/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C $(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C $(BCs)/fixedIncidentRadiation/fixedIncidentRadiationFvPatchScalarField.C -$(BCs)/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C $(BCs)/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.C $(BCs)/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.C -turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C -turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C -turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C +$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +$(BCs)/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +$(BCs)/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.C + +$(BCs)/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +$(BCs)/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModels diff --git a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H index f2e855bb2a1bbfe7c815dee03c79e5e482fe8c84..47dc8b27a073f49c42498e87d4e05051ef92f2a5 100644 --- a/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H +++ b/src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H @@ -160,14 +160,14 @@ public: // [kg/m/s] virtual tmp<volScalarField> alphaEff() const { - return alpha(); + return this->transport_.alphahe(); } //- Return the effective turbulent thermal diffusivity for enthalpy // for a patch [kg/m/s] virtual tmp<scalarField> alphaEff(const label patchi) const { - return alpha(patchi); + return this->transport_.alphahe(patchi); } }; diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 54211f54954950c92799ab34c477b4d4cf62ed78..ac87f1cb58fead6297e0fb1c2ee66fa6e400c10d 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -38,12 +38,12 @@ const Foam::Enum Foam::temperatureCoupledBase::KMethodType > Foam::temperatureCoupledBase::KMethodTypeNames_ -({ +{ { KMethodType::mtFluidThermo, "fluidThermo" }, { KMethodType::mtSolidThermo, "solidThermo" }, { KMethodType::mtDirectionalSolidThermo, "directionalSolidThermo" }, - { KMethodType::mtLookup, "lookup" }, -}); + { KMethodType::mtLookup, "lookup" } +}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -70,7 +70,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase ) : patch_(patch), - method_(KMethodTypeNames_.get("kappaMethod", dict)), + method_(KMethodTypeNames_.lookup("kappaMethod", dict)), kappaName_(dict.lookupOrDefault<word>("kappa", "none")), alphaAniName_(dict.lookupOrDefault<word>("alphaAni","none")) { @@ -127,6 +127,11 @@ Foam::temperatureCoupledBase::temperatureCoupledBase {} +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::temperatureCoupledBase::~temperatureCoupledBase() +{} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa @@ -169,13 +174,6 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa return thermo.kappa(patchi); } - else if (mesh.foundObject<basicThermo>("phaseProperties")) - { - const basicThermo& thermo = - mesh.lookupObject<basicThermo>("phaseProperties"); - - return thermo.kappa(patchi); - } else { FatalErrorInFunction @@ -193,26 +191,6 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa const solidThermo& thermo = mesh.lookupObject<solidThermo>(basicThermo::dictName); - if (!thermo.isotropic()) - { - word regionName = ""; - if (mesh.name() != polyMesh::defaultRegion) - { - regionName = " for region " + mesh.name(); - } - - const word& patchName = mesh.boundaryMesh()[patchi].name(); - - WarningInFunction - << "Applying isotropic thermal conductivity assumption to " - << "anisotropic model" << regionName << " at patch " - << patchName << nl - << "Consider using an isotropic conductivity model or " - << "set 'kappaMethod' to " - << KMethodTypeNames_[mtDirectionalSolidThermo] - << nl << endl; - } - return thermo.kappa(patchi); break; } @@ -269,6 +247,8 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa << exit(FatalError); } + + break; } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.H index ba0e5de79594b3608cf328e0a8e825e5f631dac7..4e7ff6af235c29bc73b3a4bbc07597bf76b54d4c 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.H @@ -38,6 +38,7 @@ Description - 'directionalSolidThermo': uses look up for volSymmTensorField for transformed kappa vector. Field name definable in 'alphaAni', named 'Anialpha' in solid solver by default + - 'phaseSystem' : used for multiphase thermos \par Keywords provided by this class: \table @@ -143,6 +144,9 @@ public: ); + //- Destructor + virtual ~temperatureCoupledBase(); + // Member functions //- Method to obtain K @@ -158,7 +162,7 @@ public: } //- Given patch temperature calculate corresponding K field - tmp<scalarField> kappa(const scalarField& Tp) const; + virtual tmp<scalarField> kappa(const scalarField& Tp) const; //- Write void write(Ostream&) const; diff --git a/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C b/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C index 8e0061a0efb30f429820abaa914d594d2c0423fb..b63bb5551ea9fbfc310f83afcf8a5ba82841096e 100644 --- a/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C +++ b/src/TurbulenceModels/phaseCompressible/LES/Niceno/NicenoKEqn.C @@ -28,6 +28,7 @@ License #include "NicenoKEqn.H" #include "fvOptions.H" #include "twoPhaseSystem.H" +#include "dragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -181,11 +182,13 @@ tmp<volScalarField> NicenoKEqn<BasicTurbulenceModel>::bubbleG() const refCast<const twoPhaseSystem>(liquid.fluid()); const transportModel& gas = fluid.otherPhase(liquid); + const dragModel& drag = fluid.lookupSubModel<dragModel>(gas, liquid); + volScalarField magUr(mag(this->U_ - gasTurbulence.U())); tmp<volScalarField> bubbleG ( - Cp_*sqr(magUr)*fluid.drag(gas).K()/liquid.rho() + Cp_*sqr(magUr)*drag.K()/liquid.rho() ); return bubbleG; diff --git a/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C index b0e1726dd1638303db4210a3af7fbf2b649143cf..35026c45386aa2a570a471554087b1632e8bd9f1 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C @@ -28,6 +28,7 @@ License #include "LaheyKEpsilon.H" #include "fvOptions.H" #include "twoPhaseSystem.H" +#include "dragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -191,6 +192,8 @@ tmp<volScalarField> LaheyKEpsilon<BasicTurbulenceModel>::bubbleG() const const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(liquid.fluid()); const transportModel& gas = fluid.otherPhase(liquid); + const dragModel& drag = fluid.lookupSubModel<dragModel>(gas, liquid); + volScalarField magUr(mag(this->U_ - gasTurbulence.U())); tmp<volScalarField> bubbleG @@ -198,7 +201,7 @@ tmp<volScalarField> LaheyKEpsilon<BasicTurbulenceModel>::bubbleG() const Cp_ *( pow3(magUr) - + pow(fluid.drag(gas).CdRe()*liquid.nu()/gas.d(), 4.0/3.0) + + pow(drag.CdRe()*liquid.nu()/gas.d(), 4.0/3.0) *pow(magUr, 5.0/3.0) ) *gas diff --git a/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C index a2af9e81def7bdd883edd9a67d82af7bf7f11c42..a6416c3dcab78618783f9071478572dc74b980ab 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C @@ -29,6 +29,7 @@ License #include "fvOptions.H" #include "twoPhaseSystem.H" #include "virtualMassModel.H" +#include "dragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -122,8 +123,11 @@ void continuousGasKEpsilon<BasicTurbulenceModel>::correctNut() const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(gas.fluid()); const transportModel& liquid = fluid.otherPhase(gas); + const virtualMassModel& virtualMass = + fluid.lookupSubModel<virtualMassModel>(gas, liquid); + volScalarField thetal(liquidTurbulence.k()/liquidTurbulence.epsilon()); - volScalarField rhodv(gas.rho() + fluid.virtualMass(gas).Cvm()*liquid.rho()); + volScalarField rhodv(gas.rho() + virtualMass.Cvm()*liquid.rho()); volScalarField thetag((rhodv/(18*liquid.rho()*liquid.nu()))*sqr(gas.d())); volScalarField expThetar ( @@ -206,12 +210,15 @@ continuousGasKEpsilon<BasicTurbulenceModel>::rhoEff() const const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(gas.fluid()); const transportModel& liquid = fluid.otherPhase(gas); + const virtualMassModel& virtualMass = + fluid.lookupSubModel<virtualMassModel>(gas, liquid); + return tmp<volScalarField> ( new volScalarField ( IOobject::groupName("rhoEff", this->alphaRhoPhi_.group()), - gas.rho() + (fluid.virtualMass(gas).Cvm() + 3.0/20.0)*liquid.rho() + gas.rho() + (virtualMass.Cvm() + 3.0/20.0)*liquid.rho() ) ); } diff --git a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C index 56efb0418677180d8275319914e58a1a6d47b80c..e9a51fc370fbe6bcbf532a47a8f26cae85e02180 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -29,6 +29,7 @@ License #include "fvOptions.H" #include "bound.H" #include "twoPhaseSystem.H" +#include "dragModel.H" #include "virtualMassModel.H" #include "fixedValueFvPatchFields.H" #include "inletOutletFvPatchFields.H" @@ -389,7 +390,7 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::Ct2() const volScalarField beta ( (6*this->Cmu_/(4*sqrt(3.0/2.0))) - *fluid.drag(gas).K()/liquid.rho() + *fluid.Kd()/liquid.rho() *(liquidTurbulence.k_/liquidTurbulence.epsilon_) ); volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho())); @@ -413,9 +414,11 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::rhogEff() const { const transportModel& gas = this->transport(); const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(gas.fluid()); + const virtualMassModel& virtualMass = + fluid.lookupSubModel<virtualMassModel>(gas, fluid.otherPhase(gas)); return gas.rho() - + fluid.virtualMass(gas).Cvm()*fluid.otherPhase(gas).rho(); + + virtualMass.Cvm()*fluid.otherPhase(gas).rho(); } @@ -491,6 +494,8 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const const twoPhaseSystem& fluid = refCast<const twoPhaseSystem>(gas.fluid()); const transportModel& liquid = fluid.otherPhase(gas); + const dragModel& drag = fluid.lookupSubModel<dragModel>(gas, liquid); + volScalarField magUr(mag(liquidTurbulence.U() - this->U())); // Lahey model @@ -500,7 +505,7 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const *liquid*liquid.rho() *( pow3(magUr) - + pow(fluid.drag(gas).CdRe()*liquid.nu()/gas.d(), 4.0/3.0) + + pow(drag.CdRe()*liquid.nu()/gas.d(), 4.0/3.0) *pow(magUr, 5.0/3.0) ) *gas @@ -510,7 +515,7 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const // Simple model // tmp<volScalarField> bubbleG // ( - // Cp_*liquid*fluid.drag(gas).K()*sqr(magUr) + // Cp_*liquid*drag.K()*sqr(magUr) // ); return bubbleG; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index b2f3dc0a8e6c64b0f8fbbf82e2d5bdf5696b3617..791ef91c32df96dd9394f605ada1758947b04f60 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -254,7 +254,6 @@ fields/surfaceFields/surfaceFields.C fvMatrices/fvMatrices.C fvMatrices/fvScalarMatrix/fvScalarMatrix.C fvMatrices/solvers/MULES/MULES.C -fvMatrices/solvers/MULES/CMULES.C fvMatrices/solvers/isoAdvection/isoCutCell/isoCutCell.C fvMatrices/solvers/isoAdvection/isoCutFace/isoCutFace.C fvMatrices/solvers/isoAdvection/isoAdvection/isoAdvection.C diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C index a014f65a6164d278f79c28a3ddabcd2dbbe3c641..45bfccec505b834bee8f234c5ab93ef070565a57 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C @@ -139,6 +139,24 @@ void Foam::fv::optionList::reset(const dictionary& dict) } +bool Foam::fv::optionList::appliesToField(const word& fieldName) const +{ + forAll(*this, i) + { + const option& source = this->operator[](i); + + label fieldi = source.applyToField(fieldName); + + if (fieldi != -1) + { + return true; + } + } + + return false; +} + + bool Foam::fv::optionList::read(const dictionary& dict) { return readOptions(optionsDict(dict)); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H index 73bd52eaf5d999db39f0b29f870a45c6abd5084e..20396da0b3d2cd927d1e4c306eefc16f8330521d 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H @@ -131,6 +131,9 @@ public: //- Reset the source list void reset(const dictionary& dict); + //- Return whether there is something to apply to the field + bool appliesToField(const word& fieldName) const; + // Sources diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 6afdf7879aa632866235cea080b8f7a56793b26e..81d68f052f0177287b3a6be85441ace9f935299e 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -37,7 +37,7 @@ namespace Foam // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::pimpleControl::read() +bool Foam::pimpleControl::read() { solutionControl::read(false); @@ -49,6 +49,8 @@ void Foam::pimpleControl::read() SIMPLErho_ = pimpleDict.lookupOrDefault("SIMPLErho", false); turbOnFinalIterOnly_ = pimpleDict.lookupOrDefault("turbOnFinalIterOnly", true); + + return true; } diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H index a485333d55640616e1817bc11c02f69a0aaa0477..dc7d64399e090dbe18f2e170a7dc2d9d1938fb09 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H @@ -97,7 +97,7 @@ protected: // Protected Member Functions //- Read controls from fvSolution dictionary - virtual void read(); + virtual bool read(); //- Return true if all convergence checks are satisfied virtual bool criteriaSatisfied(); diff --git a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C index ae4ff151013c1415b5ded516a67d7b8f13278927..000c1a9074b1d8d95f8852bf4a23868c3a4f3a69 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C @@ -38,9 +38,10 @@ namespace Foam // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::simpleControl::read() +bool Foam::simpleControl::read() { solutionControl::read(true); + return true; } diff --git a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H index 6a0553aea85b4e1cd70d89f34e9909b97da390c4..ff3bf34e745a3eb560334dd6c58f96b92d25481e 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.H @@ -65,7 +65,7 @@ protected: // Protected Member Functions //- Read controls from fvSolution dictionary - void read(); + bool read(); //- Return true if all convergence checks are satisfied bool criteriaSatisfied(); diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C index 6ca67ad5effb06e3c769aa63595d1c590a6167f7..c1d891b8be7f1ff34d883529a4178980cfb32350 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C @@ -37,7 +37,7 @@ namespace Foam // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::solutionControl::read(const bool absTolOnly) +bool Foam::solutionControl::read(const bool absTolOnly) { const dictionary solutionDict(this->dict()); @@ -127,12 +127,14 @@ void Foam::solutionControl::read(const bool absTolOnly) << " iniResid : " << fd.initialResidual << endl; } } + + return true; } -void Foam::solutionControl::read() +bool Foam::solutionControl::read() { - read(false); + return read(false); } @@ -200,6 +202,14 @@ void Foam::solutionControl::setFirstIterFlag } +bool Foam::solutionControl::writeData(Ostream&) const +{ + NotImplemented; + return false; +} + + + // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // template<class Type> @@ -260,11 +270,16 @@ Foam::Pair<Foam::scalar> Foam::solutionControl::maxResidual Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName) : - IOobject + regIOobject ( - "solutionControl", - mesh.time().timeName(), - mesh + IOobject + ( + typeName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ) ), mesh_(mesh), residualControl_(), diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.H b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.H index 5b33cda2a6a31415ab75756160cc128e94446f5b..1519249ebd4a7a61cb7387c7d3d2ebae716d623d 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.H @@ -48,7 +48,7 @@ namespace Foam class solutionControl : - public IOobject + public regIOobject { public: @@ -122,10 +122,10 @@ protected: // Protected Member Functions //- Read controls from fvSolution dictionary - virtual void read(const bool absTolOnly); + virtual bool read(const bool absTolOnly); //- Read controls from fvSolution dictionary - virtual void read(); + virtual bool read(); //- Return index of field in residualControl_ if present virtual label applyToField @@ -171,6 +171,9 @@ protected: const bool force = false ); + //- Dummy write for regIOobject + virtual bool writeData(Ostream&) const; + private: diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.H b/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.H index b50fdcf2f412c32912a7a22f193fd24d779410ab..da7eb08c14d41213206ba92cbc848b959f131fb4 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.H +++ b/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.H @@ -40,7 +40,6 @@ Description flux used in the bounded-solution. SourceFiles - CMULES.C CMULESTemplates.C \*---------------------------------------------------------------------------*/ @@ -68,35 +67,69 @@ void correct const RdeltaTType& rDeltaT, const RhoType& rho, volScalarField& psi, - const surfaceScalarField& phi, const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su ); +template<class RhoType> +void correct +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiCorr +); + template<class RhoType, class SpType, class SuType> void correct +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiCorr, + const SpType& Sp, + const SuType& Su +); + +template<class RhoType, class PsiMaxType, class PsiMinType> +void correct ( const RhoType& rho, volScalarField& psi, const surfaceScalarField& phi, surfaceScalarField& phiCorr, - const SpType& Sp, - const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void correct ( + const RhoType& rho, volScalarField& psi, const surfaceScalarField& phi, surfaceScalarField& phiCorr, - const scalar psiMax, - const scalar psiMin + const SpType& Sp, + const SuType& Su, + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); -template<class RdeltaTType, class RhoType, class SpType, class SuType> +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void limiterCorr ( scalarField& allLambda, @@ -107,11 +140,20 @@ void limiterCorr const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); -template<class RdeltaTType, class RhoType, class SpType, class SuType> + +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void limitCorr ( const RdeltaTType& rDeltaT, @@ -121,8 +163,8 @@ void limitCorr surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C index fd59d97b42bc11b4ad40f0369176f475477da09c..a616077b95285dce21fed387e1579c0a67ddb7e3 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C @@ -40,7 +40,6 @@ void Foam::MULES::correct const RdeltaTType& rDeltaT, const RhoType& rho, volScalarField& psi, - const surfaceScalarField& phi, const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su @@ -76,8 +75,67 @@ void Foam::MULES::correct } +template<class RhoType> +void Foam::MULES::correct +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiCorr +) +{ + correct(rho, psi, phiCorr, zeroField(), zeroField()); +} + + template<class RhoType, class SpType, class SuType> void Foam::MULES::correct +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiCorr, + const SpType& Sp, + const SuType& Su +) +{ + const fvMesh& mesh = psi.mesh(); + + if (fv::localEulerDdt::enabled(mesh)) + { + const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh); + correct(rDeltaT, rho, psi, phiCorr, Sp, Su); + } + else + { + const scalar rDeltaT = 1.0/mesh.time().deltaTValue(); + correct(rDeltaT, rho, psi, phiCorr, Sp, Su); + } +} + + +template<class RhoType, class PsiMaxType, class PsiMinType> +void Foam::MULES::correct +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiCorr, + const PsiMaxType& psiMax, + const PsiMinType& psiMin +) +{ + correct(rho, psi, phi, phiCorr, zeroField(), zeroField(), psiMax, psiMin); +} + + +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> +void Foam::MULES::correct ( const RhoType& rho, volScalarField& psi, @@ -85,8 +143,8 @@ void Foam::MULES::correct surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ) { const fvMesh& mesh = psi.mesh(); @@ -107,7 +165,8 @@ void Foam::MULES::correct psiMax, psiMin ); - correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su); + + correct(rDeltaT, rho, psi, phiCorr, Sp, Su); } else { @@ -126,12 +185,20 @@ void Foam::MULES::correct psiMin ); - correct(rDeltaT, rho, psi, phi, phiCorr, Sp, Su); + correct(rDeltaT, rho, psi, phiCorr, Sp, Su); } } -template<class RdeltaTType, class RhoType, class SpType, class SuType> +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void Foam::MULES::limiterCorr ( scalarField& allLambda, @@ -142,8 +209,8 @@ void Foam::MULES::limiterCorr const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ) { const scalarField& psiIf = psi; @@ -155,7 +222,7 @@ void Foam::MULES::limiterCorr const label nLimiterIter ( - MULEScontrols.get<label>("nLimiterIter") + readLabel(MULEScontrols.lookup("nLimiterIter")) ); const scalar smoothLimiter @@ -168,6 +235,20 @@ void Foam::MULES::limiterCorr MULEScontrols.lookupOrDefault<scalar>("extremaCoeff", 0) ); + const scalar boundaryExtremaCoeff + ( + MULEScontrols.lookupOrDefault<scalar> + ( + "boundaryExtremaCoeff", + extremaCoeff + ) + ); + + const scalar boundaryDeltaExtremaCoeff + ( + max(boundaryExtremaCoeff - extremaCoeff, 0) + ); + const labelUList& owner = mesh.owner(); const labelUList& neighb = mesh.neighbour(); tmp<volScalarField::Internal> tVsc = mesh.Vsc(); @@ -201,8 +282,11 @@ void Foam::MULES::limiterCorr surfaceScalarField::Boundary& lambdaBf = lambda.boundaryFieldRef(); - scalarField psiMaxn(psiIf.size(), psiMin); - scalarField psiMinn(psiIf.size(), psiMax); + scalarField psiMaxn(psiIf.size()); + scalarField psiMinn(psiIf.size()); + + psiMaxn = psiMin; + psiMinn = psiMax; scalarField sumPhip(psiIf.size(), Zero); scalarField mSumPhim(psiIf.size(), Zero); @@ -263,12 +347,20 @@ void Foam::MULES::limiterCorr } else { - forAll(phiCorrPf, pFacei) + // Add the optional additional allowed boundary extrema + if (boundaryDeltaExtremaCoeff > 0) { - const label pfCelli = pFaceCells[pFacei]; + forAll(phiCorrPf, pFacei) + { + const label pfCelli = pFaceCells[pFacei]; - psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiMax); - psiMinn[pfCelli] = min(psiMinn[pfCelli], psiMin); + const scalar extrema = + boundaryDeltaExtremaCoeff + *(psiMax[pfCelli] - psiMin[pfCelli]); + + psiMaxn[pfCelli] += extrema; + psiMinn[pfCelli] -= extrema; + } } } @@ -474,7 +566,15 @@ void Foam::MULES::limiterCorr } -template<class RdeltaTType, class RhoType, class SpType, class SuType> +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void Foam::MULES::limitCorr ( const RdeltaTType& rDeltaT, @@ -484,8 +584,8 @@ void Foam::MULES::limitCorr surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ) { const fvMesh& mesh = psi.mesh(); diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C index 7b2b8347c7e1d46404d353dd47477971dbf74b57..24b5349faec3efe2e808e638ed3030cfc78988cf 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.C @@ -30,28 +30,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Foam::MULES::explicitSolve -( - volScalarField& psi, - const surfaceScalarField& phi, - surfaceScalarField& phiPsi, - const scalar psiMax, - const scalar psiMin -) -{ - addProfiling(solve, "MULES::explicitSolve"); - - explicitSolve - ( - geometricOneField(), - psi, - phi, - phiPsi, - zeroField(), zeroField(), - psiMax, psiMin - ); -} - void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs) { @@ -102,4 +80,40 @@ void Foam::MULES::limitSum(UPtrList<scalarField>& phiPsiCorrs) } +void Foam::MULES::limitSum +( + const UPtrList<const scalarField>& alphas, + UPtrList<scalarField>& phiPsiCorrs, + const labelHashSet& fixed +) +{ + labelHashSet notFixed(identity(phiPsiCorrs.size())); + notFixed -= fixed; + + forAll(phiPsiCorrs[0], facei) + { + scalar alphaNotFixed = 0, corrNotFixed = 0; + forAllConstIter(labelHashSet, notFixed, iter) + { + alphaNotFixed += alphas[iter.key()][facei]; + corrNotFixed += phiPsiCorrs[iter.key()][facei]; + } + + scalar corrFixed = 0; + forAllConstIter(labelHashSet, fixed, iter) + { + corrFixed += phiPsiCorrs[iter.key()][facei]; + } + + const scalar sumCorr = corrNotFixed + corrFixed; + + const scalar lambda = - sumCorr/alphaNotFixed; + + forAllConstIter(labelHashSet, notFixed, iter) + { + phiPsiCorrs[iter.key()][facei] += lambda*alphas[iter.key()][facei]; + } + } +} + // ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H index 1acb417ffaa158369aafd395658d0592804b39e5..36e66f2a6fdf5a64b3dee4fd0887fc907e091d33 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULES.H @@ -52,6 +52,8 @@ SourceFiles #include "zero.H" #include "zeroField.H" #include "UPtrList.H" +#include "HashSet.H" +#include "UniformField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,6 +75,14 @@ void explicitSolve const SuType& Su ); +template<class RhoType> +void explicitSolve +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiPsi +); + template<class RhoType, class SpType, class SuType> void explicitSolve ( @@ -83,29 +93,48 @@ void explicitSolve const SuType& Su ); -template<class RhoType, class SpType, class SuType> +template<class RhoType, class PsiMaxType, class PsiMinType> void explicitSolve ( const RhoType& rho, volScalarField& psi, const surfaceScalarField& phiBD, surfaceScalarField& phiPsi, - const SpType& Sp, - const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); + +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void explicitSolve ( + const RhoType& rho, volScalarField& psi, const surfaceScalarField& phiBD, surfaceScalarField& phiPsi, - const scalar psiMax, - const scalar psiMin + const SpType& Sp, + const SuType& Su, + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); -template<class RdeltaTType, class RhoType, class SpType, class SuType> + +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void limiter ( scalarField& allLambda, @@ -116,11 +145,20 @@ void limiter const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ); -template<class RdeltaTType, class RhoType, class SpType, class SuType> + +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void limit ( const RdeltaTType& rDeltaT, @@ -130,8 +168,30 @@ void limit surfaceScalarField& phiPsi, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin, + const PsiMaxType& psiMax, + const PsiMinType& psiMin, + const bool returnCorr +); + + +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> +void limit +( + const RhoType& rho, + const volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su, + const PsiMaxType& psiMax, + const PsiMinType& psiMin, const bool returnCorr ); @@ -141,6 +201,20 @@ void limitSum(UPtrList<scalarField>& phiPsiCorrs); template<class SurfaceScalarFieldList> void limitSum(SurfaceScalarFieldList& phiPsiCorrs); +void limitSum +( + const UPtrList<const scalarField>& alphas, + UPtrList<scalarField>& phiPsiCorrs, + const labelHashSet& fixed +); + +template<class SurfaceScalarFieldList> +void limitSum +( + const SurfaceScalarFieldList& alphas, + SurfaceScalarFieldList& phiPsiCorrs, + const labelHashSet& fixed +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index eb5bbaa735ca665da50c0f541a10c204437e754c..9dc7265a72f00f0692f19170d456f959fe4fd5fd 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -80,6 +80,18 @@ void Foam::MULES::explicitSolve } +template<class RhoType> +void Foam::MULES::explicitSolve +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiPsi +) +{ + explicitSolve(rho, psi, phiPsi, zeroField(), zeroField()); +} + + template<class RhoType, class SpType, class SuType> void Foam::MULES::explicitSolve ( @@ -105,7 +117,39 @@ void Foam::MULES::explicitSolve } -template<class RhoType, class SpType, class SuType> +template<class RhoType, class PsiMaxType, class PsiMinType> +void Foam::MULES::explicitSolve +( + const RhoType& rho, + volScalarField& psi, + const surfaceScalarField& phiBD, + surfaceScalarField& phiPsi, + const PsiMaxType& psiMax, + const PsiMinType& psiMin +) +{ + explicitSolve + ( + rho, + psi, + phiBD, + phiPsi, + zeroField(), + zeroField(), + psiMax, + psiMin + ); +} + + +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void Foam::MULES::explicitSolve ( const RhoType& rho, @@ -114,8 +158,8 @@ void Foam::MULES::explicitSolve surfaceScalarField& phiPsi, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ) { const fvMesh& mesh = psi.mesh(); @@ -125,47 +169,27 @@ void Foam::MULES::explicitSolve if (fv::localEulerDdt::enabled(mesh)) { const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh); - - limit - ( - rDeltaT, - rho, - psi, - phi, - phiPsi, - Sp, - Su, - psiMax, - psiMin, - false - ); - + limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, false); explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su); } else { const scalar rDeltaT = 1.0/mesh.time().deltaTValue(); - - limit - ( - rDeltaT, - rho, - psi, - phi, - phiPsi, - Sp, - Su, - psiMax, - psiMin, - false - ); - + limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, false); explicitSolve(rDeltaT, rho, psi, phiPsi, Sp, Su); } } -template<class RdeltaTType, class RhoType, class SpType, class SuType> +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void Foam::MULES::limiter ( scalarField& allLambda, @@ -176,8 +200,8 @@ void Foam::MULES::limiter const surfaceScalarField& phiCorr, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin + const PsiMaxType& psiMax, + const PsiMinType& psiMin ) { const scalarField& psiIf = psi; @@ -202,6 +226,20 @@ void Foam::MULES::limiter MULEScontrols.lookupOrDefault<scalar>("extremaCoeff", 0) ); + const scalar boundaryExtremaCoeff + ( + MULEScontrols.lookupOrDefault<scalar> + ( + "boundaryExtremaCoeff", + extremaCoeff + ) + ); + + const scalar boundaryDeltaExtremaCoeff + ( + max(boundaryExtremaCoeff - extremaCoeff, 0) + ); + const scalarField& psi0 = psi.oldTime(); const labelUList& owner = mesh.owner(); @@ -237,8 +275,11 @@ void Foam::MULES::limiter scalarField& lambdaIf = lambda; surfaceScalarField::Boundary& lambdaBf = lambda.boundaryFieldRef(); - scalarField psiMaxn(psiIf.size(), psiMin); - scalarField psiMinn(psiIf.size(), psiMax); + scalarField psiMaxn(psiIf.size()); + scalarField psiMinn(psiIf.size()); + + psiMaxn = psiMin; + psiMinn = psiMax; scalarField sumPhiBD(psiIf.size(), Zero); @@ -305,12 +346,20 @@ void Foam::MULES::limiter } else { - forAll(phiCorrPf, pFacei) + // Add the optional additional allowed boundary extrema + if (boundaryDeltaExtremaCoeff > 0) { - const label pfCelli = pFaceCells[pFacei]; + forAll(phiCorrPf, pFacei) + { + const label pfCelli = pFaceCells[pFacei]; + + const scalar extrema = + boundaryDeltaExtremaCoeff + *(psiMax[pfCelli] - psiMin[pfCelli]); - psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiMax); - psiMinn[pfCelli] = min(psiMinn[pfCelli], psiMin); + psiMaxn[pfCelli] += extrema; + psiMinn[pfCelli] -= extrema; + } } } @@ -518,7 +567,15 @@ void Foam::MULES::limiter } -template<class RdeltaTType, class RhoType, class SpType, class SuType> +template +< + class RdeltaTType, + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> void Foam::MULES::limit ( const RdeltaTType& rDeltaT, @@ -528,8 +585,8 @@ void Foam::MULES::limit surfaceScalarField& phiPsi, const SpType& Sp, const SuType& Su, - const scalar psiMax, - const scalar psiMin, + const PsiMaxType& psiMax, + const PsiMinType& psiMin, const bool returnCorr ) { @@ -597,6 +654,42 @@ void Foam::MULES::limit } +template +< + class RhoType, + class SpType, + class SuType, + class PsiMaxType, + class PsiMinType +> +void Foam::MULES::limit +( + const RhoType& rho, + const volScalarField& psi, + const surfaceScalarField& phi, + surfaceScalarField& phiPsi, + const SpType& Sp, + const SuType& Su, + const PsiMaxType& psiMax, + const PsiMinType& psiMin, + const bool rtnCorr +) +{ + const fvMesh& mesh = psi.mesh(); + + if (fv::localEulerDdt::enabled(mesh)) + { + const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh); + limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, rtnCorr); + } + else + { + const scalar rDeltaT = 1.0/mesh.time().deltaTValue(); + limit(rDeltaT, rho, psi, phi, phiPsi, Sp, Su, psiMax, psiMin, rtnCorr); + } +} + + template<class SurfaceScalarFieldList> void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs) { @@ -633,4 +726,57 @@ void Foam::MULES::limitSum(SurfaceScalarFieldList& phiPsiCorrs) } +template<class SurfaceScalarFieldList> +void Foam::MULES::limitSum +( + const SurfaceScalarFieldList& alphas, + SurfaceScalarFieldList& phiPsiCorrs, + const labelHashSet& fixed +) +{ + { + UPtrList<const scalarField> alphasInternal(alphas.size()); + forAll(alphas, phasei) + { + alphasInternal.set(phasei, &alphas[phasei]); + } + UPtrList<scalarField> phiPsiCorrsInternal(phiPsiCorrs.size()); + forAll(phiPsiCorrs, phasei) + { + phiPsiCorrsInternal.set(phasei, &phiPsiCorrs[phasei]); + } + + limitSum(alphasInternal, phiPsiCorrsInternal, fixed); + } + + const surfaceScalarField::Boundary& bfld = + phiPsiCorrs[0].boundaryField(); + + forAll(bfld, patchi) + { + if (bfld[patchi].coupled()) + { + UPtrList<const scalarField> alphasPatch(alphas.size()); + forAll(alphas, phasei) + { + alphasPatch.set + ( + phasei, + &alphas[phasei].boundaryField()[patchi] + ); + } + UPtrList<scalarField> phiPsiCorrsPatch(phiPsiCorrs.size()); + forAll(phiPsiCorrs, phasei) + { + phiPsiCorrsPatch.set + ( + phasei, + &phiPsiCorrs[phasei].boundaryFieldRef()[patchi] + ); + } + + limitSum(alphasPatch, phiPsiCorrsPatch, fixed); + } + } +} // ************************************************************************* // diff --git a/src/functionObjects/solvers/scalarTransport/scalarTransport.C b/src/functionObjects/solvers/scalarTransport/scalarTransport.C index 8361fda6efd944614263e0f3ceccad75d0112ecb..d35274aea9f7fd77321e1a9637fe3b09ff2cd689 100644 --- a/src/functionObjects/solvers/scalarTransport/scalarTransport.C +++ b/src/functionObjects/solvers/scalarTransport/scalarTransport.C @@ -303,7 +303,15 @@ bool Foam::functionObjects::scalarTransport::execute() if (bounded01_) { - MULES::explicitSolve(s, phi, tTPhiUD.ref(), 1, 0); + MULES::explicitSolve + ( + geometricOneField(), + s, + phi, + tTPhiUD.ref(), + oneField(), + zeroField() + ); } } else if (phi.dimensions() == dimMass/dimTime) diff --git a/src/phaseSystemModels/Allwclean b/src/phaseSystemModels/Allwclean new file mode 100755 index 0000000000000000000000000000000000000000..8001ebf019dfbe6f13a28a898544d5f964b9e1d9 --- /dev/null +++ b/src/phaseSystemModels/Allwclean @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +wclean libso reactingEulerFoam/phaseSystems +wclean libso reactingEulerFoam/interfacialModels +wclean libso reactingEulerFoam/interfacialCompositionModels +wclean libso reactingEulerFoam/derivedFvPatchFields + +wclean libso reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem +wclean libso reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels + +wclean libso reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem +wclean libso reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels + +#------------------------------------------------------------------------------ diff --git a/src/phaseSystemModels/Allwmake b/src/phaseSystemModels/Allwmake new file mode 100755 index 0000000000000000000000000000000000000000..29e718a552f0509237d77754c2d1b374fcdbe158 --- /dev/null +++ b/src/phaseSystemModels/Allwmake @@ -0,0 +1,23 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +wmakeLnInclude reactingEulerFoam/interfacialCompositionModels +wmakeLnInclude reactingEulerFoam/interfacialModels +wmakeLnInclude reactingEulerFoam/derivedFvPatchFields + +wmake $targetType reactingEulerFoam/phaseSystems +wmake $targetType reactingEulerFoam/interfacialModels +wmake $targetType reactingEulerFoam/interfacialCompositionModels +wmake $targetType reactingEulerFoam/derivedFvPatchFields + +wmake $targetType reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem +wmake $targetType reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels + +wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem +wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels + + +#------------------------------------------------------------------------------ diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/files b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..2a775f26611030d4f8e81647ebfa6778d1f316f2 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/files @@ -0,0 +1,52 @@ +wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C +wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C +wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C +wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C +wallBoilingSubModels/partitioningModels/cosine/cosine.C +wallBoilingSubModels/partitioningModels/linear/linear.C + +wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C +wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C +wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C + +wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C +wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C +wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C +wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C + +wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C +wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C +wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C + +wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C +wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C +wallBoilingSubModels/CHFModels/Zuber/Zuber.C + +wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C +wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C +wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.C + +wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C +wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C +wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.C + +wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C +wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C +wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.C + +wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C +wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C +wallBoilingSubModels/MHFModels/Jeschar/Jeschar.C + +wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C +wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C +wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.C + +alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C +alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +copiedFixedValue/copiedFixedValueFvPatchScalarField.C +fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C + +LIB = $(FOAM_LIBBIN)/libreactingEulerianFvPatchFields diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options index b0d5064c76609e94d49a71d46e9ac64ba6dd4218..9fb98cf79419e19f6d145ff2524cafab8203ae1d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options @@ -1,9 +1,9 @@ EXE_INC = \ - -I../multiphaseSystem/lnInclude \ - -I../../phaseSystems/lnInclude \ - -I../../interfacialModels/lnInclude\ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I../phaseSystems/lnInclude \ + -I../interfacialModels/lnInclude\ + -I../interfacialCompositionModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ @@ -15,8 +15,6 @@ LIB_LIBS = \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ - -lcompressibleTurbulenceModels \ -lreactingPhaseSystem \ - -lreactingMultiphaseSystem \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C similarity index 79% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C index 736adcc24e031bd525bbd8b04affd1c34954e79a..4136ed05d399014f86914e5729c3e241e05cc3a7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,6 +46,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField ) : alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF), + vaporPhaseName_("vapor"), relax_(1.0), fixedDmdt_(0.0), L_(0.0) @@ -63,6 +64,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField ) : alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict), + vaporPhaseName_(dict.lookup("vaporPhase")), relax_(dict.lookupOrDefault<scalar>("relax", 1.0)), fixedDmdt_(dict.lookupOrDefault<scalar>("fixedDmdt", 0.0)), L_(dict.lookupOrDefault<scalar>("L", 0.0)) @@ -102,6 +104,7 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField L_(psf.L_) {} + alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField:: alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField ( @@ -118,6 +121,56 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +bool alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField:: +activePhasePair(const phasePairKey& phasePair) const +{ + if (phasePair == phasePairKey(vaporPhaseName_, internalField().group())) + { + return true; + } + else + { + return false; + } +} + + +const scalarField& alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField:: +dmdt(const phasePairKey& phasePair) const +{ + if (activePhasePair(phasePair)) + { + return dmdt_; + } + else + { + FatalErrorInFunction + << " dmdt requested for invalid phasePair!" + << abort(FatalError); + + return mDotL_; + } +} + + +const scalarField& alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField:: +mDotL(const phasePairKey& phasePair) const +{ + if (activePhasePair(phasePair)) + { + return mDotL_; + } + else + { + FatalErrorInFunction + << " mDotL requested for invalid phasePair!" + << abort(FatalError); + + return mDotL_; + } +} + + void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() { if (updated()) @@ -140,6 +193,7 @@ void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::write ) const { fvPatchField<scalar>::write(os); + os.writeEntry("vaporPhase", vaporPhaseName_); os.writeEntry("relax", relax_); os.writeEntry("fixedDmdt", fixedDmdt_); os.writeEntry("L", L_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H index 465a5c8b418edf239d942c996f13a94878d6bae8..1ba1389500e4dc32c8d4d65fd9bbf0a43c542bb2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,9 +27,6 @@ Class Foam::compressible:: alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField -Group - grpCmpWallFunctions - Description A simple alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField with a fixed volumetric phase-change mass flux. @@ -43,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef compressibleAlphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H -#define compressibleAlphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H +#ifndef alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H +#define alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField_H #include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H" @@ -65,6 +62,9 @@ class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField { // Private data + //- name on the phase + word vaporPhaseName_; + //- dmdt relaxationFactor scalar relax_; @@ -153,6 +153,15 @@ public: // Member functions + //- Is there phase change mass transfer for this phasePair + virtual bool activePhasePair(const phasePairKey&) const; + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& dmdt(const phasePairKey&) const; + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& mDotL(const phasePairKey&) const; + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C index 198da7da860541b8cbd0fa7d92759d405b0aaf43..a5f6c475cb17aba292423a6822122105799fcc5f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,9 +29,7 @@ License #include "fvPatchFieldMapper.H" #include "addToRunTimeSelectionTable.H" -#include "twoPhaseSystem.H" -#include "ThermalPhaseChangePhaseSystem.H" -#include "MomentumTransferPhaseSystem.H" +#include "phaseSystem.H" #include "compressibleTurbulenceModel.H" #include "ThermalDiffusivity.H" #include "PhaseCompressibleTurbulenceModel.H" @@ -73,7 +71,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::Psmooth const scalarField& Prat ) const { - return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat)); + return 9.24*(pow(Prat, 0.75) - 1)*(1 + 0.28*exp(-0.007*Prat)); } @@ -123,33 +121,24 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat const scalarField& prevAlphat ) const { + // Lookup the fluid model - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - >& fluid = - refCast - < - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - > - > - ( - db().lookupObject<phaseSystem>("phaseProperties") - ); + const phaseSystem& fluid = + db().lookupObject<phaseSystem>("phaseProperties"); - const phaseModel& liquid + const phaseModel& phase ( - fluid.phase1().name() == internalField().group() - ? fluid.phase1() - : fluid.phase2() + fluid.phases()[internalField().group()] ); const label patchi = patch().index(); // Retrieve turbulence properties from model - const phaseCompressibleTurbulenceModel& turbModel = liquid.turbulence(); + const phaseCompressibleTurbulenceModel& turbModel = + db().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName(turbulenceModel::propertiesName, phase.name()) + ); const scalar Cmu25 = pow025(Cmu_); @@ -158,7 +147,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat const tmp<scalarField> tmuw = turbModel.mu(patchi); const scalarField& muw = tmuw(); - const tmp<scalarField> talphaw = liquid.thermo().alpha(patchi); + const tmp<scalarField> talphaw = phase.thermo().alpha(patchi); const scalarField& alphaw = talphaw(); const tmp<volScalarField> tk = turbModel.k(); @@ -171,10 +160,10 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi]; const fvPatchScalarField& hew = - liquid.thermo().he().boundaryField()[patchi]; + phase.thermo().he().boundaryField()[patchi]; const fvPatchScalarField& Tw = - liquid.thermo().T().boundaryField()[patchi]; + phase.thermo().T().boundaryField()[patchi]; scalarField Tp(Tw.patchInternalField()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H index d9a628f2110c988e51c451835c98ecdd40e574a5..804d489eea09f215059bb98d0bee63454144108a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,9 +27,6 @@ Class Foam::compressible:: alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField -Group - grpCmpWallFunctions - Description This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usually\c alphat) based on the Jayatilleke model for @@ -64,8 +61,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef compressiblealphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H -#define compressiblealphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H +#ifndef compressible_alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H +#define compressible_alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField_H #include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" @@ -77,7 +74,7 @@ namespace compressible { /*---------------------------------------------------------------------------*\ - Class alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField Declaration + Class alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C similarity index 96% rename from src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C index a7681650f6b6165e2832f9ff9cb8b1b8429617be..d32403699f493a613fbf8069090b0e3d49d0066e 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,7 @@ namespace compressible // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(alphatPhaseChangeWallFunctionFvPatchScalarField,0); +defineTypeNameAndDebug(alphatPhaseChangeWallFunctionFvPatchScalarField, 0); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -122,7 +122,8 @@ alphatPhaseChangeWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void alphatPhaseChangeWallFunctionFvPatchScalarField::write(Ostream& os) const +void alphatPhaseChangeWallFunctionFvPatchScalarField:: +write(Ostream& os) const { fvPatchField<scalar>::write(os); dmdt_.writeEntry("dmdt", os); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H similarity index 78% rename from src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H index 9b2fd72a807446a8ce6c8e16047f058f05834966..1007f19358aa76aef3d39b5b438785b0c6edec43 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,9 +26,6 @@ License Class Foam::compressible::alphatPhaseChangeWallFunctionFvPatchScalarField -Group - grpCmpWallFunctions - Description Abstract base-class for all alphatWallFunctions supporting phase-change. @@ -41,10 +38,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef compressible_alphatPhaseChangeWallFunctionFvPatchScalarField_H -#define compressible_alphatPhaseChangeWallFunctionFvPatchScalarField_H +#ifndef alphatPhaseChangeWallFunctionFvPatchScalarField_H +#define alphatPhaseChangeWallFunctionFvPatchScalarField_H #include "fixedValueFvPatchFields.H" +#include "phasePairKey.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -123,13 +121,43 @@ public: // Member functions //- Return the rate of phase-change - const scalarField& dmdt() const + virtual const scalarField& dmdt() const { return dmdt_; } //- Return the enthalpy source due to phase-change - const scalarField& mDotL() const + virtual const scalarField& mDotL() const + { + return mDotL_; + } + + //- Is there phase change mass transfer for this phasePair + virtual bool activePhasePair(const phasePairKey&) const + { + return false; + } + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& dmdt(const phasePairKey&) const + { + return dmdt_; + } + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& mDotL(const phasePairKey&) const + { + return mDotL_; + } + + //- Return the rate of phase-change for specific phase + virtual scalarField dmdt(const word&) const + { + return dmdt_; + } + + //- Return the enthalpy source due to phase-change for specific phase + virtual scalarField mDotL(const word&) const { return mDotL_; } diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..bd4722a01b2be7cdf31b09255ea3f86245644bb7 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -0,0 +1,1408 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd + \\/ M anipulation | +------------------------------------------------------------------------------- + | Copyright (C) 2015-2018 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 "alphatWallBoilingWallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "addToRunTimeSelectionTable.H" + +#include "phaseSystem.H" +#include "compressibleTurbulenceModel.H" +#include "ThermalDiffusivity.H" +#include "PhaseCompressibleTurbulenceModel.H" +#include "saturationModel.H" +#include "wallFvPatch.H" +#include "uniformDimensionedFields.H" +#include "mathematicalConstants.H" + +using namespace Foam::constant::mathematical; + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const Foam::Enum +< + Foam::compressible:: + alphatWallBoilingWallFunctionFvPatchScalarField::phaseType +> +Foam::compressible:: +alphatWallBoilingWallFunctionFvPatchScalarField::phaseTypeNames_ +{ + { phaseType::vaporPhase, "vapor" }, + { phaseType::liquidPhase, "liquid" }, +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +alphatWallBoilingWallFunctionFvPatchScalarField:: +alphatWallBoilingWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF), + otherPhaseName_("vapor"), + phaseType_(liquidPhase), + relax_(0.5), + AbyV_(p.size(), 0), + alphatConv_(p.size(), 0), + dDep_(p.size(), 1e-5), + qq_(p.size(), 0), + K_(4), + partitioningModel_(nullptr), + nucleationSiteModel_(nullptr), + departureDiamModel_(nullptr), + departureFreqModel_(nullptr), + filmBoilingModel_(nullptr), + LeidenfrostModel_(nullptr), + CHFModel_(nullptr), + CHFSoobModel_(nullptr), + MHFModel_(nullptr), + TDNBModel_(nullptr), + wp_(1) +{ + AbyV_ = this->patch().magSf(); + forAll(AbyV_, facei) + { + const label faceCelli = this->patch().faceCells()[facei]; + AbyV_[facei] /= iF.mesh().V()[faceCelli]; + } +} + + +alphatWallBoilingWallFunctionFvPatchScalarField:: +alphatWallBoilingWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(p, iF, dict), + otherPhaseName_(dict.lookup("otherPhase")), + phaseType_(phaseTypeNames_.read(dict.lookup("phaseType"))), + relax_(dict.lookupOrDefault<scalar>("relax", 0.5)), + AbyV_(p.size(), 0), + alphatConv_(p.size(), 0), + dDep_(p.size(), 1e-5), + qq_(p.size(), 0), + K_(4), + partitioningModel_(nullptr), + nucleationSiteModel_(nullptr), + departureDiamModel_(nullptr), + departureFreqModel_(nullptr), + filmBoilingModel_(nullptr), + LeidenfrostModel_(nullptr), + CHFModel_(nullptr), + CHFSoobModel_(nullptr), + MHFModel_(nullptr), + TDNBModel_(nullptr), + wp_(1) +{ + + // Check that otherPhaseName != this phase + if (internalField().group() == otherPhaseName_) + { + FatalErrorInFunction + << "otherPhase should be the name of the vapor phase that " + << "corresponds to the liquid base of vice versa" << nl + << "This phase: " << internalField().group() << nl + << "otherPhase: " << otherPhaseName_ + << abort(FatalError); + } + + switch (phaseType_) + { + case vaporPhase: + { + partitioningModel_ = + wallBoilingModels::partitioningModel::New + ( + dict.subDict("partitioningModel") + ); + + const dictionary* LeidenfrostDict = + dict.findDict("LeidenfrostModel"); + + if (LeidenfrostDict) + { + LeidenfrostModel_ = + wallBoilingModels::LeidenfrostModel::New(*LeidenfrostDict); + } + + const dictionary* filmDict = dict.findDict("filmBoilingModel"); + + if (filmDict) + { + filmBoilingModel_ = + wallBoilingModels::filmBoilingModel::New(*filmDict); + } + + dmdt_ = 0; + + break; + } + case liquidPhase: + { + partitioningModel_ = + wallBoilingModels::partitioningModel::New + ( + dict.subDict("partitioningModel") + ); + + nucleationSiteModel_ = + wallBoilingModels::nucleationSiteModel::New + ( + dict.subDict("nucleationSiteModel") + ); + + departureDiamModel_ = + wallBoilingModels::departureDiameterModel::New + ( + dict.subDict("departureDiamModel") + ); + + departureFreqModel_ = + wallBoilingModels::departureFrequencyModel::New + ( + dict.subDict("departureFreqModel") + ); + + const dictionary* LeidenfrostDict = + dict.findDict("LeidenfrostModel"); + + if (LeidenfrostDict) + { + LeidenfrostModel_ = + wallBoilingModels::LeidenfrostModel::New(*LeidenfrostDict); + } + + const dictionary* CHFDict = dict.findDict("CHFModel"); + + if (CHFDict) + { + CHFModel_ = + wallBoilingModels::CHFModel::New(*CHFDict); + } + + const dictionary* HFSubCoolDict = dict.findDict("CHFSubCoolModel"); + + if (HFSubCoolDict) + { + CHFSoobModel_ = + wallBoilingModels::CHFSubCoolModel::New(*HFSubCoolDict); + } + + const dictionary* MHFDict = dict.findDict("MHFModel"); + + if (MHFDict) + { + MHFModel_ = + wallBoilingModels::MHFModel::New(*MHFDict); + } + + const dictionary* TDNBDict = dict.findDict("TDNBModel"); + + if (TDNBDict) + { + TDNBModel_ = + wallBoilingModels::TDNBModel::New(*TDNBDict); + } + + const dictionary* filmDict = dict.findDict("filmBoilingModel"); + + if (filmDict) + { + filmBoilingModel_ = + wallBoilingModels::filmBoilingModel::New(*filmDict); + } + + if (dict.found("dDep")) + { + dDep_ = scalarField("dDep", dict, p.size()); + } + + if (dict.found("K")) + { + dict.lookup("K") >> K_; + } + + if (dict.found("wp")) + { + dict.lookup("wp") >> wp_; + } + + if (dict.found("qQuenching")) + { + qq_ = scalarField("qQuenching", dict, p.size()); + } + + break; + } + } + + if (dict.found("alphatConv")) + { + alphatConv_ = scalarField("alphatConv", dict, p.size()); + } + + AbyV_ = this->patch().magSf(); + forAll(AbyV_, facei) + { + const label faceCelli = this->patch().faceCells()[facei]; + AbyV_[facei] /= iF.mesh().V()[faceCelli]; + } +} + + +alphatWallBoilingWallFunctionFvPatchScalarField:: +alphatWallBoilingWallFunctionFvPatchScalarField +( + const alphatWallBoilingWallFunctionFvPatchScalarField& psf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField + ( + psf, + p, + iF, + mapper + ), + otherPhaseName_(psf.otherPhaseName_), + phaseType_(psf.phaseType_), + relax_(psf.relax_), + AbyV_(psf.AbyV_), + alphatConv_(psf.alphatConv_, mapper), + dDep_(psf.dDep_, mapper), + qq_(psf.qq_, mapper), + K_(psf.K_), + partitioningModel_(psf.partitioningModel_), + nucleationSiteModel_(psf.nucleationSiteModel_), + departureDiamModel_(psf.departureDiamModel_), + filmBoilingModel_(psf.filmBoilingModel_), + LeidenfrostModel_(psf.LeidenfrostModel_), + CHFModel_(psf.CHFModel_), + CHFSoobModel_(psf.CHFSoobModel_), + MHFModel_(psf.MHFModel_), + TDNBModel_(psf.TDNBModel_), + wp_(psf.wp_) +{} + + +alphatWallBoilingWallFunctionFvPatchScalarField:: +alphatWallBoilingWallFunctionFvPatchScalarField +( + const alphatWallBoilingWallFunctionFvPatchScalarField& psf +) +: + alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf), + otherPhaseName_(psf.otherPhaseName_), + phaseType_(psf.phaseType_), + relax_(psf.relax_), + AbyV_(psf.AbyV_), + alphatConv_(psf.alphatConv_), + dDep_(psf.dDep_), + qq_(psf.qq_), + K_(psf.K_), + partitioningModel_(psf.partitioningModel_), + nucleationSiteModel_(psf.nucleationSiteModel_), + departureDiamModel_(psf.departureDiamModel_), + filmBoilingModel_(psf.filmBoilingModel_), + LeidenfrostModel_(psf.LeidenfrostModel_), + CHFModel_(psf.CHFModel_), + CHFSoobModel_(psf.CHFSoobModel_), + MHFModel_(psf.MHFModel_), + TDNBModel_(psf.TDNBModel_), + wp_(psf.wp_) +{} + + +alphatWallBoilingWallFunctionFvPatchScalarField:: +alphatWallBoilingWallFunctionFvPatchScalarField +( + const alphatWallBoilingWallFunctionFvPatchScalarField& psf, + const DimensionedField<scalar, volMesh>& iF +) +: + alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField(psf, iF), + otherPhaseName_(psf.otherPhaseName_), + phaseType_(psf.phaseType_), + relax_(psf.relax_), + AbyV_(psf.AbyV_), + alphatConv_(psf.alphatConv_), + dDep_(psf.dDep_), + qq_(psf.qq_), + K_(psf.K_), + partitioningModel_(psf.partitioningModel_), + nucleationSiteModel_(psf.nucleationSiteModel_), + departureDiamModel_(psf.departureDiamModel_), + filmBoilingModel_(psf.filmBoilingModel_), + LeidenfrostModel_(psf.LeidenfrostModel_), + CHFModel_(psf.CHFModel_), + CHFSoobModel_(psf.CHFSoobModel_), + MHFModel_(psf.MHFModel_), + TDNBModel_(psf.TDNBModel_), + wp_(psf.wp_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool alphatWallBoilingWallFunctionFvPatchScalarField:: +activePhasePair(const phasePairKey& phasePair) const +{ + if (phasePair == phasePairKey(otherPhaseName_, internalField().group())) + { + return true; + } + else + { + return false; + } +} + +const scalarField& alphatWallBoilingWallFunctionFvPatchScalarField:: +dmdt(const phasePairKey& phasePair) const +{ + if (activePhasePair(phasePair)) + { + return dmdt_; + } + else + { + FatalErrorInFunction + << " dmdt requested for invalid phasePair!" + << abort(FatalError); + + return dmdt_; + } +} + +const scalarField& alphatWallBoilingWallFunctionFvPatchScalarField:: +mDotL(const phasePairKey& phasePair) const +{ + if (activePhasePair(phasePair)) + { + return mDotL_; + } + else + { + FatalErrorInFunction + << " mDotL requested for invalid phasePair!" + << abort(FatalError); + + return mDotL_; + } +} + +void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() +{ + + if (updated()) + { + return; + } + + // Check that partitioningModel has been constructed + if (!partitioningModel_.valid()) + { + FatalErrorInFunction + << "partitioningModel has not been constructed!" + << abort(FatalError); + } + + // Lookup the fluid model + const phaseSystem& fluid = + refCast<const phaseSystem> + ( + db().lookupObject<phaseSystem>("phaseProperties") + ); + + const saturationModel& satModel = + db().lookupObject<saturationModel>("saturationModel"); + + const label patchi = patch().index(); + + switch (phaseType_) + { + case vaporPhase: + { + const phaseModel& vapor + ( + fluid.phases()[internalField().group()] + ); + + const fvPatchScalarField& hewv = + vapor.thermo().he().boundaryField()[patchi]; + + const phaseModel& liquid(fluid.phases()[otherPhaseName_]); + + const phaseCompressibleTurbulenceModel& turbModel = + db().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + liquid.name() + ) + ); + + const phaseCompressibleTurbulenceModel& vaporTurbModel = + db().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + vapor.name() + ) + ); + + const fvPatchScalarField& rhoVaporw = + vaporTurbModel.rho().boundaryField()[patchi]; + + // Vapor Liquid phase fraction at the wall + const scalarField vaporw(vapor.boundaryField()[patchi]); + + const fvPatchScalarField& Tw = + liquid.thermo().T().boundaryField()[patchi]; + const scalarField Tc(Tw.patchInternalField()); + + // Saturation temperature + const tmp<volScalarField> tTsat = + satModel.Tsat(liquid.thermo().p()); + const volScalarField& Tsat = tTsat(); + const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]); + const scalarField Tsatc(Tsatw.patchInternalField()); + + const fvPatchScalarField& hewl = + liquid.thermo().he().boundaryField()[patchi]; + + const fvPatchScalarField& pw = + liquid.thermo().p().boundaryField()[patchi]; + + const fvPatchScalarField& rhow = + turbModel.rho().boundaryField()[patchi]; + + const scalarField hw + ( + liquid.thermo().he().member() == "e" + ? hewl.patchInternalField() + pw/rhow.patchInternalField() + : hewl.patchInternalField() + ); + + const scalarField L + ( + vapor.thermo().he().member() == "e" + ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hw + : vapor.thermo().he(pw, Tsatc, patchi) - hw + ); + + // Film boiling models + + scalarField htcFilmBoiling(this->size(), 0); + scalarField TLeiden(this->size(), GREAT); + + if (filmBoilingModel_.valid() && LeidenfrostModel_.valid()) + { + // htc for film boiling + htcFilmBoiling = + filmBoilingModel_->htcFilmBoil + ( + liquid, + vapor, + patchi, + Tc, + Tsatw, + L + ); + + // Leidenfrost Temperature + TLeiden = + LeidenfrostModel_->TLeid + ( + liquid, + vapor, + patchi, + Tc, + Tsatw, + L + ); + } + + const scalarField qFilm(htcFilmBoiling*max(Tw - Tsatw, scalar(0))); + + // NOTE! Assumes 1-thisPhase for liquid fraction in + // multiphase simulations + const scalarField fLiquid + ( + partitioningModel_->fLiquid(1-vaporw) + ); + + const tmp<scalarField> talphaw = vapor.thermo().alpha(patchi); + const scalarField& alphaw = talphaw(); + + const scalarField heSnGrad(max(hewv.snGrad(), scalar(1e-16))); + + // Convective thermal diffusivity for single phase + const scalarField alphatv(calcAlphat(*this)); + + forAll (*this, i) + { + if (Tw[i] > TLeiden[i]) + { + this->operator[](i) = + ( + max + ( + (1 - fLiquid[i]) + *( + (qFilm[i]/heSnGrad[i]) + /max(vaporw[i], scalar(1e-8)) + - alphaw[i] + ), + -alphaw[i] + ) + ); + } + else + { + this->operator[](i) = + ( + (1 - fLiquid[i])*(alphatv[i]) + /max(vaporw[i], scalar(1e-8)) + ); + } + } + + if (debug) + { + Info<< "alphat for vapour : " << nl << endl; + + Info<< " alphatEffv: " << gMin(vaporw*(*this + alphaw)) + << " - " << gMax(vaporw*(*this + alphaw)) << endl; + + const scalarField qEff(vaporw*(*this + alphaw)*hewv.snGrad()); + + scalar Qeff = gSum(qEff*patch().magSf()); + Info<< " Effective heat transfer rate to vapor:" << Qeff + << nl << endl; + } + break; + } + case liquidPhase: + { + // Check that nucleationSiteModel has been constructed + if (!nucleationSiteModel_.valid()) + { + FatalErrorInFunction + << "nucleationSiteModel has not been constructed!" + << abort(FatalError); + } + + // Check that departureDiameterModel has been constructed + if (!departureDiamModel_.valid()) + { + FatalErrorInFunction + << "departureDiameterModel has not been constructed!" + << abort(FatalError); + } + + // Check that nucleationSiteModel has been constructed + if (!departureFreqModel_.valid()) + { + FatalErrorInFunction + << "departureFrequencyModel has not been constructed!" + << abort(FatalError); + } + + const phaseModel& liquid + ( + fluid.phases()[internalField().group()] + ); + + const phaseModel& vapor(fluid.phases()[otherPhaseName_]); + + // Retrieve turbulence properties from models + const phaseCompressibleTurbulenceModel& turbModel = + db().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + liquid.name() + ) + ); + const phaseCompressibleTurbulenceModel& vaporTurbModel = + db().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + vapor.name() + ) + ); + + const tmp<scalarField> tnutw = turbModel.nut(patchi); + + const scalar Cmu25(pow025(Cmu_)); + + const scalarField& y = turbModel.y()[patchi]; + + const tmp<scalarField> tmuw = turbModel.mu(patchi); + const scalarField& muw = tmuw(); + + const tmp<scalarField> talphaw = liquid.thermo().alphahe(patchi); + const scalarField& alphaw = talphaw(); + + const tmp<volScalarField> tk = turbModel.k(); + const volScalarField& k = tk(); + const fvPatchScalarField& kw = k.boundaryField()[patchi]; + + const fvPatchVectorField& Uw = + turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradUw(mag(Uw.snGrad())); + + const fvPatchScalarField& rhow = + turbModel.rho().boundaryField()[patchi]; + + + const fvPatchScalarField& Tw = + liquid.thermo().T().boundaryField()[patchi]; + const scalarField Tc(Tw.patchInternalField()); + + const scalarField uTau(Cmu25*sqrt(kw)); + + const scalarField yPlus(uTau*y/(muw/rhow)); + + const scalarField Pr(muw/alphaw); + + // Molecular-to-turbulent Prandtl number ratio + const scalarField Prat(Pr/Prt_); + + // Thermal sublayer thickness + const scalarField P(this->Psmooth(Prat)); + + const scalarField yPlusTherm(this->yPlusTherm(P, Prat)); + + const fvPatchScalarField& rhoVaporw = + vaporTurbModel.rho().boundaryField()[patchi]; + + tmp<volScalarField> tCp = liquid.thermo().Cp(); + const volScalarField& Cp = tCp(); + const fvPatchScalarField& Cpw = Cp.boundaryField()[patchi]; + + // Saturation temperature + const tmp<volScalarField> tTsat = + satModel.Tsat(liquid.thermo().p()); + + const volScalarField& Tsat = tTsat(); + const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]); + const scalarField Tsatc(Tsatw.patchInternalField()); + + const fvPatchScalarField& pw = + liquid.thermo().p().boundaryField()[patchi]; + + const fvPatchScalarField& hew = + liquid.thermo().he().boundaryField()[patchi]; + + const scalarField hw + ( + liquid.thermo().he().member() == "e" + ? hew.patchInternalField() + pw/rhow.patchInternalField() + : hew.patchInternalField() + ); + + const scalarField L + ( + vapor.thermo().he().member() == "e" + ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hw + : vapor.thermo().he(pw, Tsatc, patchi) - hw + ); + + // Liquid phase fraction at the wall + const scalarField liquidw(liquid.boundaryField()[patchi]); + + const scalarField fLiquid(partitioningModel_->fLiquid(liquidw)); + + for (label i=0; i<10; i++) + { + // Liquid temperature at y+=250 is estimated from logarithmic + // thermal wall function (Koncar, Krepper & Egorov, 2005) + const scalarField Tplus_y250(Prt_*(log(E_*250)/kappa_ + P)); + const scalarField Tplus(Prt_*(log(E_*yPlus)/kappa_ + P)); + scalarField Tl(Tw - (Tplus_y250/Tplus)*(Tw - Tc)); + Tl = max(Tc - 40, Tl); + + // Film, transient boiling regimes + scalarField Qtb(this->size(), 0); + scalarField tDNB(this->size(), GREAT); + scalarField TLeiden(this->size(), GREAT); + scalarField htcFilmBoiling(this->size(), 0); + + if + ( + CHFModel_.valid() + && CHFSoobModel_.valid() + && TDNBModel_.valid() + && MHFModel_.valid() + && LeidenfrostModel_.valid() + && filmBoilingModel_.valid() + ) + { + + const scalarField CHF + ( + CHFModel_->CHF + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ) + ); + + // Effect of sub-cooling to the CHF in saturated conditions + const scalarField CHFSubCool + ( + CHFSoobModel_->CHFSubCool + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ) + ); + + const scalarField CHFtotal(CHF*CHFSubCool); + + tDNB = + TDNBModel_->TDNB + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ); + + const scalarField MHF + ( + MHFModel_->MHF + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ) + ); + + TLeiden = + LeidenfrostModel_->TLeid + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ); + + // htc for film boiling + htcFilmBoiling = + filmBoilingModel_->htcFilmBoil + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ); + + // htc for film transition boiling + + // Indicator between CHF (phi = 0) and MHF (phi = 1) + const scalarField phi + ( + min + ( + max + ( + wp_*(Tw - tDNB)/(TLeiden - tDNB), + scalar(0) + ) + , scalar(1) + ) + ); + + Qtb = CHFtotal*(1 - phi) + phi*MHF; + } + + + // Sub-cool boiling Nucleation + const scalarField N + ( + nucleationSiteModel_->N + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ) + ); + + // Bubble departure diameter: + dDep_ = departureDiamModel_->dDeparture + ( + liquid, + vapor, + patchi, + Tl, + Tsatw, + L + ); + + // Bubble departure frequency: + const scalarField fDep + ( + departureFreqModel_->fDeparture + ( + liquid, + vapor, + patchi, + dDep_ + ) + ); + + // Convective thermal diffusivity for single phase + alphatConv_ = calcAlphat(alphatConv_); + + // Convective heat transfer area for Sub-cool boiling + scalarField A1(this->size(), 0); + + const scalarField hewSn(hew.snGrad()); + + scalarField alphaFilm(this->size(), 0); + + // Use to identify regimes per face + labelField regimeTypes(A1.size(), -1); + + forAll (*this, i) + { + if (Tw[i] > Tsatw[i]) + { + // Sub-cool boiling + if (Tw[i] < tDNB[i]) + { + // Sub-cool boiling + regimeTypes[i] = regimeType::subcool; + + Tl = (Tw - (Tplus_y250/Tplus)*(Tw - Tc)); + Tl = max(Tc - 40, Tl); + + // Area fractions: + + /* + // Del Valle & Kenning (1985) + const scalarField Ja + ( + rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L) + ); + + const scalarField Al + ( + fLiquid*4.8*exp(min(-Ja/80, log(VGREAT))) + ); + */ + + // More simple method to calculate area affected by + // bubbles + const scalar A2 + ( + min + ( + fLiquid[i]*pi*sqr(dDep_[i])*N[i]*K_/4, + scalar(1) + ) + ); + + A1[i] = max(1 - A2, 0.0); + + // Following Bowring(1962) + const scalar A2E + ( + min + ( + fLiquid[i]*pi*sqr(dDep_[i])*N[i], + scalar(5) + ) + ); + + // Volumetric mass source in the near wall cell due + // to the wall boiling + dmdt_[i] = + ( + (1 - relax_)*dmdt_[i] + + relax_*(1.0/6.0)*A2E*dDep_[i]*rhoVaporw[i] + * fDep[i]*AbyV_[i] + ); + + // Volumetric source in the near wall cell due to + // the wall boiling + mDotL_[i] = dmdt_[i]*L[i]; + + // Quenching heat transfer coefficient + const scalar hQ + ( + 2*(alphaw[i]*Cpw[i])*fDep[i] + *sqrt + ( + (0.8/fDep[i])/(pi*alphaw[i]/rhow[i]) + ) + ); + + // Quenching heat flux in Sub-cool boiling + qq_[i] = + ( + (1 - relax_)*qq_[i] + + relax_*A2*hQ*max(Tw[i] - Tl[i], scalar(0)) + ); + + this->operator[](i) = + ( + max + ( + A1[i]*alphatConv_[i] + + ( + (qq_[i] + mDotL_[i]/AbyV_[i]) + / max(hewSn[i], scalar(1e-16)) + ) + /max(liquidw[i], scalar(1e-8)), + 1e-8 + ) + ); + } + else if (Tw[i] > tDNB[i] && Tw[i] < TLeiden[i]) + { + // transient boiling + regimeTypes[i] = regimeType::transient; + + // No convective heat tranfer + alphatConv_[i] = 0.0; + + // transient boiling + dmdt_[i] = + fLiquid[i] + *( + relax_*Qtb[i]*AbyV_[i]/L[i] + + (1 - relax_)*dmdt_[i] + ); + + mDotL_[i] = dmdt_[i]*L[i]; + + // No quenching flux + //qq_[i] = 0.0; + + this->operator[](i) = + ( + max + ( + ( + mDotL_[i]/AbyV_[i] + /max(hewSn[i], scalar(1e-16)) + )/max(liquidw[i], scalar(1e-8)), + 1e-8 + ) + ); + } + else if (Tw[i] > TLeiden[i]) + { + regimeTypes[i] = regimeType::film; // film boiling + + // No convective heat tranfer + alphatConv_[i] = 0.0; + + // Film boiling + dmdt_[i] = + fLiquid[i] + *( + relax_*htcFilmBoiling[i] + *max(Tw[i] - Tsatw[i], 0)*AbyV_[i]/L[i] + + (1 - relax_)*dmdt_[i] + ); + + + mDotL_[i] = dmdt_[i]*L[i]; + + // No quenching flux + qq_[i] = 0.0; + + alphaFilm[i] = + ( + mDotL_[i]/AbyV_[i]/max(hewSn[i], scalar(1e-16)) + ); + + // alphat is added alphal and multiplied by phase + // alphaFilm is lower than alphal. Then we substract + // alpha and divide by phase to get alphaFilm + this->operator[](i) = + ( + (alphaFilm[i]/max(liquidw[i], scalar(1e-8)) + - alphaw[i]) + ); + } + } + else + { + // Tw below Tsat. No boiling single phase convection + // Single phase + regimeTypes[i] = regimeType::nonBoiling; + A1[i] = 1.0; + qq_[i] = 0.0; + mDotL_[i] = 0.0; + + // Turbulente thermal diffusivity for single phase. + this->operator[](i) = + ( + max + ( + fLiquid[i]*A1[i]*(alphatConv_[i]) + /max(liquidw[i], scalar(1e-8)), + 1e-16 + ) + ); + } + } + + scalarField TsupPrev(max((Tw - Tsatw), scalar(0))); + + // NOTE: lagging Tw update. + //const_cast<fvPatchScalarField&>(Tw).evaluate(); + scalarField TsupNew(max((Tw - Tsatw), scalar(0))); + + scalar maxErr(max(mag(TsupPrev - TsupNew))); + + if (debug) + { + const scalarField qEff + ( + liquidw*(*this + alphaw)*hew.snGrad() + ); + + Info<< "alphat for liquid: " << nl << endl; + + Info<< " alphatl: " << gMin((*this)) << " - " + << gMax((*this)) << endl; + + Info<< " dmdt: " << gMin((dmdt_)) << " - " + << gMax((dmdt_)) << endl; + + Info<< " alphatlEff: " << gMin(liquidw*(*this + alphaw)) + << " - " << gMax(liquidw*(*this + alphaw)) << endl; + + scalar Qeff = gSum(qEff*patch().magSf()); + Info<< " Effective heat transfer rate to liquid:" << Qeff + << endl; + + if (debug & 2) + { + scalar nSubCool(0); + scalar nTransient(0); + scalar nFilm(0); + scalar nNonBoiling(0); + + scalarField nSubCools(this->size(), 0); + scalarField nTransients(this->size(), 0); + scalarField nFilms(this->size(), 0); + scalarField nNonBoilings(this->size(), 0); + + forAll (*this, i) + { + switch (regimeTypes[i]) + { + case regimeType::subcool: + nSubCool++; + nSubCools[i] = 1; + break; + + case regimeType::transient: + nTransient++; + nTransients[i] = 1; + break; + + case regimeType::film: + nFilm++; + nFilms[i] = 1; + break; + + case regimeType::nonBoiling: + nNonBoiling++; + nNonBoilings[i] = 1; + break; + } + } + + Info<< "Sub Cool faces : " << nSubCool << endl; + Info<< "Transient faces : " << nTransient << endl; + Info<< "Film faces : " << nFilm << endl; + Info<< "Non Boiling faces : " << nNonBoiling << endl; + Info<< "Total faces : " << this->size() << endl; + + const scalarField qc + ( + nNonBoilings*fLiquid*A1*(alphatConv_ + alphaw) + *hew.snGrad() + ); + + scalar Qc = gSum(qc*patch().magSf()); + Info<< " Convective heat transfer:" << Qc << endl; + + const scalarField qFilm + ( + relax_*fLiquid*nFilms*htcFilmBoiling*(Tw - Tsatw) + ); + + scalar QFilm = gSum(qFilm*patch().magSf()); + Info<< " Film boiling heat transfer: " << QFilm << endl; + + Info<< " Htc Film Boiling coeff: " + << gMin(nFilms*htcFilmBoiling) + << " - " + << gMax(nFilms*htcFilmBoiling) << endl; + + scalar Qtbtot = + gSum(fLiquid*nTransients*Qtb*patch().magSf()); + Info<< " Transient boiling heat transfer:" << Qtbtot + << endl; + + Info<< " tDNB: " << gMin(tDNB) << " - " << gMax(tDNB) + << endl; + + scalar QsubCool = gSum + ( + fLiquid*nSubCools*(qq_ + qe())*patch().magSf() + ); + Info<< " Sub Cool boiling heat transfer:" << QsubCool + << endl; + + Info<< " N: " << gMin(nSubCools*N) << " - " + << gMax(nSubCools*N) << endl; + Info<< " dDep: " << gMin(nSubCools*dDep_) << " - " + << gMax(nSubCools*dDep_) << endl; + Info<< " fDep: " << gMin(nSubCools*fDep) << " - " + << gMax(nSubCools*fDep) << endl; + Info<< " A1: " << gMin(nSubCools*A1) << " - " + << gMax(nSubCools*A1) << endl; + + Info<< nl; + + } + + } + + if (maxErr < 1e-1) + { + if (i > 0) + { + Info<< "Wall boiling wall function iterations: " + << i + 1 << endl; + } + break; + } + + } + break; + } + default: + { + FatalErrorInFunction + << "Unknown phase type. Valid types are: " + << phaseTypeNames_ << nl << exit(FatalError); + } + } + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + + os.writeKeyword("phaseType") << phaseTypeNames_[phaseType_] + << token::END_STATEMENT << nl; + + os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; + + switch (phaseType_) + { + case vaporPhase: + { + os.writeKeyword("partitioningModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + partitioningModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + + if (filmBoilingModel_.valid()) + { + os.writeKeyword("filmBoilingModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + filmBoilingModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (LeidenfrostModel_.valid()) + { + os.writeKeyword("LeidenfrostModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + LeidenfrostModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + break; + } + case liquidPhase: + { + os.writeKeyword("partitioningModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + partitioningModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + + os.writeKeyword("nucleationSiteModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + nucleationSiteModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + + os.writeKeyword("departureDiamModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + departureDiamModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + + os.writeKeyword("departureFreqModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + departureFreqModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + + if (filmBoilingModel_.valid()) + { + os.writeKeyword("filmBoilingModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + filmBoilingModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (LeidenfrostModel_.valid()) + { + os.writeKeyword("LeidenfrostModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + LeidenfrostModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (CHFModel_.valid()) + { + os.writeKeyword("CHFModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + CHFModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (CHFSoobModel_.valid()) + { + os.writeKeyword("CHFSubCoolModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + CHFSoobModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (MHFModel_.valid()) + { + os.writeKeyword("MHFModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + MHFModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + if (TDNBModel_.valid()) + { + os.writeKeyword("TDNBModel") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + TDNBModel_->write(os); + os << decrIndent << indent << token::END_BLOCK << nl; + } + + os.writeKeyword("K") << K_ << token::END_STATEMENT << nl; + os.writeKeyword("wp") << wp_ << token::END_STATEMENT << nl; + break; + } + } + + os.writeKeyword("otherPhase") << otherPhaseName_ + << token::END_STATEMENT << nl; + + dmdt_.writeEntry("dmdt", os); + dDep_.writeEntry("dDep", os); + qq_.writeEntry("qQuenching", os); + alphatConv_.writeEntry("alphatConv", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + alphatWallBoilingWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H similarity index 54% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index 932c0faecb66b4d5c4833275163f77d23eefa012..aab97c57d6ca26c17e67bbeadf444ac9f001a0b4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -2,10 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,13 +26,34 @@ License Class Foam::compressible::alphatWallBoilingWallFunctionFvPatchScalarField -Group - grpCmpWallFunctions - Description - A thermal wall function for simulation of subcooled nucleate wall boiling - with runtime selctable submodels for: - - wall heat flux partitioning model + A thermal wall function for simulation of boiling wall. + + This alpha wall function can handle the following regimes: + single phase + subcooled nucleate wall boiling + transitional boiling + film boiling. + + The wall function uses a partition method to transfer heat either + to the liquid or vapor phase. At the moment, this function works + in a wall temperature fixed mode. i.e, there is no consideration + for the sudden change of heat transfer coefficient (htc) after + reaching TDBN (deviation from nucleate boiling temperature). + + References: + \verbatim + Numerical simulation of immersion quenching process of an engine cylinder head + Vedanth Srinivasan, Kil-Min Moon, David Greif, De Ming Wang, Myung-hwan Kim + Applied Mathematical Modelling 34 (2010) 2111-2128 + \endverbatim + + + For the single phase non-boiling regime the standard + JayatillekeWallFunction is used. + + For the sub-cool nucleate boiling regime the following runtime + selectable submodels are used: - nucleation site density - bubble departure frequency - bubble departure diameter @@ -59,6 +80,42 @@ Description Daejeon, Korea, September 10-12 2012 \endverbatim + + The transition boiling regime flux (TBF) is modelled following + a temperature based linear interpolation between the critical heat flux + (CHF) and the minimum heat flux (MHF) in such a way that when the wall + temperature is between the range of TDBN and the Leidenfrost temperature + (TLeiden) a linear interpolation is used between CHF and MHF. + + Thus, the following models are required: + LeidenfrostModel + CHFModel + CHFSubCoolModel + MHFModel + TDNBModel + filmBoilingModel + + The linear interpolation is as follows: + + TBF = CHF*phi + (1 - phi)*MHF + + where phi: + + phi = wp*(Tw - TDNB)/(TLeiden - TDNB), + + where: + wp model constant + Tw wall temperature + + + The film boiling regime is applied when Tw is larger than TLeiden. In + this regime the corrlation from the filmBoilingModel is used for + calculating the cht from the wall. + + The filmBoilingModel is needed in the vapor field in order to calculate + the heat transfer to the vapor phase in film boiling regime. + + Usage \table Property | Description | Required | Default value @@ -68,19 +125,30 @@ Usage Cmu | inherited from alphatPhaseChangeJayatillekeWallFunction kappa | inherited from alphatPhaseChangeJayatillekeWallFunction E | inherited from alphatPhaseChangeJayatillekeWallFunction - dmdt | phase change mass flux | yes | + dmdt | phase change mass flux | no | value | initial alphat value | yes | if phaseType 'vapor': - partitioningModel| | yes | + partitioningModel| | yes | + filmBoilingModel | | yes | + LeidenfrostModel | | yes | if phaseType 'liquid': - partitioningModel| | yes | - nucleationSiteModel| | yes | - departureDiamModel| | yes | - departureFreqModel| | yes | + partitioningModel| | yes | + nucleationSiteModel| | yes | + departureDiamModel| | yes | + departureFreqModel| | yes | + K | bubbles area constant| no | 4 + + LeidenfrostModel | | no | + CHFModel | | no | + CHFSubCoolModel | | no | + MHFModel | | no | + TDNBModel | | no | + filmBoilingModel | | no | + wp | | no | 1 \endtable NOTE: Runtime selectabale submodels may require model specific entries @@ -89,13 +157,13 @@ Usage \verbatim hotWall { - type compressible::alphatWallBoiling2WallFunction; + type compressible::alphatWallBoilingWallFunction; phaseType liquid; Prt 0.85; Cmu 0.09; kappa 0.41; E 9.8; - relax 0.001; + relax 0.1; dmdt uniform 0; partitioningModel { @@ -114,6 +182,34 @@ Usage { type Cole; } + + LeidenfrostModel + { + type Spiegler; + Tcrit 647; + } + CHFModel + { + type Zuber; + } + CHFSubCoolModel + { + type HuaXu; + Kburn 0.5; + } + MHFModel + { + type Jeschar; + Kmhf 1; + } + TDNBModel + { + type Schroeder; + } + filmBoilingModel + { + type Bromley; + } value uniform 0.01; \endverbatim @@ -125,8 +221,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef compressiblealphatWallBoilingWallFunctionFvPatchScalarField_H -#define compressiblealphatWallBoilingWallFunctionFvPatchScalarField_H +#ifndef compressible_alphatWallBoilingWallFunctionFvPatchScalarField_H +#define compressible_alphatWallBoilingWallFunctionFvPatchScalarField_H #include "alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H" #include "partitioningModel.H" @@ -134,6 +230,13 @@ SourceFiles #include "departureDiameterModel.H" #include "departureFrequencyModel.H" +#include "LeidenfrostModel.H" +#include "filmBoilingModel.H" +#include "CHFModel.H" +#include "CHFSubCoolModel.H" +#include "MHFModel.H" +#include "TDNBModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -165,6 +268,18 @@ private: // Private data + //- Enumeration of regimes per face + enum regimeType + { + subcool, + transient, + film, + nonBoiling + }; + + //- name of the other phase (vapor/liquid phase) + word otherPhaseName_; + //- Heat source type names static const Enum<phaseType> phaseTypeNames_; @@ -177,30 +292,63 @@ private: //- Patch face area by cell volume scalarField AbyV_; - //- Convective turbulent thermal diffusivity - scalarField alphatConv_; + // Sub-cooling nucleating boiling + + //- Convective turbulent thermal diffusivity + scalarField alphatConv_; + + //- Departure diameter field + scalarField dDep_; + + //- Quenching surface heat flux + scalarField qq_; - //- Departure diameter field - scalarField dDep_; + //- Model constant for area of bubbles + scalar K_; - //- Quenching surface heat flux - scalarField qq_; + //- Run-time selected heat flux partitioning model + autoPtr<wallBoilingModels::partitioningModel> + partitioningModel_; - //- Run-time selected heat flux partitioning model - autoPtr<wallBoilingModels::partitioningModel> - partitioningModel_; + //- Run-time selected nucleation site density model + autoPtr<wallBoilingModels::nucleationSiteModel> + nucleationSiteModel_; - //- Run-time selected nucleation site density model - autoPtr<wallBoilingModels::nucleationSiteModel> - nucleationSiteModel_; + //- Run-time selected bubble departure diameter model + autoPtr<wallBoilingModels::departureDiameterModel> + departureDiamModel_; - //- Run-time selected bubble departure diameter model - autoPtr<wallBoilingModels::departureDiameterModel> - departureDiamModel_; + //- Run-time selected bubble departure frequency model + autoPtr<wallBoilingModels::departureFrequencyModel> + departureFreqModel_; - //- Run-time selected bubble departure frequency model - autoPtr<wallBoilingModels::departureFrequencyModel> - departureFreqModel_; + + // Film boiling model + + //- Run-time selected for filmBoiling model + autoPtr<wallBoilingModels::filmBoilingModel> + filmBoilingModel_; + + // Transition boiling model + + //- Run-time selected for Leidenfrost tempearure + autoPtr<wallBoilingModels::LeidenfrostModel> + LeidenfrostModel_; + + //- Run-time selected for CHF + autoPtr<wallBoilingModels::CHFModel> CHFModel_; + + //- Run-time selected for CHF sub-cool + autoPtr<wallBoilingModels::CHFSubCoolModel> CHFSoobModel_; + + //- Run-time selected for MHF + autoPtr<wallBoilingModels::MHFModel> MHFModel_; + + //- Run-time selected for MHF + autoPtr<wallBoilingModels::TDNBModel> TDNBModel_; + + //- Wetting parameter for transient boiling + scalar wp_; public: @@ -274,6 +422,17 @@ public: // Member functions + using alphatPhaseChangeWallFunctionFvPatchScalarField::dmdt; + + //- Is there phase change mass transfer for this phasePair + virtual bool activePhasePair(const phasePairKey&) const; + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& dmdt(const phasePairKey&) const; + + //- Return the rate of phase-change for specific phase pair + virtual const scalarField& mDotL(const phasePairKey&) const; + //- Return the departure diameter field const scalarField& dDeparture() const { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C index 692a02a1d578108de4af889c025fce8351e0cc8c..37740829a1fe5a2068c9de694038dbed796cf39a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,7 +51,7 @@ Foam::copiedFixedValueFvPatchScalarField::copiedFixedValueFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), - sourceFieldName_(dict.lookup("sourceField")) + sourceFieldName_(dict.lookup("sourceFieldName")) {} @@ -111,7 +111,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs() void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); - os.writeEntry("sourceField", sourceFieldName_); + os.writeEntry("sourceFieldName", sourceFieldName_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H index 4f14532a85900d2d1e00a4235dc3003201c0cd11..e884331507d5792fb9084180205ffe6105c8cc1d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,9 +26,6 @@ License Class Foam::copiedFixedValueFvPatchScalarField -Group - grpCmpWallFunctions - Description Copies the boundary values from a user specified field. @@ -64,7 +61,6 @@ protected: word sourceFieldName_; - public: //- Runtime type information diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C index ab2f1b299d9af7708d18b8244e128942c49a872a..8f0e9e8f355dff86f7082a893a86617e7f86d24c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,9 +29,7 @@ License #include "fvPatchFieldMapper.H" #include "addToRunTimeSelectionTable.H" -#include "twoPhaseSystem.H" -#include "ThermalPhaseChangePhaseSystem.H" -#include "MomentumTransferPhaseSystem.H" +#include "phaseSystem.H" #include "compressibleTurbulenceModel.H" #include "ThermalDiffusivity.H" #include "PhaseCompressibleTurbulenceModel.H" @@ -47,7 +45,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField : fixedValueFvPatchScalarField(p, iF), q_(p.size(), Zero), - relax_(1.0) + relax_(1.0), + Tmin_(0.0) {} @@ -61,7 +60,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField : fixedValueFvPatchScalarField(p, iF, dict), q_("q", dict, p.size()), - relax_(dict.lookupOrDefault<scalar>("relax", 1.0)) + relax_(dict.lookupOrDefault<scalar>("relax", 1.0)), + Tmin_(dict.lookupOrDefault<scalar>("Tmin", 273)) {} @@ -76,7 +76,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField : fixedValueFvPatchScalarField(psf, p, iF, mapper), q_(psf.q_, mapper), - relax_(psf.relax_) + relax_(psf.relax_), + Tmin_(psf.Tmin_) {} @@ -88,7 +89,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField : fixedValueFvPatchScalarField(psf), q_(psf.q_), - relax_(psf.relax_) + relax_(psf.relax_), + Tmin_(psf.Tmin_) {} @@ -101,7 +103,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField : fixedValueFvPatchScalarField(psf, iF), q_(psf.q_), - relax_(psf.relax_) + relax_(psf.relax_), + Tmin_(psf.Tmin_) {} @@ -116,17 +119,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs() } // Lookup the fluid model - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - >& fluid = - refCast - < - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - > - > + const phaseSystem& fluid = ( db().lookupObject<phaseSystem>("phaseProperties") ); @@ -148,14 +141,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs() const fvPatchScalarField& T = thermo.T().boundaryField()[patch().index()]; - const scalarField kappaEff - ( - thermo.kappaEff - ( - phase.turbulence().alphat(patch().index()), - patch().index() - ) - ); + const scalarField kappaEff(phase.kappaEff(patch().index())); if (debug) { @@ -173,10 +159,11 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs() if (debug) { Info<< patch().name() << " " << ": overall heat flux " - << gMin(Q) << " - " << gMax(Q) << endl; + << gMin(Q) << " - " << gMax(Q) << " W/m2, power: " + << gSum(patch().magSf()*Q) << " W" << endl; } - operator==((1 - relax_)*Tp + relax_*(q_ + A)/(B)); + operator==((1 - relax_)*Tp + relax_*max(Tmin_,(q_ + A)/(B))); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H index 89c2a0ee029a8e7cee5b0ded1a5aa4ef6ba659b3..41a5e49fb1a568ee9d47cd325932564ddecd10d2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,9 +26,6 @@ License Class Foam::fixedMultiPhaseHeatFluxFvPatchScalarField -Group - grpCmpWallFunctions - Description Calculates a wall temperature that produces the specified overall wall heat flux across all the phases in an Eulerian multi-phase simulation. @@ -72,6 +69,9 @@ class fixedMultiPhaseHeatFluxFvPatchScalarField //- Relaxation factor scalar relax_; + //- Minimum temperature limit [K] + scalar Tmin_; + public: diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C similarity index 59% rename from src/finiteVolume/fvMatrices/solvers/MULES/CMULES.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C index 8280ae7551d580a589c14644d64a0403ba5a19fa..50b8b3c034fd7a2028d311ef4767f954f435b6a4 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/CMULES.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.C @@ -2,10 +2,8 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2013-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,28 +23,37 @@ License \*---------------------------------------------------------------------------*/ -#include "CMULES.H" +#include "CHFModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(CHFModel, 0); + defineRunTimeSelectionTable(CHFModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModel::CHFModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModel::~CHFModel() +{} + -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::MULES::correct -( - volScalarField& psi, - const surfaceScalarField& phi, - surfaceScalarField& phiPsiCorr, - const scalar psiMax, - const scalar psiMin -) +void Foam::wallBoilingModels::CHFModel::write(Ostream& os) const { - correct - ( - geometricOneField(), - psi, - phi, - phiPsiCorr, - zeroField(), zeroField(), - psiMax, psiMin - ); + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; } diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.H new file mode 100644 index 0000000000000000000000000000000000000000..bf4c8cb5d75649dd9e5dcbdaffc5b028f669b191 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/CHFModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels::CHFModel + +Description + Base class for nucleation site density models + +SourceFiles + CHFModel.C + newCHFModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CHFModel_H +#define CHFModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class CHFModel Declaration +\*---------------------------------------------------------------------------*/ + +class CHFModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + CHFModel(const CHFModel&); + + //- Disallow default bitwise assignment + void operator=(const CHFModel&); + + +public: + + //- Runtime type information + TypeName("CHFModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + CHFModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + CHFModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<CHFModel> New(const dictionary& dict); + + + //- Destructor + virtual ~CHFModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> CHF + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C similarity index 71% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C index 0cb364a808469544bc772acd60cd161eb681acb1..91f5a9b078431eed582a161cacfe87d060bf3eff 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/CHFModel/newCHFModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,27 +25,30 @@ License \*---------------------------------------------------------------------------*/ -#include "saturationModel.H" +#include "CHFModel.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New +Foam::autoPtr<Foam::wallBoilingModels::CHFModel> +Foam::wallBoilingModels::CHFModel::New ( const dictionary& dict ) { - const word modelType(dict.get<word>("type")); + word CHFModelType(dict.lookup("type")); - Info<< "Selecting saturationModel: " << modelType << endl; + Info<< "Selecting CHFModel: " + << CHFModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(CHFModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown saturationModel type " - << modelType << nl << nl - << "Valid saturationModel types :" << endl + << "Unknown CHFModelType type " + << CHFModelType << endl << endl + << "Valid CHFModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.C new file mode 100644 index 0000000000000000000000000000000000000000..ae19791a6ed34fbb30a0f1886bfb7f0a60504117 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.C @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "Zuber.H" +#include "addToRunTimeSelectionTable.H" +#include "uniformDimensionedFields.H" +#include "phasePairKey.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + defineTypeNameAndDebug(Zuber, 0); + addToRunTimeSelectionTable + ( + CHFModel, + Zuber, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::Zuber::Zuber +( + const dictionary& dict +) +: + CHFModel(), + Cn_(dict.lookupOrDefault<scalar>("Cn", 0.131)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::Zuber::~Zuber() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::CHFModels::Zuber::CHF +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + const uniformDimensionedVectorField& g = + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); + + const scalarField rhoVapor(vapor.thermo().rho(patchi)); + const scalarField rhoLiq(liquid.thermo().rho(patchi)); + + const phasePairKey pair(liquid.name(), vapor.name()); + const scalarField sigma + ( + liquid.fluid().sigma(pair)().boundaryField()[patchi] + ); + + return + Cn_*rhoVapor*L*pow + ( + sigma*mag(g.value())*(max(rhoLiq - rhoVapor, 0.0)/sqr(rhoVapor)), + 0.25 + ); +} + + +void Foam::wallBoilingModels::CHFModels::Zuber::write(Ostream& os) const +{ + CHFModel::write(os); + os.writeKeyword("Cn") << Cn_ << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // + + diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.H new file mode 100644 index 0000000000000000000000000000000000000000..f45da134157e6ac383d2016e956f9016d12091c7 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFModels/Zuber/Zuber.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:CHFModels:::Zuber + +Description + Critical heat flux (CHF) correlation + + References: + \verbatim + N. Zuber, On the stability of boiling heat transfer, + Trans. ASME 80 (1958) 711 + \endverbatim + +SourceFiles + Zuber.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Zuber_H +#define Zuber_H + +#include "CHFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + +/*---------------------------------------------------------------------------*\ + Class Zuber Declaration +\*---------------------------------------------------------------------------*/ + +class Zuber +: + public CHFModel +{ + + // Private data: + + //- Coefficient constant + scalar Cn_; + +public: + + //- Runtime type information + TypeName("Zuber"); + + // Constructors + + //- Construct from a dictionary + Zuber(const dictionary& dict); + + + //- Destructor + virtual ~Zuber(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> CHF + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace CHFModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C new file mode 100644 index 0000000000000000000000000000000000000000..5782f781c5b7896d2d60a0253c6a2a8e58700b82 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "CHFSubCoolModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(CHFSubCoolModel, 0); + defineRunTimeSelectionTable(CHFSubCoolModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFSubCoolModel::CHFSubCoolModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFSubCoolModel::~CHFSubCoolModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallBoilingModels::CHFSubCoolModel::write +( + Ostream& os +) const +{ + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.H new file mode 100644 index 0000000000000000000000000000000000000000..9fd0f3aef5e5343f503f7cfa98d51bba9d80072e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/CHFSubCoolModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::CHFModels::CHFSubCoolModel + +Description + Base class for nucleation site density models + +SourceFiles + CHFSubCoolModel.C + newCHFSubCoolModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CHFSubCoolModel_H +#define CHFSubCoolModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class CHFSubCoolModel Declaration +\*---------------------------------------------------------------------------*/ + +class CHFSubCoolModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + CHFSubCoolModel(const CHFSubCoolModel&); + + //- Disallow default bitwise assignment + void operator=(const CHFSubCoolModel&); + + +public: + + //- Runtime type information + TypeName("CHFSubCoolModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + CHFSubCoolModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + CHFSubCoolModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<CHFSubCoolModel> New(const dictionary& dict); + + + //- Destructor + virtual ~CHFSubCoolModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> CHFSubCool + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C new file mode 100644 index 0000000000000000000000000000000000000000..c670075a66bcee5f785186139c34d4661361a804 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/CHFSubCoolModel/newCHFSubCoolModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "CHFSubCoolModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallBoilingModels::CHFSubCoolModel> +Foam::wallBoilingModels::CHFSubCoolModel::New +( + const dictionary& dict +) +{ + word CHFModelType(dict.lookup("type")); + + Info<< "Selecting CHFSubCoolModel: " + << CHFModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(CHFModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown CHFModelType type " + << CHFModelType << endl << endl + << "Valid CHFSubCoolModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.C new file mode 100644 index 0000000000000000000000000000000000000000..6ec80838834f552f9f85e327798fa696b4af5096 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "HuaXu.H" +#include "addToRunTimeSelectionTable.H" +#include "uniformDimensionedFields.H" +#include "phasePairKey.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + defineTypeNameAndDebug(HuaXu, 0); + addToRunTimeSelectionTable + ( + CHFSubCoolModel, + HuaXu, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::HuaXu::HuaXu +( + const dictionary& dict +) +: + CHFSubCoolModel(), + Kburn_(dict.lookupOrDefault<scalar>("Kburn", 1.5)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::HuaXu::~HuaXu() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::CHFModels::HuaXu::CHFSubCool +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + const uniformDimensionedVectorField& g = + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); + + const scalarField alphaLiq(liquid.alpha(patchi)); + + const scalarField rhoVapor(vapor.thermo().rho(patchi)); + const scalarField rhoLiq(liquid.thermo().rho(patchi)); + tmp<volScalarField> tCp = liquid.thermo().Cp(); + const volScalarField& Cp = tCp(); + const fvPatchScalarField& Cpw = Cp.boundaryField()[patchi]; + + const phasePairKey pair(liquid.name(), vapor.name()); + const scalarField sigma + ( + liquid.fluid().sigma(pair)().boundaryField()[patchi] + ); + + const scalarField Pe + ( + pow(sigma, 0.75) + / + ( + alphaLiq + * pow(mag(g.value())*(rhoLiq-rhoVapor), 0.25) + * sqrt(rhoVapor) + ) + ); + + const scalarField Ja + ( + rhoLiq*Cpw*max(Tsatw - Tl, scalar(0))/(rhoVapor*L) + ); + + return + Kburn_*(1 + 0.345*Ja/pow(Pe, 0.25)); +} + + +void Foam::wallBoilingModels::CHFModels::HuaXu::write +( + Ostream& os +) const +{ + CHFSubCoolModel::write(os); + os.writeKeyword("Kburn") << Kburn_ << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // + + diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.H new file mode 100644 index 0000000000000000000000000000000000000000..d7b9c9e87bf04298bb4acdf108f2ad7e0435f926 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/CHFSubCoolModels/HuaXu/HuaXu.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:CHFModels:::HuaXu + +Description + + Critical heat flux for soob cool boiling flows. + + References: + \verbatim + T.C. Hua, J.J. Xu, Quenching boiling in subcooled liquid nitrogen + for solidification of aqueous materials, Mater. + Sci. Eng. A 292 (2000) 169–172. + \endverbatim + +SourceFiles + HuaXu.C + +\*---------------------------------------------------------------------------*/ + +#ifndef HuaXu_H +#define HuaXu_H + +#include "CHFSubCoolModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + +/*---------------------------------------------------------------------------*\ + Class HuaXu Declaration +\*---------------------------------------------------------------------------*/ + +class HuaXu +: + public CHFSubCoolModel +{ + + // Private data: + + //- Burn out factor + scalar Kburn_; + +public: + + //- Runtime type information + TypeName("HuaXu"); + + // Constructors + + //- Construct from a dictionary + HuaXu(const dictionary& dict); + + + //- Destructor + virtual ~HuaXu(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> CHFSubCool + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace CHFModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C new file mode 100644 index 0000000000000000000000000000000000000000..84b850ad75ff3b0d6ac0434523591b814c215400 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "LeidenfrostModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(LeidenfrostModel, 0); + defineRunTimeSelectionTable(LeidenfrostModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::LeidenfrostModel::LeidenfrostModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::LeidenfrostModel::~LeidenfrostModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallBoilingModels::LeidenfrostModel::write(Ostream& os) const +{ + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.H new file mode 100644 index 0000000000000000000000000000000000000000..ddecbc4e9ce909bb655bf5d7ba709f7096de56af --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/LeidenfrostModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels::LeidenfrostModel + +Description + Base class for nucleation site density models + +SourceFiles + LeidenfrostModel.C + newLeidenfrostModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LeidenfrostModel_H +#define LeidenfrostModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class LeidenfrostModel Declaration +\*---------------------------------------------------------------------------*/ + +class LeidenfrostModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + LeidenfrostModel(const LeidenfrostModel&); + + //- Disallow default bitwise assignment + void operator=(const LeidenfrostModel&); + + +public: + + //- Runtime type information + TypeName("LeidenfrostModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + LeidenfrostModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + LeidenfrostModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<LeidenfrostModel> New(const dictionary& dict); + + + //- Destructor + virtual ~LeidenfrostModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> TLeid + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C new file mode 100644 index 0000000000000000000000000000000000000000..2ddd99a335bc47b113cf632c784e33f9b27d0a7e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/LeidenfrostModel/newLeidenfrostModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "LeidenfrostModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallBoilingModels::LeidenfrostModel> +Foam::wallBoilingModels::LeidenfrostModel::New +( + const dictionary& dict +) +{ + word LeidenfrostModelType(dict.lookup("type")); + + Info<< "Selecting LeidenfrostModel: " + << LeidenfrostModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(LeidenfrostModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown LeidenfrostModelType type " + << LeidenfrostModelType << endl << endl + << "Valid LeidenfrostModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.C new file mode 100644 index 0000000000000000000000000000000000000000..1139a3ad9f0c8910a21eb9b08acd4006819fc524 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "Spiegler.H" +#include "addToRunTimeSelectionTable.H" +#include "uniformDimensionedFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace LeidenfrostModels +{ + defineTypeNameAndDebug(Spiegler, 0); + addToRunTimeSelectionTable + ( + LeidenfrostModel, + Spiegler, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::LeidenfrostModels::Spiegler::Spiegler +( + const dictionary& dict +) +: + LeidenfrostModel(), + Tcrit_(dict.lookupOrDefault<scalar>("Tcrit", 374)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::LeidenfrostModels::Spiegler::~Spiegler() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::LeidenfrostModels::Spiegler::TLeid +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + return tmp<scalarField> + ( + new scalarField + ( + liquid.thermo().p().boundaryField()[patchi].size(), + 27*Tcrit_/32 + ) + ); +} + + +void Foam::wallBoilingModels::LeidenfrostModels::Spiegler::write +( + Ostream& os +) const +{ + LeidenfrostModel::write(os); + os.writeKeyword("Tcrit") << Tcrit_ << token::END_STATEMENT << nl; +} + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.H new file mode 100644 index 0000000000000000000000000000000000000000..43e550782bcb50ce07e5d695c81f02f8aa934b6d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/LeidenfrostModels/Spiegler/Spiegler.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:LeidenfrostModels:::Spiegler + +Description + Leidenfrost temperature model. + + References: + \verbatim + SPIEGLER P., HOPENFELD J., SILBERBERG M., BUMPUS J. and NORMAN A., + Onset of stable film boiling and the foam limit, International + Journal of Heat and Mass Transfer, 6,11, pp.987-989, 1963 + \endverbatim + +SourceFiles + Spiegler.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Spiegler_H +#define Spiegler_H + +#include "LeidenfrostModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace LeidenfrostModels +{ + +/*---------------------------------------------------------------------------*\ + Class Spiegler Declaration +\*---------------------------------------------------------------------------*/ + +class Spiegler +: + public LeidenfrostModel +{ + +private: + + //- Critical temperature + scalar Tcrit_; + + +public: + + //- Runtime type information + TypeName("Spiegler"); + + // Constructors + + //- Construct from a dictionary + Spiegler(const dictionary& dict); + + + //- Destructor + virtual ~Spiegler(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> TLeid + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LeidenfrostModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.C new file mode 100644 index 0000000000000000000000000000000000000000..d454eeacd70b5c57fad37805028aaa5245589d8f --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.C @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "Jeschar.H" +#include "addToRunTimeSelectionTable.H" +#include "uniformDimensionedFields.H" +#include "phasePairKey.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + defineTypeNameAndDebug(Jeschar, 0); + addToRunTimeSelectionTable + ( + MHFModel, + Jeschar, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::Jeschar::Jeschar +( + const dictionary& dict +) +: + MHFModel(), + Kmhf_(dict.lookupOrDefault<scalar>("Kmhf", 1)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::CHFModels::Jeschar::~Jeschar() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::CHFModels::Jeschar::MHF +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + const uniformDimensionedVectorField& g = + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); + + const scalarField rhoVapor(vapor.thermo().rho(patchi)); + const scalarField rhoLiq(liquid.thermo().rho(patchi)); + + const phasePairKey pair(liquid.name(), vapor.name()); + const scalarField sigma + ( + liquid.fluid().sigma(pair)().boundaryField()[patchi] + ); + + return + Kmhf_*0.09*rhoVapor*L + *( + pow(sigma/(mag(g.value())*(rhoLiq - rhoVapor)), 0.25) + * sqrt(mag(g.value())*(rhoLiq - rhoVapor)/(rhoLiq + rhoVapor)) + ); +} + + +void Foam::wallBoilingModels::CHFModels::Jeschar::write +( + Ostream& os +) const +{ + MHFModel::write(os); + os.writeKeyword("Kmhf") << Kmhf_ << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // + + diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.H new file mode 100644 index 0000000000000000000000000000000000000000..5fc354cf2d5e43e97ea6f9a332ed5e0f6b0820be --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/Jeschar/Jeschar.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:MHFModels:::Jeschar + +Description + Minimum heat flux (MHF) model. + + References: + \verbatim + Jeschar, E. Specht, C. Kohler, Heat Transfer during Cooling of + Heated Metallic Objects with Evaporating Liquids, + Theory and Technology in Quenching, Springer, 1992. Chapter 4. + \endverbatim + +SourceFiles + Jeschar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Jeschar_H +#define Jeschar_H + +#include "MHFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace CHFModels +{ + +/*---------------------------------------------------------------------------*\ + Class Jeschar Declaration +\*---------------------------------------------------------------------------*/ + +class Jeschar +: + public MHFModel +{ + + // Private data: + + //- Burn out factor + scalar Kmhf_; + +public: + + //- Runtime type information + TypeName("Jeschar"); + + // Constructors + + //- Construct from a dictionary + Jeschar(const dictionary& dict); + + + //- Destructor + virtual ~Jeschar(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> MHF + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace CHFModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C new file mode 100644 index 0000000000000000000000000000000000000000..f89a80220c4d84b52b7141f93471f33a3860622b --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "MHFModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(MHFModel, 0); + defineRunTimeSelectionTable(MHFModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::MHFModel::MHFModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::MHFModel::~MHFModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallBoilingModels::MHFModel::write(Ostream& os) const +{ + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.H new file mode 100644 index 0000000000000000000000000000000000000000..2a1d06016e7121e2bb81b6ced6196a0b74f0de0a --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/MHFModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::MHFModels::MHFModel + +Description + Base class for nucleation site density models + +SourceFiles + MHFModel.C + newMHFModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef MHFModel_H +#define MHFModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class MHFModel Declaration +\*---------------------------------------------------------------------------*/ + +class MHFModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + MHFModel(const MHFModel&); + + //- Disallow default bitwise assignment + void operator=(const MHFModel&); + + +public: + + //- Runtime type information + TypeName("MHFModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + MHFModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + MHFModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<MHFModel> New(const dictionary& dict); + + + //- Destructor + virtual ~MHFModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> MHF + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C similarity index 72% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C index 74869ce625546031bb13a9ad5be474efbec1fb4f..742629380eb0aa3c1113ee1d9400cad1363f3862 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/MHFModels/MHFModel/newMHFModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -25,28 +25,30 @@ License \*---------------------------------------------------------------------------*/ -#include "departureFrequencyModel.H" +#include "MHFModel.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::wallBoilingModels::departureFrequencyModel> -Foam::wallBoilingModels::departureFrequencyModel::New +Foam::autoPtr<Foam::wallBoilingModels::MHFModel> +Foam::wallBoilingModels::MHFModel::New ( const dictionary& dict ) { - const word modelType(dict.get<word>("type")); + word MHFModelType(dict.lookup("type")); - Info<< "Selecting departureFrequencyModel: " << modelType << endl; + Info<< "Selecting MHFModel: " + << MHFModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(MHFModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown departureFrequencyModel type " - << modelType << nl << nl - << "Valid departureFrequencyModel types :" << endl + << "Unknown MHFModelType type " + << MHFModelType << endl << endl + << "Valid MHFModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.C new file mode 100644 index 0000000000000000000000000000000000000000..057cc7f9087189fb3dc3fe7948a4f733cb2b46f5 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "Schroeder.H" +#include "addToRunTimeSelectionTable.H" +#include "physicoChemicalConstants.H" + +using Foam::constant::physicoChemical::R; + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace TDNBModels +{ + defineTypeNameAndDebug(Schroeder, 0); + addToRunTimeSelectionTable + ( + TDNBModel, + Schroeder, + dictionary + ); +} +} +} + +using Foam::constant::physicoChemical::R; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::TDNBModels::Schroeder::Schroeder +( + const dictionary& dict +) +: + TDNBModel(), + kg_(dict.lookupOrDefault<scalar>("kg", 5/3)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::TDNBModels::Schroeder::~Schroeder() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::TDNBModels::Schroeder::TDNB +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + // Converting from g/mol to Kg/mol + const scalarField W(1e-3*liquid.thermo().W()().boundaryField()[patchi]); + + // isoentropic expansion factor for ideal gases + + return + Tsatw + / + ( + 1 - log(2*kg_ + 1)*(R.value()*Tsatw)/(W*L) + ); +} + + +void Foam::wallBoilingModels::TDNBModels::Schroeder::write +( + Ostream& os +) const +{ + TDNBModel::write(os); + os.writeKeyword("kg") << kg_ << token::END_STATEMENT << nl; +} + +// ************************************************************************* // + + diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.H new file mode 100644 index 0000000000000000000000000000000000000000..bd61bf589ddff65a0ea209588694dbad104a1d34 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/Schroeder/Schroeder.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:TDNBModels:::Schroeder + +Description + Departure from nulceate boiling correlation. + + References: + \verbatim + Schroeder-Richter D. and Bartsch G. Analytical calculation of + DNB-superheating by a pos-tulated thermo-mechanical effect of + nucleate boiling. + International Journal of Multiphase Flow, 20(6):1143–1167, 1994. + + \endverbatim + + + \verbatim + THEORETICAL CRITICAL HEAT FLUX PREDICTION BASEDNON-EQUILIBRIUM + THERMODYNAMICS CONSIDERATIONSTHE SUBCOOLED BOILING PHENOMENON + + GermaÌn Thelera and Daniel Freisba TECNA + Estudios y Proyectos de IngenierıÌa S.A. + EncarnacioÌn Ezcurra 365, C1107CLA Buenos Aires, Argentina + Westinghouse + Electric Germany GmbH + Dudenstraße 44, 68167 Mannheim, Germany + \endverbatim + + +SourceFiles + Schroeder.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Schroeder_H +#define Schroeder_H + +#include "TDNBModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace TDNBModels +{ + +/*---------------------------------------------------------------------------*\ + Class Schroeder Declaration +\*---------------------------------------------------------------------------*/ + +class Schroeder +: + public TDNBModel +{ + + // Private data: + + //- Isoentropic expansion factor for ideal gases + // 5/3 monoatomic + // 7/5 diatomic + scalar kg_; + +public: + + //- Runtime type information + TypeName("Schroeder"); + + // Constructors + + //- Construct from a dictionary + Schroeder(const dictionary& dict); + + + //- Destructor + virtual ~Schroeder(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> TDNB + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace TDNBModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C new file mode 100644 index 0000000000000000000000000000000000000000..4eef271ef0e7f5f42d0c6a04b07f8564e8d086be --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "TDNBModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(TDNBModel, 0); + defineRunTimeSelectionTable(TDNBModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::TDNBModel::TDNBModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::TDNBModel::~TDNBModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallBoilingModels::TDNBModel::write(Ostream& os) const +{ + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e2d931c7e1ba8c2b4c8a6f7e5d9d95ba76429438 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/TDNBModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels::TDNBModel + +Description + Base class for nucleation site density models + +SourceFiles + TDNBModel.C + newTDNBModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TDNBModel_H +#define TDNBModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class TDNBModel Declaration +\*---------------------------------------------------------------------------*/ + +class TDNBModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + TDNBModel(const TDNBModel&); + + //- Disallow default bitwise assignment + void operator=(const TDNBModel&); + + +public: + + //- Runtime type information + TypeName("TDNBModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + TDNBModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + TDNBModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<TDNBModel> New(const dictionary& dict); + + + //- Destructor + virtual ~TDNBModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> TDNB + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C similarity index 72% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C index 51d10afe16ed66cbd4000d0083bb268f4dd99388..92553f81d446792ac776363c5cdae1dafe14ec8d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/TDNBModels/TDNBModel/newTDNBModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2018 OpenCFD Ltd \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2016 OpenFOAM Foundation @@ -25,28 +25,30 @@ License \*---------------------------------------------------------------------------*/ -#include "departureDiameterModel.H" +#include "TDNBModel.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::wallBoilingModels::departureDiameterModel> -Foam::wallBoilingModels::departureDiameterModel::New +Foam::autoPtr<Foam::wallBoilingModels::TDNBModel> +Foam::wallBoilingModels::TDNBModel::New ( const dictionary& dict ) { - const word modelType(dict.get<word>("type")); + word TDNBModelType(dict.lookup("type")); - Info<< "Selecting departureDiameterModel: " << modelType << endl; + Info<< "Selecting TDNBModel: " + << TDNBModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(TDNBModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown departureDiameterModel type " - << modelType << nl << nl - << "Valid departureDiameterModel types :" << endl + << "Unknown TDNBModelType type " + << TDNBModelType << endl << endl + << "Valid TDNBModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C index 7f27320f793258269ec074ff56c029f5084ef134..9986f7a5323fbee9299309eed36eed11e4643261 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +27,7 @@ License #include "KocamustafaogullariIshii.H" #include "addToRunTimeSelectionTable.H" -#include "gravityMeshObject.H" +#include "uniformDimensionedFields.H" #include "compressibleTurbulenceModel.H" #include "ThermalDiffusivity.H" #include "PhaseCompressibleTurbulenceModel.H" @@ -62,7 +62,7 @@ KocamustafaogullariIshii::KocamustafaogullariIshii ) : departureDiameterModel(), - phi_(dict.get<scalar>("phi")) + phi_(readScalar(dict.lookup("phi"))) {} @@ -89,26 +89,23 @@ KocamustafaogullariIshii::dDeparture { // Gravitational acceleration const uniformDimensionedVectorField& g = - meshObjects::gravity::New(liquid.mesh().time()); + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); - const fvPatchScalarField& rhoLiquid = - liquid.turbulence().rho().boundaryField()[patchi]; + const scalarField rhoLiquid(liquid.thermo().rho(patchi)); + const scalarField rhoVapor(vapor.thermo().rho(patchi)); - const fvPatchScalarField& rhoVapor = - vapor.turbulence().rho().boundaryField()[patchi]; - - const scalarField rhoM((rhoLiquid-rhoVapor)/rhoVapor); + const scalarField rhoM((rhoLiquid - rhoVapor)/rhoVapor); const tmp<volScalarField>& tsigma ( - liquid.fluid().sigma(phasePairKey(liquid.name(),vapor.name())) + liquid.fluid().sigma(phasePairKey(liquid.name(), vapor.name())) ); const volScalarField& sigma = tsigma(); const fvPatchScalarField& sigmaw = sigma.boundaryField()[patchi]; return - 0.0012*pow(rhoM,0.9)*0.0208*phi_ - *sqrt(sigmaw/(mag(g.value())*(rhoLiquid-rhoVapor))); + 0.0012*pow(rhoM, 0.9)*0.0208*phi_ + *sqrt(sigmaw/(mag(g.value())*(rhoLiquid - rhoVapor))); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H index c7280e70014c92f3eaf91b0df922aa38b55619dd..4f426f0d9f56c4c3ea5432f551a258c163483a34 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C index dca7c97b6357a1ccb6680d48350b7b596025d52e..a215b5685afc2abb61575050337e21235a0c5e13 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -84,7 +84,7 @@ TolubinskiKostanchuk::dDeparture const scalarField& L ) const { - return max(min(dRef_*exp(-(Tsatw-Tl)/45), dMax_), dMin_); + return max(min(dRef_*exp(-(Tsatw - Tl)/45), dMax_), dMin_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H index 529b34378bc4dc032b9452bd564478e577551e6b..7bf273154766c6dad50b01ee53a35791e7e93375 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C index 84baf072ef9a620ee9411bfb5bdf82444ff2c363..ea652512251a259c7d956f350e187fb53fa3a513 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H index b78dc59caa85dfde2d128023e81120a7f89864fa..4b8d47e4773b445b4c7d632b86f470a2ed976334 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::departureDiameterModel + Foam::wallBoilingModels::departureDiameterModel Description Base class for bubble departure diameter models @@ -59,11 +59,11 @@ class departureDiameterModel { // Private Member Functions - //- No copy construct - departureDiameterModel(const departureDiameterModel&) = delete; + //- Disallow default bitwise copy construct + departureDiameterModel(const departureDiameterModel&); - //- No copy assignment - void operator=(const departureDiameterModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const departureDiameterModel&); public: diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C new file mode 100644 index 0000000000000000000000000000000000000000..c7e8b723c957e278a902c177f74d6153f67b98f6 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "departureDiameterModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallBoilingModels::departureDiameterModel> +Foam::wallBoilingModels::departureDiameterModel::New +( + const dictionary& dict +) +{ + word departureDiameterModelType(dict.lookup("type")); + + Info<< "Selecting departureDiameterModel: " + << departureDiameterModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(departureDiameterModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown departureDiameterModelType type " + << departureDiameterModelType << endl << endl + << "Valid departureDiameterModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C similarity index 80% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C index 2f04829850522373e0adfc31151b60a293033e7d..85cc8923a1153a3c3fe77e59d58a7872b8de5ab2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +27,7 @@ License #include "Cole.H" #include "addToRunTimeSelectionTable.H" -#include "gravityMeshObject.H" +#include "uniformDimensionedFields.H" #include "compressibleTurbulenceModel.H" #include "ThermalDiffusivity.H" #include "PhaseCompressibleTurbulenceModel.H" @@ -54,10 +54,8 @@ namespace departureFrequencyModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::wallBoilingModels::departureFrequencyModels::Cole::Cole -( - const dictionary& dict -) +Foam::wallBoilingModels::departureFrequencyModels:: +Cole::Cole(const dictionary& dict) : departureFrequencyModel() {} @@ -65,14 +63,16 @@ Foam::wallBoilingModels::departureFrequencyModels::Cole::Cole // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::wallBoilingModels::departureFrequencyModels::Cole::~Cole() +Foam::wallBoilingModels::departureFrequencyModels:: +Cole::~Cole() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::scalarField> -Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture +Foam::wallBoilingModels::departureFrequencyModels:: +Cole::fDeparture ( const phaseModel& liquid, const phaseModel& vapor, @@ -82,13 +82,10 @@ Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture { // Gravitational acceleration const uniformDimensionedVectorField& g = - meshObjects::gravity::New(liquid.mesh().time()); - - const fvPatchScalarField& rhoLiquid = - liquid.turbulence().rho().boundaryField()[patchi]; + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); - const fvPatchScalarField& rhoVapor = - vapor.turbulence().rho().boundaryField()[patchi]; + const scalarField rhoLiquid(liquid.thermo().rho(patchi)); + const scalarField rhoVapor(vapor.thermo().rho(patchi)); return sqrt ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H index a7a38432410e16a91cc60f24d9c8dfb17165d452..920ca31d3314a3d8e626ddb94f5ec79ee34d8589 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,8 +32,8 @@ Description Reference: \verbatim Cole, R. (1960). - A photographic study of pool boiling in the region of the - critical heat flux. + A photographic study of pool boiling in the region of the critical heat + flux. AIChE Journal, 6(4), 533-538. \endverbatim diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C index 75690cc3e8692def28fc81fd154709dd47a62d73..7243a5905550a1f7bd060da32dd4944acf12ccd8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H index 0bbc89445ca353a0eb67a2aa557417b7652f3c97..1fde46134e1478d2d314404ad758491e1a4ffe95 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::departureFrequencyModel + Foam::wallBoilingModels::departureFrequencyModel Description Base class for bubble departure frequency models @@ -59,11 +59,11 @@ class departureFrequencyModel { // Private Member Functions - //- No copy construct - departureFrequencyModel(const departureFrequencyModel&) = delete; + //- Disallow default bitwise copy construct + departureFrequencyModel(const departureFrequencyModel&); - //- No copy assignment - void operator=(const departureFrequencyModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const departureFrequencyModel&); public: diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C new file mode 100644 index 0000000000000000000000000000000000000000..ecf26307b19492e21a098c6fea44c29f9c21d03e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "departureFrequencyModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallBoilingModels::departureFrequencyModel> +Foam::wallBoilingModels::departureFrequencyModel::New +( + const dictionary& dict +) +{ + word departureFrequencyModelType(dict.lookup("type")); + + Info<< "Selecting departureFrequencyModel: " + << departureFrequencyModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(departureFrequencyModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown departureFrequencyModelType type " + << departureFrequencyModelType << endl << endl + << "Valid departureFrequencyModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.C new file mode 100644 index 0000000000000000000000000000000000000000..86d253b16e4ce77f780402eafc5d19d0036a8e25 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.C @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "Bromley.H" +#include "addToRunTimeSelectionTable.H" +#include "uniformDimensionedFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace filmBoilingModels +{ + defineTypeNameAndDebug(Bromley, 0); + addToRunTimeSelectionTable + ( + filmBoilingModel, + Bromley, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::filmBoilingModels::Bromley::Bromley +( + const dictionary& dict +) +: + filmBoilingModel(), + Cn_(dict.lookupOrDefault<scalar>("Cn", 0.62)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::filmBoilingModels::Bromley::~Bromley() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::wallBoilingModels::filmBoilingModels::Bromley::htcFilmBoil +( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L +) const +{ + + const fvPatchScalarField& Tw = + liquid.thermo().T().boundaryField()[patchi]; + const uniformDimensionedVectorField& g = + liquid.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); + + const scalarField rhoVapor(vapor.thermo().rho(patchi)); + const scalarField rhoLiq(liquid.thermo().rho(patchi)); + const scalarField kappaVapor(vapor.kappa(patchi)); + + tmp<volScalarField> tCp = vapor.thermo().Cp(); + const volScalarField& Cp = tCp(); + const scalarField& CpVapor = Cp.boundaryField()[patchi]; + + const scalarField muVapor(vapor.mu(patchi)); + const scalarField dbVapor(vapor.d()().boundaryField()[patchi]); + + return + Cn_*pow + ( + pow3(kappaVapor) + *rhoVapor*(rhoLiq - rhoVapor)*mag(g.value()) + *(L + 0.4*CpVapor*max((Tw-Tsatw), scalar(0))) + /(dbVapor*muVapor*max((Tw-Tsatw), scalar(1e-4))), + 0.25 + ); +} + + +void Foam::wallBoilingModels::filmBoilingModels::Bromley::write +( + Ostream& os +) const +{ + filmBoilingModel::write(os); + os.writeKeyword("Cn") << Cn_ << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // + + diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.H new file mode 100644 index 0000000000000000000000000000000000000000..782c7e4aabcd61fcf21264277b8a6dc06dc8d21a --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/Bromley/Bromley.H @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::wallBoilingModels:filmBoilingModels:::Bromley + +Description + Boiling film correlation. + + References: + \verbatim + A. Bromley, Heat transfer in stable film boiling, + Chem. Eng. Prog. 58 (1950) 67–72. + \endverbatim + +SourceFiles + Bromley.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Bromley_H +#define Bromley_H + +#include "filmBoilingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ +namespace filmBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class Bromley Declaration +\*---------------------------------------------------------------------------*/ + +class Bromley +: + public filmBoilingModel +{ + + // Private data: + + //- Coefficient for nucleation site density + scalar Cn_; + +public: + + //- Runtime type information + TypeName("Bromley"); + + // Constructors + + //- Construct from a dictionary + Bromley(const dictionary& dict); + + + //- Destructor + virtual ~Bromley(); + + + // Member Functions + + //- Calculate and return the nucleation-site density + virtual tmp<scalarField> htcFilmBoil + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const; + + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmBoilingModels +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C new file mode 100644 index 0000000000000000000000000000000000000000..826f82b2c1d49653719bde3ecc65c5eddb78a2a9 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "filmBoilingModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace wallBoilingModels + { + defineTypeNameAndDebug(filmBoilingModel, 0); + defineRunTimeSelectionTable(filmBoilingModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::filmBoilingModel::filmBoilingModel() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallBoilingModels::filmBoilingModel::~filmBoilingModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallBoilingModels::filmBoilingModel::write(Ostream& os) const +{ + os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e5b1c858c98e5d1add87602f6ec8cfbe279473e0 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/filmBoilingModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::filmBoilingModels::filmBoilingModel + +Description + Base class for nucleation site density models + +SourceFiles + filmBoilingModel.C + newfilmBoilingModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef filmBoilingModel_H +#define filmBoilingModel_H + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallBoilingModels +{ + +/*---------------------------------------------------------------------------*\ + Class filmBoilingModel Declaration +\*---------------------------------------------------------------------------*/ + +class filmBoilingModel +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + filmBoilingModel(const filmBoilingModel&); + + //- Disallow default bitwise assignment + void operator=(const filmBoilingModel&); + + +public: + + //- Runtime type information + TypeName("filmBoilingModel"); + + + //- Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + filmBoilingModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct null + filmBoilingModel(); + + + // Selectors + + //- Select null constructed + static autoPtr<filmBoilingModel> New(const dictionary& dict); + + + //- Destructor + virtual ~filmBoilingModel(); + + + // Member Functions + + //- Calculate temperature + virtual tmp<scalarField> htcFilmBoil + ( + const phaseModel& liquid, + const phaseModel& vapor, + const label patchi, + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L + ) const = 0; + + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace wallBoilingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C new file mode 100644 index 0000000000000000000000000000000000000000..1b518fb3ebdeb418ed7731f1478ba4bb4cc6433d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/filmBoilingModels/filmBoilingModel/newfilmBoilingModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "filmBoilingModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallBoilingModels::filmBoilingModel> +Foam::wallBoilingModels::filmBoilingModel::New +( + const dictionary& dict +) +{ + word filmBoilingModelType(dict.lookup("type")); + + Info<< "Selecting filmBoilingModel: " + << filmBoilingModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(filmBoilingModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown filmBoilingModelType type " + << filmBoilingModelType << endl << endl + << "Valid filmBoilingModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C index 0c9d825ea3f37c40dab8eda942209ac8d8b86817..561fb630456882027387c42376dfafc31e6c3190 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H index af048d0073685e4273f25611e089e4d8d2cb35fe..6e0302ee85f607829e509e9b7d0bc740573cff52 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C similarity index 74% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C index 1e322baca8ad15965050d6031004e1d26174aa9f..25dfc4121a2d87a59c309e935db0eb8e785b6ff0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,18 +35,20 @@ Foam::wallBoilingModels::nucleationSiteModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("type")); + word nucleationSiteModelType(dict.lookup("type")); - Info<< "Selecting nucleationSiteModel: " << modelType << endl; + Info<< "Selecting nucleationSiteModel: " + << nucleationSiteModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(nucleationSiteModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown nucleationSiteModel type " - << modelType << nl << nl - << "Valid nucleationSiteModel types :" << endl + << "Unknown nucleationSiteModelType type " + << nucleationSiteModelType << endl << endl + << "Valid nucleationSiteModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C index c52da0d8e7cd35230c2184bfb97292dac62accf3..a46662d3f6f6c78f61b6f06772b9507445d4a33b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H index 0daf7792d7fc28b65454a6b30bdf8b1007b399a6..08b02456cfc56070a17081b30305789fc6bcb9f0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::nucleationSiteModel + Foam::wallBoilingModels::nucleationSiteModel Description Base class for nucleation site density models @@ -59,11 +59,11 @@ class nucleationSiteModel { // Private Member Functions - //- No copy construct - nucleationSiteModel(const nucleationSiteModel&) = delete; + //- Disallow default bitwise copy construct + nucleationSiteModel(const nucleationSiteModel&); - //- No copy assignment - void operator=(const nucleationSiteModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const nucleationSiteModel&); public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C index 01bcbb83f572db443d768d3a8c5bf0c5a57db3a5..e21eec8f3047e0a9a38312383640cda68c7218bc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,7 +54,7 @@ Foam::wallBoilingModels::partitioningModels:: Lavieville::Lavieville(const dictionary& dict) : partitioningModel(), - alphaCrit_(dict.get<scalar>("alphaCrit")) + alphaCrit_(readScalar(dict.lookup("alphaCrit"))) {} @@ -90,7 +90,7 @@ void Foam::wallBoilingModels::partitioningModels:: Lavieville::write(Ostream& os) const { partitioningModel::write(os); - os.writeEntry("alphaCrit", alphaCrit_); + os.writeKeyword("alphaCrit") << alphaCrit_ << token::END_STATEMENT << nl; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H index 530ec9432ad5de94cb3a1bd09cd7fb685b4f7bfe..4a8cdd58366274ffc7f2c2afa695b1e47394dc13 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::wallBoilingModels::Lavieville + Foam::wallBoilingModels::partitioningModels::Lavieville Description Lavieville wall heat flux partitioning model. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C index d84622c9b3133aa51e65f2d802cf7e972ceba6af..ee32596a99127f6decd6e20154b31a11d97ff98e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,8 +54,8 @@ Foam::wallBoilingModels::partitioningModels:: cosine::cosine(const dictionary& dict) : partitioningModel(), - alphaLiquid1_(dict.get<scalar>("alphaLiquid1")), - alphaLiquid0_(dict.get<scalar>("alphaLiquid0")) + alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))), + alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0"))) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H index 56e4583a3c663f6b24ceeb7787d26c8872750ec6..49b71cf25c182ab92745a110ae6eb37fc89ab9ab 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::wallBoilingModels::cosine + Foam::wallBoilingModels::partitioningModels::cosine Description Cosine wall heat flux partitioning model. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C index 89b004233575e5adade03bec3da2bf6cedda7a3a..dd080c9d536ab66a13bdf32383ffb644af4e0ec4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,8 +54,8 @@ Foam::wallBoilingModels::partitioningModels:: linear::linear(const dictionary& dict) : partitioningModel(), - alphaLiquid1_(dict.get<scalar>("alphaLiquid1")), - alphaLiquid0_(dict.get<scalar>("alphaLiquid0")) + alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))), + alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0"))) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H index 10d157a5c5e0e997262557f6d6884109e15c38a2..a99856244559602ee41a00d53fd439717b0979ae 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::wallBoilingModels::linear + Foam::wallBoilingModels::partitioningModels::linear Description Linear wall heat flux partitioning model. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C similarity index 75% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C index 3c5a4f59b150d91a2d1cfef5eafdb0c0aecee4a7..126d2dd198bea81b1cfdfa701f4d2697104841f1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,18 +35,20 @@ Foam::wallBoilingModels::partitioningModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("type")); + word partitioningModelType(dict.lookup("type")); - Info<< "Selecting partitioningModel: " << modelType << endl; + Info<< "Selecting partitioningModel: " + << partitioningModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(partitioningModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown partitioningModel type " - << modelType << nl << nl - << "Valid partitioningModel types :" << endl + << "Unknown partitioningModelType type " + << partitioningModelType << endl << endl + << "Valid partitioningModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C index ad2458cb9b237fb3d2e79a1f76cd430014cfa375..b328494baf2be48196368a01d4befafc21dc72d0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H index fb0227fd4112068d11693a7f2481889ff14d7c72..441050efe6ce82f4c79c415826fd01b90a32666f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::partitioningModel + Foam::wallBoilingModels::partitioningModel Description Base class for wall heat flux partitioning models @@ -57,11 +57,11 @@ class partitioningModel { // Private Member Functions - //- No copy construct - partitioningModel(const partitioningModel&) = delete; + //- Disallow default bitwise copy construct + partitioningModel(const partitioningModel&); - //- No copy assignment - void operator=(const partitioningModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const partitioningModel&); public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C index d677264640e01b1412edc4d8d2d0430eb753adc1..b8e6549c9b206ff68371e7b5687ee462b2158c68 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H rename to src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H index 05c721d30849ab4216bc15d4a50a09b80a07e3e9..aac3f4b310d63609a80f65e79e38d6d99ab3a3c3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::wallBoilingModels::phaseFraction + Foam::wallBoilingModels::partitioningModels::phaseFraction Description Wall heat-flux partitioned according to the phase volume fraction. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/files b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/Make/files similarity index 100% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/files rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/Make/files diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/Make/options similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/options rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/Make/options index b5d8007867932e038602299bdab9dbaa88cafc44..d80f8dd8858285e28aea2863a5250d1fc6331eda 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/Make/options @@ -5,11 +5,9 @@ EXE_INC = \ -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 \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C index 328abd99b61c64b7f994dc7bae49355957b3445a..333a16c56c0d5a0f9c6efb87f678bf280c622302 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -111,16 +111,11 @@ Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::YfPrime const volScalarField& Tf ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - IOobject::groupName("YfPrime", this->pair_.name()), - this->pair_.phase1().mesh().time().timeName(), - this->pair_.phase1().mesh() - ), + IOobject::groupName("YfPrime", this->pair_.name()), this->pair_.phase1().mesh(), - dimensionedScalar(dimless/dimTemperature, Zero) + dimensionedScalar(dimless/dimTemperature) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H index d9a01a9b8be6c3c53f537cdc793a2707dac47b45..75aeade3f1f0ed2ee669a2c8d744b8e69090b05c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,14 +24,15 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::Henry + Foam::interfaceCompositionModels::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. + Henry's law for gas solubility in liquid. The concentration of a dissolved + species in the liquid is proportional to its partial pressure in the gas. A + dimensionless solubility, \f$k\f$, is given for each species. This is the + ratio of the concentration of the species in the liquid to the + corresponding concentration in the gas; i.e., \f$k = + c_{i,liq}/c_{i,gas}\f$. Mixing in the gas is assumed to be ideal. SourceFiles Henry.C @@ -64,7 +65,7 @@ class Henry { // Private data - //- Solubility coefficients + //- Dimensionless solubility coefficients const scalarList k_; //- The remaining solvent species fraction diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C index 5553bf53aa1b99f849860f942455ead5e1697a54..ab3c7232c91c54a2e341a62e100dc2953881d4a8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -134,16 +134,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D tmp<volScalarField> tmpD ( - new volScalarField + volScalarField::New ( - IOobject - ( - IOobject::groupName("D", pair_.name()), - p.time().timeName(), - p.mesh() - ), + IOobject::groupName("D", pair_.name()), p.mesh(), - dimensionedScalar(dimArea/dimTime, Zero) + dimensionedScalar(dimArea/dimTime) ) ); @@ -188,16 +183,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L tmp<volScalarField> tmpL ( - new volScalarField + volScalarField::New ( - IOobject - ( - IOobject::groupName("L", pair_.name()), - p.time().timeName(), - p.mesh() - ), + IOobject::groupName("L", pair_.name()), p.mesh(), - dimensionedScalar(dimEnergy/dimMass, Zero) + dimensionedScalar(dimEnergy/dimMass) ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H similarity index 99% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H index 5d99d7fc4123404c7862d3ca62525590bc20610c..8cf305f03a1d5f4262e93fa6458cc7e1ab3de7b3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C new file mode 100644 index 0000000000000000000000000000000000000000..2ee03d7abc45324ddf787c1909c2fa8e97606b7d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C @@ -0,0 +1,251 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#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" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSpecieInterfaceCompositionModel(Model, Thermo1, Thermo2) \ + \ + /* Composition at an interface with a multi-component mixture */ \ + makeSpecieInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + multiComponentMixture, Thermo1, \ + heRhoThermo, rhoReactionThermo, \ + multiComponentMixture, Thermo2 \ + ); \ + makeSpecieInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + reactingMixture, Thermo1, \ + heRhoThermo, rhoReactionThermo, \ + multiComponentMixture, Thermo2 \ + ); \ + \ + /* Composition at an interface with a reacting mixture */ \ + makeSpecieInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + multiComponentMixture, Thermo1, \ + heRhoThermo, rhoReactionThermo, \ + reactingMixture, Thermo2 \ + ); \ + makeSpecieInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + reactingMixture, Thermo1, \ + heRhoThermo, rhoReactionThermo, \ + reactingMixture, Thermo2 \ + ); + +#define makeInterfaceCompositionModel(Model, Thermo1, Thermo2) \ + \ + /* Composition at an interface with a pure mixture */ \ + makeInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + multiComponentMixture, Thermo1, \ + heRhoThermo, rhoThermo, \ + pureMixture, Thermo2 \ + ); \ + makeInterfaceCompositionType \ + ( \ + Model, \ + heRhoThermo, rhoReactionThermo, \ + reactingMixture, Thermo1, \ + heRhoThermo, rhoThermo, \ + pureMixture, Thermo2 \ + ); \ + \ + /* Composition at an interface with non-pure mixtures */ \ + makeSpecieInterfaceCompositionModel(Model, Thermo1, Thermo2) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + using namespace interfaceCompositionModels; + + // Gas-side models + makeInterfaceCompositionModel + ( + Saturated, + constEThermoPhysics, + constEThermoPhysics + ); + makeInterfaceCompositionModel + ( + Saturated, + constGasEThermoPhysics, + constEThermoPhysics + ); + makeInterfaceCompositionModel + ( + Saturated, + gasEThermoPhysics, + constEThermoPhysics + ); + makeInterfaceCompositionModel + ( + Saturated, + constGasEThermoPhysics, + constFluidEThermoPhysics + ); + makeInterfaceCompositionModel + ( + Saturated, + gasEThermoPhysics, + constFluidEThermoPhysics + ); + + makeSpecieInterfaceCompositionModel + ( + NonRandomTwoLiquid, + constEThermoPhysics, + constEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + NonRandomTwoLiquid, + constGasEThermoPhysics, + constEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + NonRandomTwoLiquid, + gasEThermoPhysics, + constEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + NonRandomTwoLiquid, + constGasEThermoPhysics, + constFluidEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + NonRandomTwoLiquid, + gasEThermoPhysics, + constFluidEThermoPhysics + ); + + // Liquid-side models + makeSpecieInterfaceCompositionModel + ( + Henry, + constEThermoPhysics, + constEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Henry, + constEThermoPhysics, + constGasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Henry, + constEThermoPhysics, + gasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Henry, + constFluidEThermoPhysics, + constGasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Henry, + constFluidEThermoPhysics, + gasEThermoPhysics + ); + + makeSpecieInterfaceCompositionModel + ( + Raoult, + constEThermoPhysics, + constEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Raoult, + constEThermoPhysics, + constGasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Raoult, + constEThermoPhysics, + gasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Raoult, + constFluidEThermoPhysics, + constGasEThermoPhysics + ); + makeSpecieInterfaceCompositionModel + ( + Raoult, + constFluidEThermoPhysics, + gasEThermoPhysics + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C index 530ad4addae3373de0031f842ca33201f86d03c9..8da6b39a9931981c47e2d963291d03145c857203 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -87,14 +87,16 @@ NonRandomTwoLiquid ( saturationModel::New ( - dict.subDict(species1Name_).subDict("interaction") + dict.subDict(species1Name_).subDict("interaction"), + pair.phase1().mesh() ).ptr() ); saturationModel21_.reset ( saturationModel::New ( - dict.subDict(species2Name_).subDict("interaction") + dict.subDict(species2Name_).subDict("interaction"), + pair.phase1().mesh() ).ptr() ); @@ -136,20 +138,30 @@ update const volScalarField& Tf ) { - volScalarField W(this->thermo_.composition().W()); + volScalarField W(this->thermo_.W()); volScalarField X1 ( this->thermo_.composition().Y(species1Index_) *W - /this->thermo_.composition().W(species1Index_) + /dimensionedScalar + ( + "W", + dimMass/dimMoles, + this->thermo_.composition().W(species1Index_) + ) ); volScalarField X2 ( this->thermo_.composition().Y(species2Index_) *W - /this->thermo_.composition().W(species2Index_) + /dimensionedScalar + ( + "W", + dimMass/dimMoles, + this->thermo_.composition().W(species2Index_) + ) ); volScalarField alpha12(alpha12_ + Tf*beta12_); @@ -197,7 +209,7 @@ Foam::interfaceCompositionModels::NonRandomTwoLiquid<Thermo, OtherThermo>::Yf *speciesModel1_->Yf(speciesName, Tf) *gamma1_; } - else if(speciesName == species2Name_) + else if (speciesName == species2Name_) { return this->otherThermo_.composition().Y(speciesName) @@ -229,7 +241,7 @@ YfPrime *speciesModel1_->YfPrime(speciesName, Tf) *gamma1_; } - else if(speciesName == species2Name_) + else if (speciesName == species2Name_) { return this->otherThermo_.composition().Y(speciesName) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H index 809eecc90c9b0123e95b56b3f0b38c2a126121d5..9fd0e7baf81a3eb10eff602ae11d8e3093f89fad 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::NonRandomTwoLiquid + Foam::interfaceCompositionModels::NonRandomTwoLiquid Description Non ideal law for the mixing of two species. A separate composition model @@ -56,7 +56,7 @@ namespace interfaceCompositionModels { /*---------------------------------------------------------------------------*\ - Class NonRandomTwoLiquid Declaration + Class NonRandomTwoLiquid Declaration \*---------------------------------------------------------------------------*/ template<class Thermo, class OtherThermo> @@ -78,10 +78,10 @@ class NonRandomTwoLiquid //- Name of species 2 word species2Name_; - //- Index of species 1 within this thermo + //- Indiex of species 1 within this thermo label species1Index_; - //- Index of species 2 within this thermo + //- Indiex of species 2 within this thermo label species2Index_; //- Non-randomness constant parameter for species 1 @@ -112,7 +112,7 @@ class NonRandomTwoLiquid public: //- Runtime type information - TypeName("NonRandomTwoLiquid"); + TypeName("nonRandomTwoLiquid"); // Constructors diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C index 69ac3cf70a43caa89ac346ecec6c826ff2a034e3..fa29c2a2713a4eef4be69069bc8afa45feda4a97 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,7 +57,7 @@ Foam::interfaceCompositionModels::Raoult<Thermo, OtherThermo>::Raoult pair.phase1().mesh() ), pair.phase1().mesh(), - dimensionedScalar(dimless/dimTemperature, Zero) + dimensionedScalar(dimless/dimTemperature) ) { for (const word& speciesName : this->speciesNames_) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H index b6f990de37b1af328c5f49f0b8985f4458234dbb..21cb1e8fdb9c8016a3881a8e3f8097c7c1f27e2a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::Raoult + Foam::interfaceCompositionModels::Raoult Description Raoult's law of ideal mixing. A separate composition model is given for diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C index 82be90a2cc93c6c1d7cb6e61ce0b4b0d9779c776..68d0ef46407eae7f97a486d51433b00813c430f7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,7 +64,8 @@ Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::Saturated ( saturationModel::New ( - dict.subDict("saturationPressure") + dict.subDict("saturationPressure"), + pair.phase1().mesh() ) ) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H index 30d47ec849db857699df992ac0a25fb324731237..58506f2b1eb73b3643b44f7531e8d1729fc257c5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::Saturated + Foam::interfaceCompositionModels::Saturated Description Model which uses a saturation pressure model for a single species to @@ -77,14 +77,14 @@ protected: // Private Member Functions //- Constant of proportionality between partial pressure and mass - //- fraction + // fraction tmp<volScalarField> wRatioByP() const; public: //- Runtime type information - TypeName("Saturated"); + TypeName("saturated"); // Constructors diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C index e095dd4b2f15c9cd3ea4163d09fac84d1e34b401..e833c8a58c6374f01db015fa3b22752b227314db 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H index e7c8caefd8776e9e5677290e4d7b546903a95bde..713ffe3dafbec816bd3f6030f32e050110d979e5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C index 751ce74cbbb9b5720969ab17e3672874992a0871..baf84f78ed93fe52655df8565acec85727ba0fe0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/newInterfaceCompositionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,9 +38,9 @@ Foam::interfaceCompositionModel::New const phasePair& pair ) { - const word modelType + word interfaceCompositionModelType ( - dict.get<word>("type") + word(dict.lookup("type")) + "<" + pair.phase1().thermo().type() + "," @@ -49,16 +49,17 @@ Foam::interfaceCompositionModel::New ); Info<< "Selecting interfaceCompositionModel for " - << pair << ": " << modelType << endl; + << pair << ": " << interfaceCompositionModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(interfaceCompositionModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown interfaceCompositionModel type " - << modelType << nl << nl - << "Valid interfaceCompositionModel types :" << endl + << "Unknown interfaceCompositionModelType type " + << interfaceCompositionModelType << endl << endl + << "Valid interfaceCompositionModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C index 44c9af57e03606392df71d6bd3009911e0d19344..441771ac196b327d2485b48d4831561f03f955ab 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,9 +65,9 @@ Foam::massTransferModels::Frossling::~Frossling() Foam::tmp<Foam::volScalarField> Foam::massTransferModels::Frossling::K() const { - volScalarField Sh(scalar(2) + 0.552*sqrt(pair_.Re())*cbrt(Le_*pair_.Pr())); + volScalarField Sh(2 + 0.552*sqrt(pair_.Re())*cbrt(Le_*pair_.Pr())); - return 6.0*pair_.dispersed()*Sh/sqr(pair_.dispersed().d()); + return 6*pair_.dispersed()*Sh/sqr(pair_.dispersed().d()); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H index 67394eb512767ef8223fc8ebccdbd840b5cab038..565a94cee3f647293db10d93f07fbc3c750a2336 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/Frossling/Frossling.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C index 2c4baa2f626a2ba90019c022377a2b98b5d7300f..78f123eabcc310997758e7af69a1054fc511d244 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,12 +27,14 @@ License #include "massTransferModel.H" #include "phasePair.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(massTransferModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(massTransferModel, 0); defineRunTimeSelectionTable(massTransferModel, dictionary); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H index 56113c89f24e2a69f2da9dac0f0d53233c7d6280..fc5e7cc121298051e873bb47a8ffdd0a8409623c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/massTransferModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C index 66aa8e6a06372fd7889ec4afc6b0982c3e7584da..6f69f3d9529db13a1395b1d39530be9adca6a7b3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/massTransferModel/newMassTransferModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::massTransferModel> Foam::massTransferModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word massTransferModelType(dict.lookup("type")); Info<< "Selecting massTransferModel for " - << pair << ": " << modelType << endl; + << pair << ": " << massTransferModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(massTransferModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown massTransferModel type " - << modelType << nl << nl - << "Valid massTransferModel types :" << endl + << "Unknown massTransferModelType type " + << massTransferModelType << endl << endl + << "Valid massTransferModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C index 2e5f1a9778f80d653940f59eaa43d0f2a12bfb58..7bf56a94724a87202e3dd6abb704d327816eeefc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -70,7 +70,7 @@ Foam::massTransferModels::sphericalMassTransfer::~sphericalMassTransfer() Foam::tmp<Foam::volScalarField> Foam::massTransferModels::sphericalMassTransfer::K() const { - return 60.0*pair_.dispersed()/sqr(pair_.dispersed().d()); + return 60*pair_.dispersed()/sqr(pair_.dispersed().d()); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H index 54a08bc7e9c39db200b4e6208294515966295067..c5c4110884676a8f67fb78586d3293b87dfbed5f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/massTransferModels/sphericalMassTransfer/sphericalMassTransfer.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C index 46fb2b34768ef380832b20112f997e22ebd07300..6f5793cef60891518d71c5330c2a3bcaef17517b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,13 @@ namespace saturationModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModels::Antoine::Antoine(const dictionary& dict) +Foam::saturationModels::Antoine::Antoine +( + const dictionary& dict, + const objectRegistry& db +) : - saturationModel(), + saturationModel(db), A_("A", dimless, dict), B_("B", dimTemperature, dict), C_("C", dimTemperature, dict) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H index f815c633650f19f25d0a70d3d142482095de39f7..94065ce8ddb3cf2061b5bddb6bf495e072f9a007 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -83,7 +83,7 @@ public: // Constructors //- Construct from a dictionary - Antoine(const dictionary& dict); + Antoine(const dictionary& dict, const objectRegistry& db); //- Destructor @@ -95,7 +95,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C index 780ff8eaf91db428d4e75d38a33328aad6b8c1cc..4f8208392f911db7dce3a3769230c1def1804405 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -49,10 +49,11 @@ namespace saturationModels Foam::saturationModels::AntoineExtended::AntoineExtended ( - const dictionary& dict + const dictionary& dict, + const objectRegistry& db ) : - Antoine(dict), + Antoine(dict, db), D_("D", dimless, dict), F_("F", dimless, dict), E_("E", dimless/pow(dimTemperature, F_), dict) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H index 7c551c9189d9494988e5590c96ba65b666b18795..81a6679e22f5be6486143db64bd5c71233c5aaa8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -83,7 +83,7 @@ public: // Constructors //- Construct from a dictionary - AntoineExtended(const dictionary& dict); + AntoineExtended(const dictionary& dict, const objectRegistry& db); //- Destructor @@ -95,7 +95,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C index 9fa81bd506255d28bfd579f5dc34f69c3b62331b..b9b9ffac6353cbe760014db476d38d86795f29db 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,9 +59,13 @@ Foam::saturationModels::ArdenBuck::xByTC // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModels::ArdenBuck::ArdenBuck(const dictionary& dict) +Foam::saturationModels::ArdenBuck::ArdenBuck +( + const dictionary& dict, + const objectRegistry& db +) : - saturationModel() + saturationModel(db) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H index 0d698879f41f9261e497d71167d70d7534a7c8ff..e687c26e527bbda8b70992d003445bf767ae9d72 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,7 +68,7 @@ public: // Constructors //- Construct from a dictionary - ArdenBuck(const dictionary& dict); + ArdenBuck(const dictionary& dict, const objectRegistry& db); //- Destructor @@ -80,7 +80,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C similarity index 69% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C index 5a93c017a44a594a56aed46e9de37f9f3d122ec0..00f0ca81b616b6ab990fd91c16df34ca752ce6d6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,13 @@ namespace saturationModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::saturationModels::constantSaturationConditions:: -constantSaturationConditions(const dictionary& dict) +constantSaturationConditions +( + const dictionary& dict, + const objectRegistry& db +) : - saturationModel(), + saturationModel(db), pSat_("pSat", dimPressure, dict), Tsat_("Tsat", dimTemperature, dict) {} @@ -71,17 +75,9 @@ Foam::saturationModels::constantSaturationConditions::pSat const volScalarField& T ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "pSat", - T.mesh().time().timeName(), - T.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "pSat", T.mesh(), pSat_ ); @@ -94,19 +90,11 @@ Foam::saturationModels::constantSaturationConditions::pSatPrime const volScalarField& T ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "pSatPrime", - T.mesh().time().timeName(), - T.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "pSatPrime", T.mesh(), - dimensionedScalar(dimPressure/dimTemperature, Zero) + dimensionedScalar(dimPressure/dimTemperature) ); } @@ -117,19 +105,11 @@ Foam::saturationModels::constantSaturationConditions::lnPSat const volScalarField& T ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "lnPSat", - T.mesh().time().timeName(), - T.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "lnPSat", T.mesh(), - dimensionedScalar("lnPSat", dimless, log(pSat_.value())) + dimensionedScalar("log", dimless, log(pSat_.value())) ); } @@ -140,17 +120,9 @@ Foam::saturationModels::constantSaturationConditions::Tsat const volScalarField& p ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "Tsat", - p.mesh().time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "Tsat", p.mesh(), Tsat_ ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H index 6ef15cbde0e906c33945349f14f5b722180285bd..0e3aaf4f041e8b8d927a66dd8b932cf1334bb74c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,7 +73,11 @@ public: // Constructors //- Construct from a dictionary - constantSaturationConditions(const dictionary& dict); + constantSaturationConditions + ( + const dictionary& dict, + const objectRegistry& db + ); //- Destructor @@ -85,7 +89,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C similarity index 87% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C index fe6b6b3e6994d982612324c99741f03902b4991f..e82a0b64a65971b4fc276e1d379a530bc66f8de6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2017 OpenFOAM Foundation + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,13 @@ namespace saturationModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModels::function1::function1(const dictionary& dict) +Foam::saturationModels::function1::function1 +( + const dictionary& dict, + const objectRegistry& db +) : - saturationModel(), + saturationModel(db), function_ ( Function1<scalar>::New("function", dict) @@ -101,18 +105,11 @@ Foam::saturationModels::function1::Tsat { tmp<volScalarField> tTsat ( - new volScalarField + volScalarField::New ( - IOobject - ( - "Tsat", - p.mesh().time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "Tsat", p.mesh(), - dimensionedScalar(dimTemperature, Zero) + dimensionedScalar(dimTemperature) ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H index 2e219b3fc8925c345c08cd7ad577bbe0a73c51d6..808c47499d90ecc66ba0f2a54ca3c3a8ba0bfb46 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2017 OpenFOAM Foundation + | Copyright (C) 2017-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,8 +74,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef saturationModels_function1_H -#define saturationModels_function1_H +#ifndef function1_H +#define function1_H #include "saturationModel.H" #include "Function1.H" @@ -109,7 +109,7 @@ public: // Constructors //- Construct from a dictionary - function1(const dictionary& dict); + function1(const dictionary& dict, const objectRegistry& db); //- Destructor @@ -121,7 +121,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C index 9c6e05e63dbf1cca076c7601b304bce376965bc3..a9200ca5f34efd362e003a0591a23f2b1635685f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,9 +42,13 @@ namespace saturationModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModels::polynomial::polynomial(const dictionary& dict) +Foam::saturationModels::polynomial::polynomial +( + const dictionary& dict, + const objectRegistry& db +) : - saturationModel(), + saturationModel(db), C_(dict.lookup("C<8>")) {} @@ -98,24 +102,17 @@ Foam::saturationModels::polynomial::Tsat { tmp<volScalarField> tTsat ( - new volScalarField + volScalarField::New ( - IOobject - ( - "Tsat", - p.mesh().time().timeName(), - p.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "Tsat", p.mesh(), - dimensionedScalar(dimTemperature, Zero) + dimensionedScalar(dimTemperature) ) ); volScalarField& Tsat = tTsat.ref(); - forAll(Tsat,celli) + forAll(Tsat, celli) { Tsat[celli] = C_.value(p[celli]); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H index 2df7e31418bc1ee22b4271d91f2fdd32de3cfc2e..825247851b0e21049170abcc5d68b66ed10aaa82 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,7 +79,7 @@ public: // Constructors //- Construct from a dictionary - polynomial(const dictionary& dict); + polynomial(const dictionary& dict, const objectRegistry& db); //- Destructor @@ -91,7 +91,7 @@ public: //- Saturation pressure virtual tmp<volScalarField> pSat(const volScalarField& T) const; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const; //- Natural log of the saturation pressure diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C new file mode 100644 index 0000000000000000000000000000000000000000..eb5daa9336ff981e7cd4cbd505393d2c564fdea2 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/newSaturationModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "saturationModel.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New +( + const dictionary& dict, + const objectRegistry& db +) +{ + word saturationModelType(dict.lookup("type")); + + Info<< "Selecting saturationModel: " + << saturationModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(saturationModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown saturationModelType type " + << saturationModelType << endl << endl + << "Valid saturationModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, db); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C index 05b3f18d30be25bd866cdc042ba493833e5a2d8a..9c658ffc19798408c1932c390c44583fd0778642 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,7 +38,17 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModel::saturationModel() +Foam::saturationModel::saturationModel(const objectRegistry& db) +: + IOdictionary + ( + IOobject + ( + "saturationModel", + db.time().constant(), + db + ) + ) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H similarity index 82% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H index 4a37a054a1f87a76bc1f5ae51dd8877a8445a44e..8fe1d3f24d85632c566d185d2f1df6290c0cb3a6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,6 +37,7 @@ SourceFiles #ifndef saturationModel_H #define saturationModel_H +#include "IOdictionary.H" #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" @@ -51,14 +52,16 @@ namespace Foam \*---------------------------------------------------------------------------*/ class saturationModel +: + public IOdictionary { // Private Member Functions - //- No copy construct - saturationModel(const saturationModel&) = delete; + //- Disallow default bitwise copy construct + saturationModel(const saturationModel&); - //- No copy assignment - void operator=(const saturationModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const saturationModel&); public: @@ -74,22 +77,26 @@ public: saturationModel, dictionary, ( - const dictionary& dict + const dictionary& dict, const objectRegistry& db ), - (dict) + (dict, db) ); // Constructors //- Construct null - saturationModel(); + saturationModel(const objectRegistry& db); // Selectors //- Select null constructed - static autoPtr<saturationModel> New(const dictionary& dict); + static autoPtr<saturationModel> New + ( + const dictionary& dict, + const objectRegistry& db + ); //- Destructor @@ -104,7 +111,7 @@ public: const volScalarField& T ) const = 0; - //- Saturation pressure derivative w.r.t. temperature + //- Saturation pressure derivetive w.r.t. temperature virtual tmp<volScalarField> pSatPrime ( const volScalarField& T diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C index 8cb354a030895de4d15ef61d836bb2d035e67459..603c659ed6c885deac3d6fdee058ea513bc196a2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,7 +40,7 @@ namespace surfaceTensionModels ( surfaceTensionModel, constantSurfaceTensionCoefficient, - multiphase + dictionary ); } } @@ -75,22 +75,11 @@ Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "sigma", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - sigma_ - ) + "sigma", + mesh, + sigma_ ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H index 9249642f64abb76392ce502bb40e88048ff8f87f..276ff023fa53807a462b8faf6dc0276e516fe425 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C similarity index 73% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C index 88c054b6664186c271b3d95b08e85b2330845a12..dd5b54355a44c09916c219ed90722785219b4041 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/newSurfaceTensionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,20 +37,21 @@ Foam::surfaceTensionModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word surfaceTensionModelType(dict.lookup("type")); Info<< "Selecting surfaceTensionModel for " - << pair << ": " << modelType << endl; + << pair << ": " << surfaceTensionModelType << endl; - auto cstrIter = multiphaseConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(surfaceTensionModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown surfaceTensionModel type " - << modelType << nl << nl - << "Valid surfaceTensionModel types :" << endl - << multiphaseConstructorTablePtr_->sortedToc() + << "Unknown surfaceTensionModelType type " + << surfaceTensionModelType << endl << endl + << "Valid surfaceTensionModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C index efcd9cc7ed9a45afbd5db50b8dda27d970a1ee89..691799add8d705b43688f7fe0678c89cc316acbd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,7 +33,7 @@ License namespace Foam { defineTypeNameAndDebug(surfaceTensionModel, 0); - defineRunTimeSelectionTable(surfaceTensionModel, multiphase); + defineRunTimeSelectionTable(surfaceTensionModel, dictionary); } const Foam::dimensionSet Foam::surfaceTensionModel::dimSigma(1, 0, -2, 0, 0); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H index 68ea858d0bba11e8b1980d7214c5798504c27ac9..0d64002211abfea0d99eacb74e6118f9e363e311 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -75,7 +75,7 @@ public: ( autoPtr, surfaceTensionModel, - multiphase, + dictionary, ( const dictionary& dict, const phasePair& pair, diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/files similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/files index 14ed51d6bac06942a87ffc0e18e87d631ab15e0f..34774329fae461505b168d7a5d8b6c70fc3660b3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/files @@ -15,6 +15,7 @@ dragModels/Tenneti/Tenneti.C dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C dragModels/WenYu/WenYu.C dragModels/IshiiZuber/IshiiZuber.C +dragModels/AttouFerschneider/AttouFerschneider.C swarmCorrections/swarmCorrection/swarmCorrection.C swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -32,6 +33,7 @@ liftModels/wallDampedLift/wallDampedLift.C heatTransferModels/heatTransferModel/heatTransferModel.C heatTransferModels/heatTransferModel/newHeatTransferModel.C +heatTransferModels/constantNu/constantNuHeatTransfer.C heatTransferModels/RanzMarshall/RanzMarshall.C heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C @@ -73,4 +75,8 @@ wallDampingModels/linear/linearWallDamping.C wallDampingModels/cosine/cosineWallDamping.C wallDampingModels/sine/sineWallDamping.C +phaseTransferModels/phaseTransferModel/phaseTransferModel.C +phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C +phaseTransferModels/deposition/deposition.C + LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options similarity index 100% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/options rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C index d32fd9ce6233c01e3ad080b257cf8893f067325d..98876bbc543c941f954fd00f682ada926b16f9ed 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H index 2ce046c1ec2893018d1461cb3b3f98775e276216..19ad5570ab95dc88493506fd09550895c04572f0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,10 +31,10 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C index e63384015b74634da805647bda4223040755ea8f..ab9eec3c9dc9dbbdfc3b3d3bf15d090337baa4ef 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H index db974addcdd520898ab02164754105e724265326..9aacba79fd4c7270d246bb7d47c55f8f2f7b35f5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,18 +24,17 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::VakhrushevEfremov + Foam::aspectRatioModels::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, + Vakhrushev, I. A., & Efremov, G. I. (1970). + Interpolation formula for computing the velocities of single gas bubbles + in liquids. + Chemistry and Technology of Fuels and Oils, 6(5), 376-379. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C index 79ad59ae1759833f16f84e575c36204e3b4f614d..58830b8deb04259d71ccb12651866c11210e92bb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H similarity index 84% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H index cc0697b64eb08375e3a1e44e4b32f9cd3f1397fb..85bf95877ece644c1e56a3f88d5bc021d036046c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,17 +31,16 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \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 + Wellek, R. M., Agrawal, A. K., & Skelland, A. H. P. (1966). + Shape of liquid drops moving in liquid media. + AIChE Journal, 12(5), 854-862. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C index 3df30966e823fa54da90e182787345d39520f9e1..5fad5634905585a3ef5b3332dd6b9f50adfdcbfb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H index 5c05b996cbc08ca04fa444c0bae3f5b884f14a5d..4648f3b91c00c4ed9cd3fc05864183bd80cb294b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 606cfb0f5cc7973ad9a39a462c80c076f66ff0df..9f1167219e187a33d0634419235437ece2ffa65d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,19 +37,20 @@ Foam::aspectRatioModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word aspectRatioModelType(dict.lookup("type")); Info<< "Selecting aspectRatioModel for " - << pair << ": " << modelType << endl; + << pair << ": " << aspectRatioModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(aspectRatioModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown aspectRatioModel type " - << modelType << nl << nl - << "Valid aspectRatioModel types :" << endl + << "Unknown aspectRatioModelType type " + << aspectRatioModelType << endl << endl + << "Valid aspectRatioModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C index 0e51c1657aa4db3b4824e7a55df3632e39dc15f9..33695194f31c56292ca233d23acccbfb36dfc3ce 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,21 +72,12 @@ 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_ - ) - ); + return volScalarField::New + ( + aspectRatioModel::typeName + ":E", + mesh, + E0_ + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H index 857506e13fb6271e0d2483ffe142298de8f2ca7c..b4fcada173f5d179fe8936e8aaf2b25c030a4e8b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C new file mode 100644 index 0000000000000000000000000000000000000000..b2b9551e102f39761b49df256fa0adf0b0a5fa80 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C @@ -0,0 +1,185 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "AttouFerschneider.H" +#include "phasePair.H" +#include "phaseSystem.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(AttouFerschneider, 0); + addToRunTimeSelectionTable(dragModel, AttouFerschneider, dictionary); +} +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::dragModels::AttouFerschneider::KGasLiquid +( + const phaseModel& gas, + const phaseModel& liquid +) const +{ + const phaseModel& solid = gas.fluid().phases()[solidName_]; + + const volScalarField oneMinusGas(max(1 - gas, liquid.residualAlpha())); + const volScalarField cbrtR + ( + cbrt(max(solid, solid.residualAlpha())/oneMinusGas) + ); + const volScalarField magURel(mag(gas.U() - liquid.U())); + + return + E2_*gas.mu()*sqr(oneMinusGas/solid.d())*sqr(cbrtR) + /max(gas, gas.residualAlpha()) + + E2_*gas.rho()*magURel*(1 - gas)/solid.d()*cbrtR; +} + + +Foam::tmp<Foam::volScalarField> +Foam::dragModels::AttouFerschneider::KGasSolid +( + const phaseModel& gas, + const phaseModel& solid +) const +{ + const volScalarField oneMinusGas(max(1 - gas, solid.residualAlpha())); + const volScalarField cbrtR + ( + cbrt(max(solid, solid.residualAlpha())/oneMinusGas) + ); + + return + E1_*gas.mu()*sqr(oneMinusGas/solid.d())*sqr(cbrtR) + /max(gas, gas.residualAlpha()) + + E2_*gas.rho()*mag(gas.U())*(1 - gas)/solid.d()*cbrtR; +} + + +Foam::tmp<Foam::volScalarField> +Foam::dragModels::AttouFerschneider::KLiquidSolid +( + const phaseModel& liquid, + const phaseModel& solid +) const +{ + const phaseModel& gas = liquid.fluid().phases()[gasName_]; + + return + E1_*liquid.mu()*sqr(max(solid, solid.residualAlpha())/solid.d()) + /max(liquid, liquid.residualAlpha()) + + E2_*liquid.rho()*mag(gas.U())*solid/solid.d(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::AttouFerschneider::AttouFerschneider +( + const dictionary& dict, + const phasePair& pair, + const bool registerObject +) +: + dragModel(dict, pair, registerObject), + gasName_(dict.lookup("gas")), + liquidName_(dict.lookup("liquid")), + solidName_(dict.lookup("solid")), + E1_("E1", dimless, dict), + E2_("E2", dimless, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::AttouFerschneider::~AttouFerschneider() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::dragModels::AttouFerschneider::CdRe() const +{ + FatalErrorInFunction + << "Not implemented." + << "Drag coefficient is not defined for the AttouFerschneider model." + << exit(FatalError); + + return tmp<volScalarField>(nullptr); +} + + +Foam::tmp<Foam::volScalarField> +Foam::dragModels::AttouFerschneider::K() const +{ + switch (Pair<word>::compare(pair_, phasePairKey(gasName_, liquidName_))) + { + case 1: + return KGasLiquid(pair_.phase1(), pair_.phase2()); + case -1: + return KGasLiquid(pair_.phase2(), pair_.phase1()); + } + + switch (Pair<word>::compare(pair_, phasePairKey(gasName_, solidName_))) + { + case 1: + return KGasSolid(pair_.phase1(), pair_.phase2()); + case -1: + return KGasSolid(pair_.phase2(), pair_.phase1()); + } + + switch (Pair<word>::compare(pair_, phasePairKey(liquidName_, solidName_))) + { + case 1: + return KLiquidSolid(pair_.phase1(), pair_.phase2()); + case -1: + return KLiquidSolid(pair_.phase2(), pair_.phase1()); + } + + FatalErrorInFunction + << "The pair does not contain two of out of the gas, liquid and solid " + << "phase models." + << exit(FatalError); + + return tmp<volScalarField>(nullptr); +} + + +Foam::tmp<Foam::surfaceScalarField> +Foam::dragModels::AttouFerschneider::Kf() const +{ + return fvc::interpolate(K()); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H new file mode 100644 index 0000000000000000000000000000000000000000..f385df9061a51c9683fa9e20cd5ee6961035ddb8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::dragModels::AttouFerschneider + +Description + Attou and Ferschneider's Drag model for film flow through packed beds. The + implementation follows the description of Gunjal and Ranade, who, in the + reference below, formulate the model in more convenient terms. + + Reference: + \verbatim + Gunjal, P. R., & Ranade, V. V. (2007). + Modeling of laboratory and commercial scale hydro-processing reactors + using CFD. + Chemical Engineering Science, 62(18-20), 5512-5526. + \endverbatim + +SourceFiles + AttouFerschneider.C + +\*---------------------------------------------------------------------------*/ + +#ifndef AttouFerschneider_H +#define AttouFerschneider_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; +class phaseModel; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class AttouFerschneider Declaration +\*---------------------------------------------------------------------------*/ + +class AttouFerschneider +: + public dragModel +{ + // Private data + + //- Name of the gaseous phase + const word gasName_; + + //- Name of the liquidphase + const word liquidName_; + + //- Name of the solid phase + const word solidName_; + + //- Ergun constant 1 + const dimensionedScalar E1_; + + //- Ergun constant 2 + const dimensionedScalar E2_; + + + // Private member functions + + //- Return the momentum transfer coefficient between gas and liquid + virtual tmp<volScalarField> KGasLiquid + ( + const phaseModel& gas, + const phaseModel& liquid + ) const; + + //- Return the momentum transfer coefficient between gas and solid + virtual tmp<volScalarField> KGasSolid + ( + const phaseModel& gas, + const phaseModel& solid + ) const; + + //- Return the momentum transfer coefficient between liquid and solid + virtual tmp<volScalarField> KLiquidSolid + ( + const phaseModel& liquid, + const phaseModel& solid + ) const; + + +public: + + //- Runtime type information + TypeName("AttouFerschneider"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + AttouFerschneider + ( + const dictionary& dict, + const phasePair& pair, + const bool registerObject + ); + + + //- Destructor + virtual ~AttouFerschneider(); + + + // Member Functions + + //- Drag coefficient + virtual tmp<volScalarField> CdRe() const; + + //- The drag coefficient used in the momentum equation + virtual tmp<volScalarField> K() const; + + //- The drag coefficient used in the face-momentum equations + virtual tmp<surfaceScalarField> Kf() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C index b8e4ac34855be9b991ed380e191c7029fb66d1a3..7dd5c44b4647221c2cf635d41b34715186b948ea 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -86,18 +86,18 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Beetstra::CdRe() const volScalarField F0 ( "F0", - 10.0*alpha1/sqr(alpha2) + sqr(alpha2)*(1.0 + 1.5*sqrt(alpha1)) + 10*alpha1/sqr(alpha2) + sqr(alpha2)*(1 + 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)) + 0.413*Res/(24*sqr(alpha2))*(1.0/alpha2 + + 3*alpha1*alpha2 + 8.4*pow(ResLim, -0.343)) + /(1 + pow(10.0, 3*alpha1)*pow(ResLim, -(1 + 4*alpha1)/2.0)) ); - return 24.0*alpha2*(F0 + F1); + return 24*alpha2*(F0 + F1); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H index ed4d34dcd3e2afe3cc4d111ffa6bb06612e9a802..ef49a8fdccef258af060c7dced9d1d570bdeb22a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index 47c8f0163343006e3dd407cbc44f764b3c5629d4..e31e1ba7ab4e9010a5bf3b546480aa8cb852c553 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H index 19185f3995c7dda237953e168bd3ffecc086f454..40c94c7a3a8b147b5432b2a1d400ffad207f1212 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,10 +27,13 @@ Class Foam::dragModels::Ergun Description - H, Enwald, E. Peirano, A-E Almstedt - 'Eulerian Two-Phase Flow Theory Applied to Fluidization' - Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) - Eq. 104, p. 42 + + Reference: + \verbatim + Enwald, H., Peirano, E., & Almstedt, A. E. (1996). + Eulerian two-phase flow theory applied to fluidization. + International Journal of Multiphase Flow, 22, 21-66. + \endverbatim SourceFiles Ergun.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index 66e5f9a78e9508803e31b5de6f28a90be1cf4a40..5bb9fd3a7c647c89dde003b3411309c990015653 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H index e9777a442f6bbec08b20e05540201134abd13711..2d85f985e35f87941b00ecde809351c8e73705ba 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,10 +27,14 @@ Class Foam::dragModels::Gibilaro Description - H, Enwald, E. Peirano, A-E Almstedt - 'Eulerian Two-Phase Flow Theory Applied to Fluidization' - Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) - Eq. 106, p. 43 + + Reference: + \verbatim + Enwald, H., Peirano, E., & Almstedt, A. E. (1996). + Eulerian two-phase flow theory applied to fluidization. + International Journal of Multiphase Flow, 22, 21-66. + Eq. 106, p. 43. + \endverbatim SourceFiles Gibilaro.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index ed436fd19250866610d646daea1bf4005209cbeb..66ba408ef83d7588c39b77fe7974908f49ce431b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -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. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H index 75c7e7058340c25bcd20ac664dab98c681417568..9845e4ebb142cae1ebc94cf923a3a353c7a81636 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,9 +31,10 @@ Description Reference: \verbatim - "Multiphase flow and fluidization", - Gidaspow, D., - Academic Press, New York, 1994. + Gidaspow, D. (1994). + Multiphase flow and fluidization: continuum and kinetic theory + descriptions. + Academic press, New York. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index 1c8af4bae1768e1f945bf302f9e294ef05832c8c..13a629f82cc1e10e2de7ee530f30174df383d895 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -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. @@ -75,7 +75,7 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const volScalarField CdsRe ( - neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))/alpha2 + neg(Re - 1000)*24*(1.0 + 0.15*pow(Re, 0.687))/alpha2 + pos0(Re - 1000)*0.44*max(Re, residualRe_) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H index a7aac2201747a810f5094bf6552058c081a4a082..7e6bb22b46ce20774e21b75fbb6921c74cb10d1e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,16 +31,15 @@ Description References: \verbatim - "Eulerian Two-Phase Flow Theory Applied to Fluidization" - Enwald, H., Peirano, E., Almstedt, A-E., - Int. J. Multiphase Flow, Vol. 22, Suppl, 1996, pp. 21-66 - Eq. 86-87, p. 40 + Enwald, H., Peirano, E., & Almstedt, A. E. (1996). + Eulerian two-phase flow theory applied to fluidization. + International Journal of Multiphase Flow, 22, 21-66. This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in - "Derivation, Implementation and Validation of Computer Simulation Models - for Gas-Solid Fluidized Beds", - Berend van Wachem - Ph.D. thesis. + van Wachem, B. G. M. (2000). + Derivation, implementation, and validation of computer simulation models + for gas-solid fluidized beds. + PhD Thesis, TU Delft. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C similarity index 78% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C index f7e9327d5dd1453970a7410168ab3c0bcb0a654e..36dd0b58b994b974690ab3ab3902fb03321df627 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,33 +65,32 @@ Foam::dragModels::IshiiZuber::~IshiiZuber() Foam::tmp<Foam::volScalarField> Foam::dragModels::IshiiZuber::CdRe() const { - volScalarField Re(pair_.Re()); - volScalarField Eo(pair_.Eo()); + const volScalarField Re(pair_.Re()); + const volScalarField Eo(pair_.Eo()); - volScalarField mud(pair_.dispersed().mu()); - volScalarField muc(pair_.continuous().mu()); + const volScalarField mud(pair_.dispersed().mu()); + const volScalarField muc(pair_.continuous().mu()); - volScalarField muStar((mud + 0.4*muc)/(mud + muc)); + const volScalarField muStar((mud + 0.4*muc)/(mud + muc)); - volScalarField muMix + const volScalarField muMix ( - muc - *pow(max(1 - pair_.dispersed(), scalar(1e-3)), -2.5*muStar) + muc*pow(max(1 - pair_.dispersed(), scalar(1e-3)), -2.5*muStar) ); - volScalarField ReM(Re*muc/muMix); - volScalarField CdRe + const volScalarField ReM(Re*muc/muMix); + const volScalarField CdRe ( - pos0(1000 - ReM)*24.0*(scalar(1) + 0.15*pow(ReM, 0.687)) + pos0(1000 - ReM)*24*(scalar(1) + 0.1*pow(ReM, 0.75)) + neg(1000 - ReM)*0.44*ReM ); volScalarField F((muc/muMix)*sqrt(1 - pair_.dispersed())); F.max(1e-3); - volScalarField Ealpha((1 + 17.67*pow(F, 0.8571428))/(18.67*F)); + const volScalarField Ealpha((1 + 17.67*pow(F, 0.8571428))/(18.67*F)); - volScalarField CdReEllipse(Ealpha*0.6666*sqrt(Eo)*Re); + const volScalarField CdReEllipse(Ealpha*0.6666*sqrt(Eo)*Re); return pos0(CdReEllipse - CdRe) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H index 7d72b7e79b8b2428539b05581f82173480816e74..36fe925b3a73b2aae2e06fc0b0814498ff9f591c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H @@ -5,8 +5,8 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation - + | Copyright (C) 2014-2018 OpenFOAM Foundation +------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,10 +31,10 @@ Description Reference: \verbatim - "Drag Coefficient and relative velocity in bubbly, droplet and - particulate flows", - Ishii, M., Zuber, N., - AIChE Journal 5, Vol. 25, 1979, pp. 843-855. + Ishii, M., & Zuber, N. (1979). + Drag coefficient and relative velocity in bubbly, droplet or particulate + flows. + AIChE Journal, 25(5), 843-855. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C index 8250bcd2d6737d66515f1b388bf77e0cbeb6caee..968e601f5091c38754cf82b1bf3276042f4a1543 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,9 +68,9 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Lain::CdRe() const return neg(Re - 1.5)*16.0 - + pos0(Re - 1.5)*neg(Re - 80.0)*14.9*pow(Re, 0.22) - + pos0(Re - 80.0)*neg(Re - 1500.0)*48*(1.0 - 2.21/sqrt(max(Re, SMALL))) - + pos0(Re - 1500.0)*2.61*Re; + + pos0(Re - 1.5)*neg(Re - 80)*14.9*pow(Re, 0.22) + + pos0(Re - 80)*neg(Re - 1500)*48*(1 - 2.21/sqrt(max(Re, SMALL))) + + pos0(Re - 1500)*2.61*Re; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H similarity index 82% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H index a29d1bf64509967ca1cf1e6f82c5f979ad2f237b..7002c190a8309ffabade79b2e679ac56692c652f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Lain/Lain.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,18 +31,17 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "Modelling hydrodynamics and turbulence in a bubble column using the - Euler-Lagrange procedure" - Lain, S., Brodera, D., Sommerfelda, M., Goza, M.F., - International Journal of Multiphase Flow - Volume 28, Issue 8, August 2002, pp. 1381-1407 + Laın, S., Bröder, D., Sommerfeld, M., & Göz, M. F. (2002). + Modelling hydrodynamics and turbulence in a bubble column using the + Euler–Lagrange procedure. + International journal of multiphase flow, 28(8), 1381-1407. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 89b47ca23a2143bc35fa78665ed66c35c5f0a002..f748fabe025e34f18f01130f787e6c828259c719 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -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. @@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::CdRe() const volScalarField Re(pair_.Re()); return - neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687)) + neg(Re - 1000)*24*(1.0 + 0.15*pow(Re, 0.687)) + pos0(Re - 1000)*0.44*max(Re, residualRe_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H index 02b0086cca1029ba950601f257e67daad80840fa..cba8cbc019ab6d4d6a43deb96dc4b0e04ba4e60a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index 293acfbc81c426fb83bb9a3abaca5e90f356bb11..a527e5f580a60e5173198d6ba34c4c4cbc89d004 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -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. @@ -80,7 +80,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const ( 0.5 *( - A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2*B - A) + sqr(A)) ) ); volScalarField CdsRe(sqr(0.63*sqrt(Re) + 4.8*sqrt(Vr))); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H index a19fe67e6439d606d4a6100e9a4772e71d40c1a4..792d6b2d1308eefb1a8736949b3b0eec51ccf289 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,9 +27,14 @@ Class Foam::dragModels::SyamlalOBrien Description - Syamlal, M., Rogers, W. and O'Brien, T. J. (1993) MFIX documentation, - Theory Guide. Technical Note DOE/METC-94/1004. Morgantown, West Virginia, - USA. + + Reference: + \verbatim + Syamlal, M., Rogers, W., & O’Brien, T. J. (1993). + Mfix documentation: Theory guide, technical note, doe/metc-94/1004, + ntis/de94000087. + National Technical Information Service. + \endverbatim SourceFiles SyamlalOBrien.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C index c34dc2021707168cc25fb1a120c72d93c08cf2e6..978cf4057d6db2bc13eb60af53d607176efc76ec 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,7 +80,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Tenneti::CdRe() const volScalarField CdReIsolated ( - neg(Res - 1000)*24.0*(1.0 + 0.15*pow(Res, 0.687)) + neg(Res - 1000)*24*(1 + 0.15*pow(Res, 0.687)) + pos0(Res - 1000)*0.44*max(Res, residualRe_) ); @@ -98,7 +98,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Tenneti::CdRe() const // This was removed here by multiplying F by alpha2 for consistency with // the formulation used in OpenFOAM return - CdReIsolated + 24.0*sqr(alpha2)*(F0 + F1); + CdReIsolated + 24*sqr(alpha2)*(F0 + F1); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H index 00d592eaa544b122c7fc64795f9be6eac77b2849..3453a759826346498e70ea17ec282e6d04cd7854 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,9 +34,9 @@ Description Reference: \verbatim Tenneti, S., Garg, R., & Subramaniam, S. (2011). - Drag law for monodisperse gas-solid systems using particle-resolved + Drag law for monodisperse gas–solid systems using particle-resolved direct numerical simulation of flow past fixed assemblies of spheres. - International Journal of Multiphase Flow, 37(9), 1072-1092. + International Journal of Multiphase Flow, 37(9), 1072–1092. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C index 4ad875829f86a1cecab41eb49e21e1da7031b88e..55d8b5a8d7dc8dc240d45d4d941f66ce1b9d729f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H index 5bb1a526be4ea79f18604bc4ad1a7a835c195dad..f2da24353be307371290595de8a22025f7dc7773 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,11 +31,10 @@ Description Reference: \verbatim - "Drag Coefficients of Bubbles. 1st Report. Drag Coefficients of a - Single Bubble in a Stagnant Liquid." - Tomiyama, A., Kataoka, I., and Sakaguchi, T., - Nippon Kikai Gakkai Ronbunshu - Volume 61, Issue 587, 1995, pp. 2357-2364 + Tomiyama, A., Kataoka, I., & Sakaguchi, T. (1995). + Drag coefficients of bubbles (1 st Report, Drag coefficients of a single + bubble in a stagnant liquid). + Nihon Kikaigakkai Ronbunshu, 61, 2357-2364. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C index 1c42547cc66e9a5ce55d97f9cc88eb601036167d..083025b80bde39b2f43c6f42752ce95d49a545c2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H index 2e3232240b2f14c3bcadd451dc64cef688f4dd4d..e0757c89e5de56d7138ba75f03890bc26ebf082f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,11 +31,10 @@ Description Reference: \verbatim - "Terminal velocity of single bubbles in surface tension force dominant - regime" - Tomiyama, T., Celata, G.P., Hosokawa, S., Yoshida, S., - International Journal of Multiphase Flow - Volume 28, Issue 9, September 2002, pp. 1497-1519 + Tomiyama, A., Celata, G. P., Hosokawa, S., & Yoshida, S. (2002). + Terminal velocity of single bubbles in surface tension force dominant + regime. + International Journal of Multiphase Flow, 28(9), 1497-1519. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C index e46821f384f8fe17c7d94324673bad984094fd3f..7f495fc5c3107ef567c6b3af741ca5e3593a2084 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,8 +78,8 @@ Foam::dragModels::TomiyamaKataokaZunSakaguchi::CdRe() const return max ( - 24.0*(1.0 + 0.15*pow(Re, 0.687))/max(Re, residualRe_), - 8.0*Eo/(3.0*(Eo + 4.0)) + 24*(1 + 0.15*pow(Re, 0.687))/max(Re, residualRe_), + 8*Eo/(3*(Eo + 4.0)) ) *max(pair_.Re(), residualRe_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H index 262aa85213fc2c97179db910d1d31ef351ee26c7..8e7c93e44aa3c39a92ad99b28dd6909216c937b2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,11 +31,11 @@ Description Reference: \verbatim - "Drag coefficients of single bubbles under normal and microgravity - conditions" - Tomiyama, A., Kataoka, I., Zun, I., Sakaguchi, T. - JSME International Series B, Fluids and Thermal Engineering, - Vol. 41, 1998, pp. 472-479 + Tomiyama, A., Kataoka, I., Zun, I., & Sakaguchi, T. (1998). + Drag coefficients of single bubbles under normal and micro gravity + conditions. + JSME International Journal Series B Fluids and Thermal Engineering, + 41(2), 472-479. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index bd57159a59fed56897399b45296926ad3293cd66..0f5305c008c8eafdf84a7313abb21d8885ca14a0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -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. @@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::CdRe() const volScalarField Res(alpha2*pair_.Re()); volScalarField CdsRes ( - neg(Res - 1000)*24.0*(1.0 + 0.15*pow(Res, 0.687)) + neg(Res - 1000)*24*(1.0 + 0.15*pow(Res, 0.687)) + pos0(Res - 1000)*0.44*max(Res, residualRe_) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H index 36493697dbfced19a3be86b003c00b9c46c4079e..ec062df4afef7a32af095dbcaf88c267b95a8f93 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,10 +31,10 @@ Description Reference: \verbatim - "Eulerian Two-Phase Flow Theory Applied to Fluidization" - Enwald, H., Peirano, E., Almstedt, A-E., - Int. J. Multiphase Flow, Vol. 22, Suppl, 1996, pp. 21-66 - Eq. 86-87, p. 40 + Enwald, H., Peirano, E., & Almstedt, A. E. (1996). + Eulerian two-phase flow theory applied to fluidization. + International Journal of Multiphase Flow, 22, 21-66. + Eq. 86-87, p. 40. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C index 50e6f40b57a9dad3557364e66cc051043a2993f7..f024444954defb415d5f301a27c4477301d41673 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,12 +29,14 @@ License #include "phasePair.H" #include "swarmCorrection.H" #include "surfaceInterpolate.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(dragModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(dragModel, 0); defineRunTimeSelectionTable(dragModel, dictionary); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H index ac40f4c2eed51e3d5cb84470c202e7674072b554..6cf29326f6191d3c3a9d3912ef99abc1778889f5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C similarity index 78% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 3021df61be512d0db8cc0abe0b06bf1432cd0a5a..bdf7300cea0eef3a3373eafb625b0807da4f698c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word dragModelType(dict.lookup("type")); Info<< "Selecting dragModel for " - << pair << ": " << modelType << endl; + << pair << ": " << dragModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(dragModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types :" << endl + << "Unknown dragModelType type " + << dragModelType << endl << endl + << "Valid dragModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C index b424fca38d6ca6c85a006739e6c371e3831e21c7..c2f38135ec861bfcb1bb22575d9ed213dca855bf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -103,7 +103,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const mesh ), mesh, - dimensionedScalar(dimLength, Zero), + dimensionedScalar(dimLength), zeroGradientFvPatchField<scalar>::typeName ); L.primitiveFieldRef() = cbrt(mesh.V()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H index b602e56d3fbb391b77afc272d5dc35bec1e60145..5c41e04315c917bde1f8f9d87fc42085edaa8f52 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,9 +31,9 @@ Description Reference: \verbatim - "Towards the Numerical Simulation of Multi-scale Two-phase Flows", - Marschall, H., - PhD Thesis, TU München, 2011 + Marschall, H. (2011). + Towards the numerical simulation of multi-scale two-phase flows. + PhD Thesis, TU München. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C index ec4a53e8cf96946e5ee95e6cec98aedcdbdca68a..5d66f079c2d182db2f7704a5c81230b868f36c04 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H index 7adcef0b6e4c22139b4ceb61ffc01cb620a675a8..1391e4dfe79b14203d34a0878c8cef1b3e91b69e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C new file mode 100644 index 0000000000000000000000000000000000000000..6ffed7bdd261a0f8b98bdc09eab2da19232ea2e5 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 "constantNuHeatTransfer.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace heatTransferModels +{ + defineTypeNameAndDebug(constantNuHeatTransfer, 0); + addToRunTimeSelectionTable + ( + heatTransferModel, + constantNuHeatTransfer, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::heatTransferModels::constantNuHeatTransfer::constantNuHeatTransfer +( + const dictionary& dict, + const phasePair& pair +) +: + heatTransferModel(dict, pair), + Nu_("Nu", dimless, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::heatTransferModels::constantNuHeatTransfer::~constantNuHeatTransfer() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::heatTransferModels::constantNuHeatTransfer::K +( + const scalar residualAlpha +) const +{ + return + 6.0 + *max(pair_.dispersed(), residualAlpha) + *pair_.continuous().kappa() + *Nu_ + /sqr(pair_.dispersed().d()); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H new file mode 100644 index 0000000000000000000000000000000000000000..c9c0af821be2fcfeff71c47a5840db6b84b6a69b --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::heatTransferModels::constantNuHeatTransfer + +Description + Model which applies a user provided constant Nusselt number for interfacial + heat transfer. + +SourceFiles + constantNuHeatTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantNuHeatTransfer_H +#define constantNuHeatTransfer_H + +#include "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace heatTransferModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantNuHeatTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class constantNuHeatTransfer +: + public heatTransferModel +{ + // Private data + + //- Nusselt number + dimensionedScalar Nu_; + +public: + + //- Runtime type information + TypeName("constantNu"); + + + // Constructors + + //- Construct from components + constantNuHeatTransfer + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~constantNuHeatTransfer(); + + + // Member Functions + + //- The heat transfer function K used in the enthalpy equation + tmp<volScalarField> K(const scalar residualAlpha) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace heatTransferModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index 5af033f10ce7644f840295a1dfdeb6d77db82571..d7a1dda0a9df9bc26a465b5868b82136fddf914a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,12 +27,14 @@ License #include "heatTransferModel.H" #include "phasePair.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(heatTransferModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(heatTransferModel, 0); defineRunTimeSelectionTable(heatTransferModel, dictionary); } @@ -52,8 +54,13 @@ Foam::heatTransferModel::heatTransferModel ( "residualAlpha", dimless, - pair_.dispersed().residualAlpha().value(), - dict + dict.lookupOrDefault<scalar> + ( + "residualAlpha", + pair_.ordered() + ? pair_.dispersed().residualAlpha().value() + : pair_.phase1().residualAlpha().value() + ) ) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H index 5d2d6490339bec0bdc970a42d0532825f5c499db..bed3c19a9bd4534dd54199b2427c87b0cf11a920 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index da0ad3cfc4579b993d8d385e05bfbd914609b467..894acf11d74993ed092957ee6f206baadd99a0b1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word heatTransferModelType(dict.lookup("type")); Info<< "Selecting heatTransferModel for " - << pair << ": " << modelType << endl; + << pair << ": " << heatTransferModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(heatTransferModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types :" << endl + << "Unknown heatTransferModelType type " + << heatTransferModelType << endl << endl + << "Valid heatTransferModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C index 309e255f7c1c6218618598d18f292b807bbc8d71..b66e6da5932462a066fb7d15cc0506ac6d25a095 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H index 59f72186bdb5c6e0e2379178475a90416dc1fecf..06f84d3b3d647edd568dde00dd140dc1c13f8158 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C index 6ce7c6008ba20f6f9c06e27cd652460907e0e4e2..109053931c461d8890a8244b40ee5705388efb12 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,7 +79,7 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::LegendreMagnaudet::Cl() const volScalarField ClLowSqr ( - sqr(6.0*2.255) + sqr(6*2.255) *sqr(Sr) /( pow4(constant::mathematical::pi) @@ -90,7 +90,7 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::LegendreMagnaudet::Cl() const volScalarField ClHighSqr ( - sqr(0.5*(Re + 16.0)/(Re + 29.0)) + sqr(0.5*(Re + 16)/(Re + 29)) ); return sqrt(ClLowSqr + ClHighSqr); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H index a3de35e86d471ae3a5850c81b70d425087f449ef..3aae6a4393daf45e3aa981221c5331e68448cb76 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,18 +31,16 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "The lift force on a spherical bubble in a viscous linear shear flow" - Legendre, D., Magnaudet, J., - Journal of Fluid Mechanics - Volume 368, August 1998, pp. 81-126 + Legendre, D., & Magnaudet, J. (1998). + The lift force on a spherical bubble in a viscous linear shear flow. + Journal of Fluid Mechanics, 368, 81-126. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C index 417a1e2118cce98ea7f30205fef058b8ebc361e0..7382878eceffe094d44f7c32631a39d82267e35e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H index 56972f63e2682e3e59f60f7a77a910bd80ad9d4c..00cce709316aa7843b5f777db20ba61d7a2f7a23 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,17 +31,16 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "Lateral forces on spheres in turbulent uniform shear flow" - Moraga, F.J., Bonetto, F.J., Lahey, R.T., - International Journal of Multiphase Flow - Volume 25, Issues 6-7, September 1999, pp. 1321-1372 + Moraga, F. J., Bonetto, F. J., & Lahey, R. T. (1999). + Lateral forces on spheres in turbulent uniform shear flow. + International Journal of Multiphase Flow, 25(6-7), 1321-1372. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C index ea4f1fef412133e25d007e67794dfd1e4f68b5de..cfa7e3f8fa2a684e4b94b547e81224cf32e77d0d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H index 633b764e9ea846f59c5887cba6e1fe9ae10773e6..8d730e407a8a50ceda8a4b575c4bed73bdbffdb7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,10 +31,9 @@ Description Reference: \verbatim - "Transverse migration of single bubbles in simple shear flows" - Tomiyama, A., Tamai, H., Zun, I., Hosokawa, S., - Chemical Engineering Science - Volume 57, Issue 11, June 2002, pp. 1849-1858 + Tomiyama, A., Tamai, H., Zun, I., & Hosokawa, S. (2002). + Transverse migration of single bubbles in simple shear flows. + Chemical Engineering Science, 57(11), 1849-1858. \endverbatim The coefficient for pow3(EoH) proposed by Tomiyama (2002) has been modified diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C index 48438f117ee38db3a939a719a268535c3c096ffe..cd0b86be54ff401189407c51494743f218449727 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,14 +67,9 @@ Foam::liftModels::constantLiftCoefficient::Cl() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", mesh, Cl_ ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H index a0919c851962d37d5d0a60c9b638d71cade85f91..0df1357ae3541462c7b29d0dd24661717d31c93f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C index 28f4bb3cfa7e5188d2eb868cc93a09742c391bd2..a6c88654135b2143b62a72baa0d41e317c311331 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,12 +30,14 @@ License #include "fvcCurl.H" #include "fvcFlux.H" #include "surfaceInterpolate.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(liftModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(liftModel, 0); defineRunTimeSelectionTable(liftModel, dictionary); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H index 951fd9638ac2a90395053df2b07070800e420a99..0a6d981dddf928e2447ee602c67d9adb5fc107e6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C similarity index 78% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 08f943e81b0e14f2a9d20eddcb3b790b0b6005db..49fe9f292f87df7f0cac0d6505c729791d2d2399 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::liftModel> Foam::liftModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word liftModelType(dict.lookup("type")); Info<< "Selecting liftModel for " - << pair << ": " << modelType << endl; + << pair << ": " << liftModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(liftModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown liftModel type " - << modelType << nl << nl - << "Valid liftModel types :" << endl + << "Unknown liftModelType type " + << liftModelType << endl << endl + << "Valid liftModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C similarity index 73% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C index fd9a6a533db0ff0af1c249a8f870ec0f20d22591..6da7d7690489ee96affcaf933d96cbbbbba6a3d8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,19 +65,11 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "Cl", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "Cl", mesh, - dimensionedScalar(dimless, Zero) + dimensionedScalar(dimless) ); } @@ -86,19 +78,11 @@ Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noLift:F", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "noLift:F", mesh, - dimensionedVector(dimF, Zero) + dimensionedVector(dimF) ); } @@ -107,19 +91,11 @@ Foam::tmp<Foam::surfaceScalarField> Foam::liftModels::noLift::Ff() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<surfaceScalarField>::New + return surfaceScalarField::New ( - IOobject - ( - "noLift:Ff", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "noLift:Ff", mesh, - dimensionedScalar(dimF*dimArea, Zero) + dimensionedScalar(dimF*dimArea) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H index 86b7b7302ba3b7537d336a9fec794a57e5b2d13e..dafb9e42c12c1f53f5d8c125a8ff33ebfbb2c0de 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C index 1c22276111ec3e276fbb5615016c45b300bfe3f2..4fdd7e50bb020d09450d6828cc058b671773127d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H index 788e7329fada5fe8bb6f6c56983505ef8da4e641..432084e410dc896d57de8273058e81f6b35051a6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C new file mode 100644 index 0000000000000000000000000000000000000000..ca11d114c5ae9a0e584fca9a6f4c7a33ad1b77f8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "deposition.H" +#include "phasePair.H" +#include "phaseSystem.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace phaseTransferModels +{ + defineTypeNameAndDebug(deposition, 0); + addToRunTimeSelectionTable(phaseTransferModel, deposition, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phaseTransferModels::deposition::deposition +( + const dictionary& dict, + const phasePair& pair +) +: + phaseTransferModel(dict, pair), + dropletName_(dict.lookup("droplet")), + surfaceName_(dict.lookup("surface")), + efficiency_(readScalar(dict.lookup("efficiency"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phaseTransferModels::deposition::~deposition() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::phaseTransferModels::deposition::dmdt() const +{ + const phaseModel* dropletPtr = nullptr; + scalar sign = 1; + if (dropletName_ == pair_.first()) + { + dropletPtr = &pair_.phase1(); + sign = -1; + } + else if (dropletName_ == pair_.second()) + { + dropletPtr = &pair_.phase2(); + sign = 1; + } + else + { + FatalErrorInFunction + << "The specified droplet phase, " << dropletName_ << ", is not in " + << "the " << pair_ << " pair" + << exit(FatalError); + } + + const phaseModel& droplet = *dropletPtr; + const phaseModel& surface = droplet.fluid().phases()[surfaceName_]; + + return + 1.5*sign*efficiency_ + *droplet.rho()*droplet*surface/surface.d() + *mag(droplet.U() - surface.U()); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H new file mode 100644 index 0000000000000000000000000000000000000000..9c9d97a1278f2550209a19e7facd862da24f6762 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::phaseTransferModels::deposition + +Description + Phase transfer model representing change from a dispersed phase to a film as + a result of deposition onto a third phase + +SourceFiles + deposition.C + +\*---------------------------------------------------------------------------*/ + +#ifndef deposition_H +#define deposition_H + +#include "phaseTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace phaseTransferModels +{ + +/*---------------------------------------------------------------------------*\ + Class deposition Declaration +\*---------------------------------------------------------------------------*/ + +class deposition +: + public phaseTransferModel +{ +private: + + // Private data + + //- The name of the phase which deposits + const word dropletName_; + + //- The name of the phase onto which deposition occurs + const word surfaceName_; + + //- The deposition efficiency + const scalar efficiency_; + + +public: + + //- Runtime type information + TypeName("deposition"); + + + // Constructors + + //- Construct from components + deposition + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~deposition(); + + + // Member Functions + + //- The mass transfer rate + virtual tmp<volScalarField> dmdt() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace phaseTransferModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C new file mode 100644 index 0000000000000000000000000000000000000000..7427b3d8608516bfe5ae74380cd39bd39431ed6b --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/newPhaseTransferModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "phaseTransferModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::phaseTransferModel> Foam::phaseTransferModel::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word phaseTransferModelType(dict.lookup("type")); + + Info<< "Selecting phaseTransferModel for " + << pair << ": " << phaseTransferModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(phaseTransferModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown phaseTransferModelType type " + << phaseTransferModelType << endl << endl + << "Valid phaseTransferModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C new file mode 100644 index 0000000000000000000000000000000000000000..d7fb0b33e87fa9efbbbe66c9cf1b89aa769ea378 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "phaseTransferModel.H" +#include "phasePair.H" +#include "BlendedInterfacialModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(phaseTransferModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(phaseTransferModel, 0); + defineRunTimeSelectionTable(phaseTransferModel, dictionary); +} + +const Foam::dimensionSet Foam::phaseTransferModel::dimDmdt = + Foam::dimDensity/Foam::dimTime; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phaseTransferModel::phaseTransferModel +( + const dictionary& dict, + const phasePair& pair +) +: + pair_(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phaseTransferModel::~phaseTransferModel() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e3411ee61efec593e27d16c9db499592556b8d32 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::phaseTransferModel + +Description + +SourceFiles + phaseTransferModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseTransferModel_H +#define phaseTransferModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class phaseTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class phaseTransferModel +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + +public: + + //- Runtime type information + TypeName("phaseTransferModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + phaseTransferModel, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + + // Static data members + + //- Mass transfer rate dimensions + static const dimensionSet dimDmdt; + + + // Constructors + + //- Construct from a dictionary and a phase pair + phaseTransferModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~phaseTransferModel(); + + + // Selectors + + static autoPtr<phaseTransferModel> New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- The mass transfer rate + virtual tmp<volScalarField> dmdt() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C index bb4021a3c69149cb5731dd430d7b3c5c90726743..5c74e2803a0855b14ea405caa940444892ae43cc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H similarity index 87% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H index d2d3c701175a3b0125c5a7171a668454114da087..5fc69d3377e3d7dcfa5b54dab4b9eb253648d225 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,18 +24,17 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::TomiyamaSwarm + Foam::swarmCorrections::TomiyamaSwarm Description Swarm correction of Tomiyama et al. Reference: \verbatim - "Drag Coefficients of Bubbles. 2nd Report. Drag Coefficient for a Swarm - of Bubbles and its Applicability to Transient Flow." - Tomiyama, A., Kataoka, I., Fukuda, T., and Sakaguchi, T., - Nippon Kikai Gakkai Ronbunshu - Volume 61, Issue 588, 1995, pp. 2810-2817 + Tomiyama, A., Kataoka, I., Fukuda, T., & Sakaguchi, T. (1995). + Drag coefficients of bubbles: 2nd report, drag coefficient for a swarm + of bubbles and its applicability to transient flow. + JSME Journal of Fluid Engineering, 61, 2810-2817. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C index 5912fc681c16d56064979b009a0ad84a5f7a3dac..b548292cc466b80f63a2c9c36ac91e27f86899c4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,21 +65,12 @@ Foam::tmp<Foam::volScalarField> Foam::swarmCorrections::noSwarm::Cs() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "one", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar("one", dimless, 1) - ) - ); + return volScalarField::New + ( + "Cs", + mesh, + dimensionedScalar("one", dimless, 1) + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H index 0e041c74354d7d98297e44aa84150b1093031525..2967cf74c30a31fce8c88b9e8cf439fc21675740 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index 64fe57812a7fb47393ed93a95c4d758642d7a993..63be8885f34c556539dccbfc182a10a07a88ffa5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,19 +37,20 @@ Foam::swarmCorrection::New const phasePair& pair ) { - const word correctionType(dict.get<word>("type")); + word swarmCorrectionType(dict.lookup("type")); Info<< "Selecting swarmCorrection for " - << pair << ": " << correctionType << endl; + << pair << ": " << swarmCorrectionType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(correctionType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(swarmCorrectionType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown swarmCorrection type " - << correctionType << nl << nl - << "Valid swarmCorrection types :" << endl + << "Unknown swarmCorrectionType type " + << swarmCorrectionType << endl << endl + << "Valid swarmCorrection types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C index fbcb234e35fd786e69e6836d85d45d9dc0824e54..a97d4ad97a5498ebd6e181a5e09a88df0e70a668 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H index f49690daa550212021a57fcf2965b752dbbda4eb..55b5217bfbebadb78eb0d47e465c25012cf10815 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C index 1e152b505f15deb3de95f3748fa6db0d70c010fe..a5c8f6e415bd0e27b8bdcc6745910a8e10d2da14 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,20 +81,17 @@ Foam::tmp<Foam::volScalarField> Foam::turbulentDispersionModels::Burns::D() const { const fvMesh& mesh(pair_.phase1().mesh()); - const dragModel& - drag + const dragModel& drag = + mesh.lookupObject<dragModel> ( - mesh.lookupObject<dragModel> - ( - IOobject::groupName(dragModel::typeName, pair_.name()) - ) + IOobject::groupName(dragModel::typeName, pair_.name()) ); return 0.75 *drag.CdRe() *pair_.continuous().nu() - *pair_.continuous().turbulence().nut() + *continuousTurbulence().nut() /( sigma_ *sqr(pair_.dispersed().d()) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H similarity index 84% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H index f76d19ffb76e242b347ed5604b020e61e99a829b..ea5ce3fc2c38e467877b7116b12a7b54e60e0813 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,19 +31,18 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "The Favre averaged drag model for turbulent dispersion in Eulerian - multi-phase flows" - Burns, A.D., Frank, T., Hamill, I., Shi, J.M., - 5th international conference on multiphase flow - Volume 4, Paper 392, May 2004 + Burns, A. D., Frank, T., Hamill, I., & Shi, J. M. (2004, May). + The Favre averaged drag model for turbulent dispersion in Eulerian + multi-phase flows. + In 5th international conference on multiphase flow, + ICMF (Vol. 4, pp. 1-17). \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C index 7c151a26581f13a88a803aa5c9cc1cf9bb20ad95..5e5655b0fb973e5d8df7c819d230d44b33f49773 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,7 +29,6 @@ License #include "phasePair.H" #include "phaseCompressibleTurbulenceModel.H" #include "addToRunTimeSelectionTable.H" - #include "dragModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -88,7 +87,7 @@ Foam::turbulentDispersionModels::Gosman::D() const *drag.CdRe() *pair_.dispersed() *pair_.continuous().nu() - *pair_.continuous().turbulence().nut() + *continuousTurbulence().nut() /( sigma_ *sqr(pair_.dispersed().d()) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H index bcfddef1f8f5195a52f3e20fd70a161dbd1d2fde..e284e4ba1f610b3d7ea5c79724876ee0d15c339a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,11 +31,11 @@ Description Reference: \verbatim - "Multidimensional modeling of turbulent two-phase flows in stirred - vessels" - Gosman, A.D., Lekakou, C., Politis, S., Issa, R.I., and Looney, M.K., - AIChE Journal - Volume 38, Issue 12, 1992, pp. 1946-1956 + Gosman, A. D., Lekakou, C., Politis, S., Issa, R. I., & + Looney, M. K. (1992). + Multidimensional modeling of turbulent two-phase flows in stirred + vessels. + AIChE Journal, 38(12), 1946-1956. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C index 229723c015cb14d07abaa05d0aeb08ec95a58b15..4cb3f703b641bd2b1eb5cff18e65428327fc5f76 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,7 +74,7 @@ Foam::turbulentDispersionModels::LopezDeBertodano::D() const return Ctd_ *pair_.continuous().rho() - *pair_.continuous().turbulence().k(); + *continuousTurbulence().k(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H index d6006fbea5aa61ca693c3ccccbebc642010278d3..1e33843c8e9d7948f5c1dfaa84015c9c3e784f86 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,18 +30,17 @@ Description Lopez de Bertodano (1992) turbulent dispersion model. \verbatim - "Turbulent bubbly two-phase flow in a triangular - duct" - Lopez de Bertodano, M. - Ph.D. Thesis, Rensselaer Polytechnic Institution, New York, USA, 1992. + Lopez, D. B. M. (1993). + Turbulent bubbly two-phase flow in a triangular duct. + PhD Thesis, Rensselaer Polytechnic Institution. \endverbatim \verbatim - "The Favre averaged drag model for turbulent dispersion in Eulerian - multi-phase flows" - Burns, A.D., Frank, T., Hamill, I., Shi, J.M., - 5th international conference on multiphase flow - Volume 4, Paper 392, May 2004 + Burns, A. D., Frank, T., Hamill, I., & Shi, J. M. (2004, May). + The Favre averaged drag model for turbulent dispersion in Eulerian + multi-phase flows. + In 5th international conference on multiphase flow, + ICMF (Vol. 4, pp. 1-17). \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C index 90233603ba3a5dbc94f0a7e28f4135027b64380e..9a3f21d34737338904a60001de61a2ec227972cd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,7 +78,7 @@ D() const Ctd_ *pair_.dispersed() *pair_.continuous().rho() - *pair_.continuous().turbulence().k(); + *continuousTurbulence().k(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H index 624a154278bbf65ced3b69d2c17ca673ac245ca9..abf835fa4a07586172a88ab7ee1086cea0a7b782 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C index 61404e7560d346f1e19575d6a57c8bd55cc8ecb6..6bc7b157eac4a3b5ab633945c3103a9b12814d28 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,19 +72,11 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::D() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "zero", mesh, - dimensionedScalar(dimD, Zero) + dimensionedScalar(dimD) ); } @@ -94,16 +86,11 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::F() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", mesh, - dimensionedVector(dimF, Zero) + dimensionedVector(dimF) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H index 4b0ec44852f949c41b5935ebfcf7185fb2bd8ee7..a5dbff9333ca012b1145d41a0c3ad5a22dcdadc6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index cfae8c139be0ee9aea01c1dabc664965379927c4..c88621eac5c6f2b8192c043bbf1abb67657cf7d1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,19 +37,20 @@ Foam::turbulentDispersionModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word turbulentDispersionModelType(dict.lookup("type")); Info<< "Selecting turbulentDispersionModel for " - << pair << ": " << modelType << endl; + << pair << ": " << turbulentDispersionModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown turbulentDispersionModel type " - << modelType << nl << nl - << "Valid turbulentDispersionModel types :" << endl + << "Unknown turbulentDispersionModelType type " + << turbulentDispersionModelType << endl << endl + << "Valid turbulentDispersionModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C similarity index 80% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C index 0a7777d160d773b4d8ce2ea20a6998cc636488bc..23cd5cbb854d2d4beb8698e73914d8a2937276d0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,12 +30,15 @@ License #include "fvcGrad.H" #include "surfaceInterpolate.H" #include "fvcSnGrad.H" +#include "phaseCompressibleTurbulenceModel.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(turbulentDispersionModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(turbulentDispersionModel, 0); defineRunTimeSelectionTable(turbulentDispersionModel, dictionary); } @@ -63,6 +66,21 @@ Foam::turbulentDispersionModel::~turbulentDispersionModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::phaseCompressibleTurbulenceModel& +Foam::turbulentDispersionModel::continuousTurbulence() const +{ + return + pair_.phase1().mesh().lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + pair_.continuous().name() + ) + ); +} + + Foam::tmp<Foam::volVectorField> Foam::turbulentDispersionModel::F() const { diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H index 2056461fb1910e763e2a4fe6784e4c3dbcd7b3d0..e553795aef41af79ad0d4aa8e2cdf29f38cebb8c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,6 +42,7 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "phaseCompressibleTurbulenceModelFwd.H" namespace Foam { @@ -116,6 +117,9 @@ public: // Member Functions + //- Return a reference to the turbulence model for the continuous phase + const phaseCompressibleTurbulenceModel& continuousTurbulence() const; + //- Turbulent diffusivity // multiplying the gradient of the phase-fraction virtual tmp<volScalarField> D() const = 0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C index 74f96449d88f51bb27b5a15bc1f37f4e5fe61610..501a705c24aec8699899f1df7fe6bc937ce22e71 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H index d7d8eadd00ad434148632760bc99e6531e51ca62..eb86917f36ff316e7d5c07e699bf4e6b96ba77db 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,9 +31,9 @@ Description Reference: \verbatim - "Hydrodynamics" - Lamb, H., - Cambridge University Press, 1895 + Lamb, H. (1993). + Hydrodynamics. + Cambridge university press. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C index 2d967ea2a73baa4051c98895356fd0566cd9d904..b8933a4c4b9458e032fab93548fff3962d507eb8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -75,22 +75,11 @@ Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "Cvm", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - Cvm_ - ) + "Cvm", + mesh, + Cvm_ ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H index 51c1455eb5b422a59f4cfbe0f10145d38cf10ccd..183ab189d88f2ba4f4026d7520dfab0cf30b95e3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C index dea6838d2ee8e53fb665c8bc8d33820782d526f0..c63b3002b02165905f3376082b899f6f5d425477 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,16 +67,11 @@ Foam::virtualMassModels::noVirtualMass::Cvm() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", mesh, - dimensionedScalar(dimless, Zero) + dimensionedScalar(dimless) ); } @@ -84,7 +79,7 @@ Foam::virtualMassModels::noVirtualMass::Cvm() const Foam::tmp<Foam::volScalarField> Foam::virtualMassModels::noVirtualMass::K() const { - return Cvm()*dimensionedScalar("zero", dimDensity, Zero); + return Cvm()*dimensionedScalar(dimDensity); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H index 0c7a6a640d6002106a355969a74a83138ff81ef0..e6f5c916f87b420788c0d20e40b273194862e9eb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index 50b07d19261864e5491e2a22d5e24b42e7b42b1c..e3407f2cd101bac186d25df05ff832a2c797e50f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::virtualMassModel> Foam::virtualMassModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word virtualMassModelType(dict.lookup("type")); Info<< "Selecting virtualMassModel for " - << pair << ": " << modelType << endl; + << pair << ": " << virtualMassModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(virtualMassModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown virtualMassModel type " - << modelType << nl << nl - << "Valid virtualMassModel types :" << endl + << "Unknown virtualMassModelType type " + << virtualMassModelType << endl << endl + << "Valid virtualMassModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C index 7e70855a229abedf1ec669aef18b525bf343d369..5a7c77cf2c19cbeba3618401830a146ee1ba96ea 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,12 +28,14 @@ License #include "virtualMassModel.H" #include "phasePair.H" #include "surfaceInterpolate.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(virtualMassModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(virtualMassModel, 0); defineRunTimeSelectionTable(virtualMassModel, dictionary); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H index 54a0d97e61e0d86a04762fa8696696f42524b815..0af85cf9f8803aa9d833b1386f16c4388a11cc88 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C index d9d32bf47316394d8ae48717528de6c315eaaebb..2a9778e518713e8bf3f5f894393be4a25e9b7e82 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H index 4ebe6f90c1df3ad09fc67b4f338cb44ca7c194c6..a1828443e6d3ba0e6ad314946a7d7444e50b263c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C index e308f19addc7025cf65b329f0d6ff6b934d01cdb..cf7a5f7b7ecbdcf268ca58318d594bbaf341f2c8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H index c7ba862c1c9314c7ae3681c553185f793d6bd3a8..65d98c7b3dc34bdc73e75648113fafa7fc0739ba 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/interpolated/interpolatedWallDamping.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C index c8942c323ef99d8e8b1594802c3cb3b9b678ff72..e0bd21470ca6b2a8eba01581dc8669882f4dc635 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H index cc6f0cc78a33295e40c4dc605e133007617b4cb5..b7f34066a2c07e936654c6e5f4e7c4773722d558 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C index 3336d0ffe15c43c6854824ca13b18ab66cebe9f3..d21f065addd3b1b566323c0dd87b689dc212c9f5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H index c6df81b97b2ae04cd4c15cce766dd45fbb458f83..8e72438d1e5ebdc656a1c5f289089786dfa03349 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/noWallDamping/noWallDamping.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C index 42754aaeaf1854b4503ad9facb1887fdb50b976f..f33001eb4e8996bf6d7b4be8bb30594194f00980 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H index 8bbec11c8f7b3cf4da5c41958656d1d0cb1ff0ca..70c2c286b786eb1c290447f796b7ef343d462720 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C index 9cbe4e170eb8a0e0ed401037ff7416bfcb1f9027..8979682f9e512b968bb146ab814d14c4bb0eacac 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/newWallDampingModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::wallDampingModel> Foam::wallDampingModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word wallDampingModelType(dict.lookup("type")); Info<< "Selecting wallDampingModel for " - << pair << ": " << modelType << endl; + << pair << ": " << wallDampingModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(wallDampingModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown wallDampingModel type " - << modelType << nl << nl - << "Valid wallDampingModel types :" << endl + << "Unknown wallDampingModelType type " + << wallDampingModelType << endl << endl + << "Valid wallDampingModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C index 258252dbab3f1b6f49f6dadf7bdc06431b710b96..8de816a7d913b306d79023a47d06efaeafda4541 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H index 5d25b2a2ae8e4222a34299111330a51281d4cf24..ab3851ef375171480b1c18af38a7afe6b7a5c8ed 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C index 78642930f883a6e834f172da9a62536aa3b185c8..311578bf38ea62021a49e9726801c3a103c8eaba 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H index 37fac9830c2bd20fc8a866298bbe7206a0b1c0f7..493e48c0ed40d7f02fd04f88b65e32e3c5fe466c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallDependentModel/wallDependentModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,11 +60,11 @@ class wallDependentModel // Private Member Functions - //- No copy construct - wallDependentModel(const wallDependentModel&) = delete; + //- Disallow default bitwise copy construct + wallDependentModel(const wallDependentModel&); - //- No copy assignment - void operator=(const wallDependentModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const wallDependentModel&); public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C index 687c2851aad668252e839adb37693cc120aa455d..7abd04b6701baa782c02b4dc786bb043dc0a9d9c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,7 +78,7 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Antal::Fi() const ( max ( - dimensionedScalar(dimless/dimLength, Zero), + dimensionedScalar(dimless/dimLength), Cw1_/pair_.dispersed().d() + Cw2_/yWall() ) *pair_.continuous().rho() diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H index bfd998d0685f2b595b94f4c22d84aee1102451b2..8cc647a06d3918d0fa0313abfeb89d4b083c5ebd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,11 +31,10 @@ Description Reference: \verbatim - "Analysis of phase distribution in fully developed laminar bubbly - two-phase flow" - Antal, S.P., Lahey Jr, R.T., and Flaherty, J.E. - International Journal of Multiphase Flow - Volume 17, Issue 5, September 1991, pp. 635-652 + Antal, S. P., Lahey Jr, R. T., & Flaherty, J. E. (1991). + Analysis of phase distribution in fully developed laminar bubbly + two-phase flow. + International Journal of Multiphase Flow, 17(5), 635-652. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C similarity index 87% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C index f2adbf671b26f121dcc191899ea89d7a439621a9..aa3bb3b9b630c6ff55a098f9e703fdcfb7a24399 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,7 +57,7 @@ Foam::wallLubricationModels::Frank::Frank wallLubricationModel(dict, pair), Cwd_("Cwd", dimless, dict), Cwc_("Cwc", dimless, dict), - p_(dict.get<scalar>("p")) + p_(readScalar(dict.lookup("p"))) {} @@ -82,14 +82,14 @@ Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::Frank::Fi() const return zeroGradWalls ( ( - pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179) - + pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187) - + pos0(Eo - 33.0)*0.179 + pos0(Eo - 1)*neg(Eo - 5)*exp(-0.933*Eo + 0.179) + + pos0(Eo - 5)*neg(Eo - 33)*(0.00599*Eo - 0.0187) + + pos0(Eo - 33)*0.179 ) *max ( - dimensionedScalar(dimless/dimLength, Zero), - (1.0 - yTilde)/(Cwd_*y*pow(yTilde, p_ - 1.0)) + dimensionedScalar(dimless/dimLength), + (1 - yTilde)/(Cwd_*y*pow(yTilde, p_ - 1)) ) *pair_.continuous().rho() *magSqr(Ur - (Ur & n)*n) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H similarity index 84% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H index 9295d6d3ea98acb529671ea1a2919ce643eea1c6..c75d3b18b989a3346ce5d06638d5b153f0282527 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,18 +31,18 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "Advances in Computational Fluid Dynamics (CFD) of 3-dimensional Gas- - Liquid Multiphase Flows" - Frank, T. - NAFEMS Seminar: Simulation of Complex Flows (CFD), April 2005, pp. 1-18 + Frank, T. (2005, April). + Advances in computational fluid dynamics (CFD) of 3-dimensional + gas-liquid multiphase flows. + In NAFEMS Seminar: Simulation of Complex Flows (CFD)-Applications and + Trends, Wiesbaden, Germany (pp. 1-18). \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C index d7c050e77665b72d0e1380c8f02cd6f9eb76d286..afdbe15f88750d06088565547c8917d52d3204d4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -80,9 +80,9 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const return zeroGradWalls ( ( - pos0(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179) - + pos0(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187) - + pos0(Eo - 33.0)*0.179 + pos0(Eo - 1)*neg(Eo - 5)*exp(-0.933*Eo + 0.179) + + pos0(Eo - 5)*neg(Eo - 33)*(0.00599*Eo - 0.0187) + + pos0(Eo - 33)*0.179 ) *0.5 *pair_.dispersed().d() diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H similarity index 87% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H index 52a64866d67e63d125de695ee9765618ac7509a7..4e723454abe48b53a979150fb7483ce1bcb41332 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,17 +31,16 @@ Description 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 + Otromke, M. (2013). + Implementation and Comparison of Correlations for interfacial Forces in + a Gas-Liquid System within an Euler-Euler Framework. + PhD Thesis. \endverbatim \verbatim - "Struggle with Computational Bubble Dynamics" - Tomiyama, A., - Multiphase Science and Technology - Volume 10, Issue 4, 1998, pp. 369-405 + Tomiyama, A. (1998). + Struggle with computational bubble dynamics. + Multiphase Science and Technology, 10(4), 369-405. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C similarity index 82% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C index a10df31b5dc955ce0da4321037a093ccb4c379d0..d82d9245dc7384fe4fd0509b42fb26d422fb7008 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,17 +71,9 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noWallLubrication:Fi", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "noWallLubrication:Fi", mesh, dimensionedVector(dimF, Zero) ); @@ -93,17 +85,9 @@ Foam::wallLubricationModels::noWallLubrication::F() const { const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noWallLubrication:F", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "noWallLubrication:F", mesh, dimensionedVector(dimF, Zero) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H index 49f2ac99ce81162e573ff402dccdd70ef63ee87e..c958045b36e3b71d4010dc1573d13fd3db76d4e1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index fe631582684ba0bb7c356a84bc04c27afa8e7f59..52cd99513042e830b3f8c2b5dd5fbcd021cffb36 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,19 +36,20 @@ Foam::autoPtr<Foam::wallLubricationModel> Foam::wallLubricationModel::New const phasePair& pair ) { - const word modelType(dict.get<word>("type")); + word wallLubricationModelType(dict.lookup("type")); Info<< "Selecting wallLubricationModel for " - << pair << ": " << modelType << endl; + << pair << ": " << wallLubricationModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(wallLubricationModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown wallLubricationModel type " - << modelType << nl << nl - << "Valid wallLubricationModel types :" << endl + << "Unknown wallLubricationModelType type " + << wallLubricationModelType << endl << endl + << "Valid wallLubricationModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index 31eafcec1aee92eb453d49852f731e1119be587d..abd3608e058c31381eca182da1c8f16905eb5ada 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,12 +30,14 @@ License #include "fvcFlux.H" #include "surfaceInterpolate.H" #include "wallFvPatch.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(wallLubricationModel, 0); + defineBlendedInterfacialModelTypeNameAndDebug(wallLubricationModel, 0); defineRunTimeSelectionTable(wallLubricationModel, dictionary); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H rename to src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H index 18a7d6aefb581207a9e268881d1b41f56996900e..e2e7923642adc8feea02fac03b405db4f8586860 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C new file mode 100644 index 0000000000000000000000000000000000000000..83f446f886fa4de9ed19a76b463ac1c3885e6f4d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -0,0 +1,384 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2014-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "BlendedInterfacialModel.H" +#include "fixedValueFvsPatchFields.H" +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +template<> +inline tmp<Foam::volScalarField> +blendedInterfacialModel::interpolate(tmp<volScalarField> f) +{ + return f; +} + + +template<> +inline tmp<Foam::surfaceScalarField> +blendedInterfacialModel::interpolate(tmp<volScalarField> f) +{ + return fvc::interpolate(f); +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class ModelType> +template<class GeoField> +void Foam::BlendedInterfacialModel<ModelType>::correctFixedFluxBCs +( + GeoField& field +) const +{ + typename GeoField::Boundary& fieldBf = field.boundaryFieldRef(); + + forAll(phase1_.phi()().boundaryField(), patchi) + { + if + ( + isA<fixedValueFvsPatchScalarField> + ( + phase1_.phi()().boundaryField()[patchi] + ) + ) + { + fieldBf[patchi] = Zero; + } + } +} + + +template<class ModelType> +template +< + class Type, + template<class> class PatchField, + class GeoMesh, + class ... Args +> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::BlendedInterfacialModel<ModelType>::evaluate +( + tmp<GeometricField<Type, PatchField, GeoMesh>> + (ModelType::*method)(Args ...) const, + const word& name, + const dimensionSet& dims, + const bool subtract, + Args ... args +) const +{ + typedef GeometricField<scalar, PatchField, GeoMesh> scalarGeoField; + typedef GeometricField<Type, PatchField, GeoMesh> typeGeoField; + + tmp<scalarGeoField> f1, f2; + + if (model_.valid() || model1In2_.valid()) + { + f1 = + blendedInterfacialModel::interpolate<scalarGeoField> + ( + blending_.f1(phase1_, phase2_) + ); + } + + if (model_.valid() || model2In1_.valid()) + { + f2 = + blendedInterfacialModel::interpolate<scalarGeoField> + ( + blending_.f2(phase1_, phase2_) + ); + } + + tmp<typeGeoField> x + ( + new typeGeoField + ( + IOobject + ( + ModelType::typeName + ":" + name, + phase1_.mesh().time().timeName(), + phase1_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + phase1_.mesh(), + dimensioned<Type>("zero", dims, Zero) + ) + ); + + if (model_.valid()) + { + if (subtract) + { + FatalErrorInFunction + << "Cannot treat an interfacial model with no distinction " + << "between continuous and dispersed phases as signed" + << exit(FatalError); + } + + x.ref() += (model_().*method)(args ...)*(scalar(1) - f1() - f2()); + } + + if (model1In2_.valid()) + { + x.ref() += (model1In2_().*method)(args ...)*f1; + } + + if (model2In1_.valid()) + { + tmp<typeGeoField> dx = (model2In1_().*method)(args ...)*f2; + + if (subtract) + { + x.ref() -= dx; + } + else + { + x.ref() += dx; + } + } + + if + ( + correctFixedFluxBCs_ + && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + ) + { + correctFixedFluxBCs(x.ref()); + } + + return x; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ModelType> +Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel +( + const phaseModel& phase1, + const phaseModel& phase2, + const blendingMethod& blending, + autoPtr<ModelType> model, + autoPtr<ModelType> model1In2, + autoPtr<ModelType> model2In1, + const bool correctFixedFluxBCs +) +: + regIOobject + ( + IOobject + ( + IOobject::groupName(typeName, phasePair(phase1, phase2).name()), + phase1.mesh().time().timeName(), + phase1.mesh() + ) + ), + phase1_(phase1), + phase2_(phase2), + blending_(blending), + model_(model), + model1In2_(model1In2), + model2In1_(model2In1), + correctFixedFluxBCs_(correctFixedFluxBCs) +{} + + +template<class ModelType> +Foam::BlendedInterfacialModel<ModelType>::BlendedInterfacialModel +( + const phasePair::dictTable& modelTable, + const blendingMethod& blending, + const phasePair& pair, + const orderedPhasePair& pair1In2, + const orderedPhasePair& pair2In1, + const bool correctFixedFluxBCs +) +: + regIOobject + ( + IOobject + ( + IOobject::groupName(typeName, pair.name()), + pair.phase1().mesh().time().timeName(), + pair.phase1().mesh() + ) + ), + phase1_(pair.phase1()), + phase2_(pair.phase2()), + blending_(blending), + correctFixedFluxBCs_(correctFixedFluxBCs) +{ + if (modelTable.found(pair)) + { + model_.set + ( + ModelType::New + ( + modelTable[pair], + pair + ).ptr() + ); + } + + if (modelTable.found(pair1In2)) + { + model1In2_.set + ( + ModelType::New + ( + modelTable[pair1In2], + pair1In2 + ).ptr() + ); + } + + if (modelTable.found(pair2In1)) + { + model2In1_.set + ( + ModelType::New + ( + modelTable[pair2In1], + pair2In1 + ).ptr() + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class ModelType> +Foam::BlendedInterfacialModel<ModelType>::~BlendedInterfacialModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class ModelType> +bool Foam::BlendedInterfacialModel<ModelType>::hasModel +( + const class phaseModel& phase +) const +{ + return + &phase == &(phase1_) + ? model1In2_.valid() + : model2In1_.valid(); +} + + +template<class ModelType> +const ModelType& Foam::BlendedInterfacialModel<ModelType>::model +( + const class phaseModel& phase +) const +{ + return &phase == &(phase1_) ? model1In2_ : model2In1_; +} + + +template<class ModelType> +Foam::tmp<Foam::volScalarField> +Foam::BlendedInterfacialModel<ModelType>::K() const +{ + tmp<volScalarField> (ModelType::*k)() const = &ModelType::K; + + return evaluate(k, "K", ModelType::dimK, false); +} + + +template<class ModelType> +Foam::tmp<Foam::volScalarField> +Foam::BlendedInterfacialModel<ModelType>::K(const scalar residualAlpha) const +{ + tmp<volScalarField> (ModelType::*k)(const scalar) const = &ModelType::K; + + return evaluate(k, "K", ModelType::dimK, false, residualAlpha); +} + + +template<class ModelType> +Foam::tmp<Foam::surfaceScalarField> +Foam::BlendedInterfacialModel<ModelType>::Kf() const +{ + return evaluate(&ModelType::Kf, "Kf", ModelType::dimK, false); +} + + +template<class ModelType> +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>> +Foam::BlendedInterfacialModel<ModelType>::F() const +{ + return evaluate(&ModelType::F, "F", ModelType::dimF, true); +} + + +template<class ModelType> +Foam::tmp<Foam::surfaceScalarField> +Foam::BlendedInterfacialModel<ModelType>::Ff() const +{ + return evaluate(&ModelType::Ff, "Ff", ModelType::dimF*dimArea, true); +} + + +template<class ModelType> +Foam::tmp<Foam::volScalarField> +Foam::BlendedInterfacialModel<ModelType>::D() const +{ + return evaluate(&ModelType::D, "D", ModelType::dimD, false); +} + + +template<class ModelType> +Foam::tmp<Foam::volScalarField> +Foam::BlendedInterfacialModel<ModelType>::dmdt() const +{ + return evaluate(&ModelType::dmdt, "dmdt", ModelType::dimDmdt, false); +} + + +template<class ModelType> +bool Foam::BlendedInterfacialModel<ModelType>::writeData(Ostream& os) const +{ + return os.good(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H similarity index 65% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H index 7a9bfbae3080c71778d4fed5c72b08119051de94..5bac3ea08c1b93caaf9caf552abc683fa4e719da 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,6 @@ SourceFiles #include "blendingMethod.H" #include "phasePair.H" #include "orderedPhasePair.H" - #include "geometricZeroField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,11 +47,28 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class BlendedInterfacialModel Declaration + Class blendedInterfacialModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedInterfacialModel +{ + public: + + //- Convenience function to interpolate blending values. Needs to be + // specialised, so can't sit in the templated class. + template<class GeoField> + static inline tmp<GeoField> interpolate(tmp<volScalarField> f); +}; + + +/*---------------------------------------------------------------------------*\ + Class BlendedInterfacialModel Declaration \*---------------------------------------------------------------------------*/ template<class ModelType> class BlendedInterfacialModel +: + public regIOobject { // Private data @@ -80,22 +96,41 @@ class BlendedInterfacialModel // Private Member Functions - //- No copy construct - BlendedInterfacialModel - ( - const BlendedInterfacialModel& - ) = delete; + //- Disallow default bitwise copy construct + BlendedInterfacialModel(const BlendedInterfacialModel<ModelType>&); - //- No copy assignment - void operator=(const BlendedInterfacialModel<ModelType>&) = delete; + //- Disallow default bitwise assignment + void operator=(const BlendedInterfacialModel<ModelType>&); //- Correct coeff/value on fixed flux boundary conditions - template<class GeometricField> - void correctFixedFluxBCs(GeometricField& field) const; + template<class GeoField> + void correctFixedFluxBCs(GeoField& field) const; + + //- Return the blended coeff/value + template + < + class Type, + template<class> class PatchField, + class GeoMesh, + class ... Args + > + tmp<GeometricField<Type, PatchField, GeoMesh>> evaluate + ( + tmp<GeometricField<Type, PatchField, GeoMesh>> + (ModelType::*method)(Args ...) const, + const word& name, + const dimensionSet& dims, + const bool subtract, + Args ... args + ) const; public: + //- Runtime type information + TypeName("BlendedInterfacialModel"); + + // Constructors //- Construct from two phases, blending method and three models @@ -156,9 +191,29 @@ public: //- Return the blended diffusivity tmp<volScalarField> D() const; + + //- Return the blended mass transfer rate + tmp<volScalarField> dmdt() const; + + //- Dummy write for regIOobject + bool writeData(Ostream& os) const; }; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineBlendedInterfacialModelTypeNameAndDebug(ModelType, DebugSwitch) \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + BlendedInterfacialModel<ModelType>, \ + ( \ + word(BlendedInterfacialModel<ModelType>::typeName_()) + "<" \ + + ModelType::typeName_() + ">" \ + ).c_str(), \ + DebugSwitch \ + ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C index 9459c782e60a2087e8439c0f344525f2d7aecad7..5a830960622bf02e9baf17e8be35d350deb57859 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H index 7fa708562ee624b8222472ef55d35a42ee450a9c..9f18eabf722b3b6505872bf34612a4db1db7f639 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -84,6 +84,7 @@ public: static autoPtr<blendingMethod> New ( + const word& modelName, const dictionary& dict, const wordList& phaseNames ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C similarity index 74% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index bc97cf26fd8d9cf1fe00fd664bef5b6ad0648c8f..7a3f226b0ac5e62ec356f42c377b35465d000da0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,23 +31,25 @@ License Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New ( + const word& modelName, const dictionary& dict, const wordList& phaseNames ) { - const word methodType(dict.get<word>("type")); + word blendingMethodType(dict.lookup("type")); - Info<< "Selecting " << dict.dictName() << " blending method: " - << methodType << endl; + Info<< "Selecting " << modelName << " blending method: " + << blendingMethodType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(blendingMethodType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown blendingMethod type " - << methodType << nl << nl - << "Valid blendingMethod types :" << endl + << "Unknown blendingMethodType type " + << blendingMethodType << endl << endl + << "Valid blendingMethod types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C index afa9e244ddffa60e53524699e7309345710bb09d..0ce560e1b8249d0fad06f7e3477a507a97d672d1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H index 38adabd588e4a4e27aa301229b423945e7c4b634..f8af58288ee885803147e16db7a56422381d2e43 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::hyperbolic + Foam::blendingMethods::hyperbolic Description @@ -56,7 +56,7 @@ class hyperbolic // Private data //- Minimum fraction of phases which can be considered continuous - HashTable<dimensionedScalar> minContinuousAlpha_; + HashTable<dimensionedScalar, word, word::hash> minContinuousAlpha_; //- Width of the transition const dimensionedScalar transitionAlphaScale_; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C index 129582f26a3d65f7b6664fb48fa5e4973aa5542d..0b6d5c708ef6dd59a3cb859f573ccd55d2b81ce8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H index fa7aa685ee5df813394b8f57bdef45200d4591c6..ae995ea0e560d54474a76b3c9d9f8a26764bb4f4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::linear + Foam::blendingMethods::linear Description @@ -56,10 +56,12 @@ class linear // Private data //- Minimum fraction of phases which can be considered fully continuous - HashTable<dimensionedScalar> minFullyContinuousAlpha_; + HashTable<dimensionedScalar, word, word::hash> + minFullyContinuousAlpha_; //- Minimum fraction of phases which can be considered partly continuous - HashTable<dimensionedScalar> minPartlyContinuousAlpha_; + HashTable<dimensionedScalar, word, word::hash> + minPartlyContinuousAlpha_; public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C similarity index 71% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C index ab95e0dad6a12ba3dfcfa1f2c4f565f9537a32ed..67b630fbd2f860382f23e9aadd27df6e7785bd36 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,26 +74,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1 { const fvMesh& mesh(phase1.mesh()); - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "f", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar - ( - "f", - dimless, - phase2.name() == continuousPhase_ - ) - ) - ); + return volScalarField::New + ( + "f", + mesh, + dimensionedScalar("one", dimless, phase2.name() == continuousPhase_) + ); } @@ -105,26 +91,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2 { const fvMesh& mesh(phase1.mesh()); - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "f", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar - ( - "f", - dimless, - phase1.name() == continuousPhase_ - ) - ) - ); + return volScalarField::New + ( + "f", + mesh, + dimensionedScalar("one", dimless, phase1.name() == continuousPhase_) + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H index 2462a9b0de77430aeb14183d066e2deca19e15f3..8775f5a457b78368c6ac09275f2fbb39d1e2adbe 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::noBlending + Foam::blendingMethods::noBlending Description diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/files b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..ee98c2c78642cb670792500aca329eafd55b5c20 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/files @@ -0,0 +1,60 @@ +phaseModel/phaseModel/phaseModel.C +phaseModel/phaseModel/newPhaseModel.C +phaseModel/phaseModel/phaseModels.C + +phasePair/phasePairKey/phasePairKey.C +phasePair/phasePair/phasePair.C +phasePair/orderedPhasePair/orderedPhasePair.C + +phaseSystem/phaseSystem.C + +diameterModels/diameterModel/diameterModel.C +diameterModels/diameterModel/newDiameterModel.C +diameterModels/constantDiameter/constantDiameter.C +diameterModels/isothermalDiameter/isothermalDiameter.C +diameterModels/linearTsubDiameter/linearTsubDiameter.C +diameterModels/velocityGroup/velocityGroup.C + +populationBalanceModel/populationBalanceModel/populationBalanceModel.C +diameterModels/velocityGroup/sizeGroup/sizeGroup.C + +populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C +populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.C +populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.C +populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.C +populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.C +populationBalanceModel/coalescenceModels/Luo/Luo.C +populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.C + +populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C +populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.C +populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.C +populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.C + +populationBalanceModel/breakupModels/breakupModel/breakupModel.C +populationBalanceModel/breakupModels/exponential/exponential.C +populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.C +populationBalanceModel/breakupModels/powerLaw/powerLaw.C + +populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C +populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.C +populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.C + +populationBalanceModel/driftModels/driftModel/driftModel.C +populationBalanceModel/driftModels/constantDrift/constantDrift.C +populationBalanceModel/driftModels/densityChange/densityChange.C +populationBalanceModel/driftModels/phaseChange/phaseChange.C + +populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C +populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.C +populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C + +BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C +BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +BlendedInterfacialModel/blendingMethods/linear/linear.C +BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C + +reactionThermo/hRefConstThermos.C + +LIB = $(FOAM_LIBBIN)/libreactingPhaseSystem diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options index 50ef9b5521ef2b4663bac8860cff12d8b17d9602..8f13443f893a7633c7c0c494d030de63da483890 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options @@ -1,9 +1,10 @@ EXE_INC = \ - -I../interfacialModels/lnInclude \ - -I../interfacialCompositionModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ + -I../interfacialModels/lnInclude \ + -I../interfacialCompositionModels/lnInclude \ + -I../derivedFvPatchFields/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..53658069ebf407a033eb2b18dac79bc46168e2d3 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C @@ -0,0 +1,522 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "InterfaceCompositionPhaseChangePhaseSystem.H" +#include "interfaceCompositionModel.H" +#include "massTransferModel.H" + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt +( + const phasePairKey& key +) const +{ + tmp<volScalarField> tIDmdt = phaseSystem::dmdt(key); + + const phasePair unorderedPair + ( + this->phases()[key.first()], + this->phases()[key.second()] + ); + + forAllConstIter(phasePair, unorderedPair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + const phasePair pair(phase, otherPhase, true); + + if (interfaceCompositionModels_.found(pair)) + { + const scalar iDmdtSign = Pair<word>::compare(pair, key); + + forAllConstIter + ( + hashedWordList, + interfaceCompositionModels_[pair]->species(), + memberIter + ) + { + const word& member = *memberIter; + + const word name(IOobject::groupName(member, phase.name())); + const word otherName + ( + IOobject::groupName(member, otherPhase.name()) + ); + + tIDmdt.ref() += + iDmdtSign + *( + *(*iDmdtSu_[pair])[member] + + *(*iDmdtSp_[pair])[member]*phase.Y(member) + ); + } + } + } + + return tIDmdt; +} + + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: +InterfaceCompositionPhaseChangePhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh), + nInterfaceCorrectors_ + ( + this->template lookupOrDefault<label>("nInterfaceCorrectors", 1) + ) +{ + this->generatePairsAndSubModels + ( + "interfaceComposition", + interfaceCompositionModels_ + ); + + this->generatePairsAndSubModels + ( + "massTransfer", + massTransferModels_, + false + ); + + // Check that models have been specified in the correct combinations + forAllConstIter + ( + interfaceCompositionModelTable, + interfaceCompositionModels_, + interfaceCompositionModelIter + ) + { + const phasePair& pair = + this->phasePairs_[interfaceCompositionModelIter.key()]; + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + + if (!pair.ordered()) + { + FatalErrorInFunction + << "An interfacial composition model is specified for the " + << "unordered " << pair << " pair. Composition models only " + << "apply to ordered pairs. An entry for a " + << phasePairKey("A", "B", true) << " pair means a model for " + << "the A side of the A-B interface; i.e., \"A in the presence " + << "of B\"" + << exit(FatalError); + } + + + const phasePairKey key(phase.name(), otherPhase.name()); + + if (!this->phasePairs_.found(key)) + { + FatalErrorInFunction + << "A mass transfer model the " << key << " pair is not " + << "specified. This is required by the corresponding interface " + << "composition model." + << exit(FatalError); + } + + const phasePair& uoPair = this->phasePairs_[key]; + + if (!massTransferModels_[uoPair][uoPair.index(phase)].valid()) + { + FatalErrorInFunction + << "A mass transfer model for the " << pair.phase1().name() + << " side of the " << uoPair << " pair is not " + << "specified. This is required by the corresponding interface " + << "composition model." + << exit(FatalError); + } + } + forAllConstIter + ( + massTransferModelTable, + massTransferModels_, + massTransferModelIter + ) + { + const phasePair& pair = + this->phasePairs_[massTransferModelIter.key()]; + + if (!this->heatTransferModels_.found(pair)) + { + FatalErrorInFunction + << "A heat transfer model for " << pair << " pair is not " + << "specified. This is required by the corresponding species " + << "transfer model" + << exit(FatalError); + } + } + + // Generate mass transfer fields, initially assumed to be zero + forAllConstIter + ( + interfaceCompositionModelTable, + interfaceCompositionModels_, + interfaceCompositionModelIter + ) + { + const interfaceCompositionModel& compositionModel = + interfaceCompositionModelIter(); + + const phasePair& pair = + this->phasePairs_[interfaceCompositionModelIter.key()]; + + iDmdtSu_.set(pair, new HashPtrTable<volScalarField>()); + iDmdtSp_.set(pair, new HashPtrTable<volScalarField>()); + + forAllConstIter(hashedWordList, compositionModel.species(), memberIter) + { + const word& member = *memberIter; + + iDmdtSu_[pair]->set + ( + member, + new volScalarField + ( + IOobject + ( + IOobject::groupName("iDmdtSu", pair.name()), + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensionedScalar(dimDensity/dimTime) + ) + ); + + iDmdtSp_[pair]->set + ( + member, + new volScalarField + ( + IOobject + ( + IOobject::groupName("iDmdtSp", pair.name()), + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensionedScalar(dimDensity/dimTime) + ) + ); + } + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: +~InterfaceCompositionPhaseChangePhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::dmdt +( + const phasePairKey& key +) const +{ + return BasePhaseSystem::dmdt(key) + this->iDmdt(key); +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::volScalarField> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::dmdts() const +{ + PtrList<volScalarField> dmdts(BasePhaseSystem::dmdts()); + + forAllConstIter + ( + interfaceCompositionModelTable, + interfaceCompositionModels_, + interfaceCompositionModelIter + ) + { + const interfaceCompositionModel& compositionModel = + interfaceCompositionModelIter(); + + const phasePair& pair = + this->phasePairs_[interfaceCompositionModelIter.key()]; + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + + forAllConstIter(hashedWordList, compositionModel.species(), memberIter) + { + const word& member = *memberIter; + + const word name(IOobject::groupName(member, phase.name())); + const word otherName + ( + IOobject::groupName(member, otherPhase.name()) + ); + + const volScalarField iDmdt + ( + *(*iDmdtSu_[pair])[member] + + *(*iDmdtSp_[pair])[member]*phase.Y(member) + ); + + this->addField(phase, "dmdt", iDmdt, dmdts); + this->addField(otherPhase, "dmdt", - iDmdt, dmdts); + } + } + + return dmdts; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::massTransferTable> +Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: +massTransfer() const +{ + autoPtr<phaseSystem::massTransferTable> eqnsPtr = + BasePhaseSystem::massTransfer(); + + phaseSystem::massTransferTable& eqns = eqnsPtr(); + + // Sum up the contribution from each interface composition model + forAllConstIter + ( + interfaceCompositionModelTable, + interfaceCompositionModels_, + interfaceCompositionModelIter + ) + { + const interfaceCompositionModel& compositionModel = + interfaceCompositionModelIter(); + + const phasePair& pair = + this->phasePairs_[interfaceCompositionModelIter.key()]; + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + const phasePair& unorderedPair = + this->phasePairs_[phasePair(phase, otherPhase)]; + + const volScalarField& Tf(*this->Tf_[unorderedPair]); + + const volScalarField K + ( + massTransferModels_[unorderedPair][unorderedPair.index(phase)]->K() + ); + + forAllConstIter(hashedWordList, compositionModel.species(), memberIter) + { + const word& member = *memberIter; + + const word name(IOobject::groupName(member, phase.name())); + const word otherName + ( + IOobject::groupName(member, otherPhase.name()) + ); + + const volScalarField KD(K*compositionModel.D(member)); + + const volScalarField Yf(compositionModel.Yf(member, Tf)); + + *(*iDmdtSu_[pair])[member] = phase.rho()*KD*Yf; + *(*iDmdtSp_[pair])[member] = - phase.rho()*KD; + + const fvScalarMatrix eqn + ( + *(*iDmdtSu_[pair])[member] + + fvm::Sp(*(*iDmdtSp_[pair])[member], phase.Y(member)) + ); + + const volScalarField iDmdt + ( + *(*iDmdtSu_[pair])[member] + + *(*iDmdtSp_[pair])[member]*phase.Y(member) + ); + + // Implicit transport through this phase + *eqns[name] += eqn; + + // Explicit transport out of the other phase + if (eqns.found(otherName)) + { + *eqns[otherName] -= iDmdt; + } + } + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +void Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>:: +correctInterfaceThermo() +{ + // This loop solves for the interface temperatures, Tf, and updates the + // interface composition models. + // + // The rate of heat transfer to the interface must equal the latent heat + // consumed at the interface, i.e.: + // + // H1*(T1 - Tf) + H2*(T2 - Tf) == mDotL + // == K*rho*(Yfi - Yi)*Li + // + // Yfi is likely to be a strong non-linear (typically exponential) function + // of Tf, so the solution for the temperature is newton-accelerated + + forAllConstIter + ( + typename BasePhaseSystem::heatTransferModelTable, + this->heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair = + this->phasePairs_[heatTransferModelIter.key()]; + + const phasePairKey key12(pair.first(), pair.second(), true); + const phasePairKey key21(pair.second(), pair.first(), true); + + const volScalarField H1(heatTransferModelIter().first()->K()); + const volScalarField H2(heatTransferModelIter().second()->K()); + const dimensionedScalar HSmall("small", heatTransferModel::dimK, SMALL); + + volScalarField& Tf = *this->Tf_[pair]; + + for (label i = 0; i < nInterfaceCorrectors_; ++ i) + { + volScalarField mDotL + ( + IOobject + ( + "mDotL", + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensionedScalar(dimEnergy/dimVolume/dimTime) + ); + volScalarField mDotLPrime + ( + IOobject + ( + "mDotLPrime", + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensionedScalar(mDotL.dimensions()/dimTemperature) + ); + + // Add latent heats from forward and backward models + if (this->interfaceCompositionModels_.found(key12)) + { + this->interfaceCompositionModels_[key12]->addMDotL + ( + massTransferModels_[pair].first()->K(), + Tf, + mDotL, + mDotLPrime + ); + } + if (this->interfaceCompositionModels_.found(key21)) + { + this->interfaceCompositionModels_[key21]->addMDotL + ( + massTransferModels_[pair].second()->K(), + Tf, + mDotL, + mDotLPrime + ); + } + + // Update the interface temperature by applying one step of newton's + // method to the interface relation + Tf -= + ( + H1*(Tf - pair.phase1().thermo().T()) + + H2*(Tf - pair.phase2().thermo().T()) + + mDotL + ) + /( + max(H1 + H2 + mDotLPrime, HSmall) + ); + + Tf.correctBoundaryConditions(); + + Info<< "Tf." << pair.name() + << ": min = " << min(Tf.primitiveField()) + << ", mean = " << average(Tf.primitiveField()) + << ", max = " << max(Tf.primitiveField()) + << endl; + + // Update the interface compositions + if (this->interfaceCompositionModels_.found(key12)) + { + this->interfaceCompositionModels_[key12]->update(Tf); + } + if (this->interfaceCompositionModels_.found(key21)) + { + this->interfaceCompositionModels_[key21]->update(Tf); + } + } + } +} + + +template<class BasePhaseSystem> +bool Foam::InterfaceCompositionPhaseChangePhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H similarity index 69% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H index cc3d6f8185aaa15e3b806167c507233e0f753649..739b904436599590b873a304d3c4590a75f7d22e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,7 +42,7 @@ SourceFiles #ifndef InterfaceCompositionPhaseChangePhaseSystem_H #define InterfaceCompositionPhaseChangePhaseSystem_H -#include "HeatAndMassTransferPhaseSystem.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,6 +50,7 @@ namespace Foam { class interfaceCompositionModel; +class massTransferModel; /*---------------------------------------------------------------------------*\ Class InterfaceCompositionPhaseChangePhaseSystem Declaration @@ -58,7 +59,7 @@ class interfaceCompositionModel; template<class BasePhaseSystem> class InterfaceCompositionPhaseChangePhaseSystem : - public HeatAndMassTransferPhaseSystem<BasePhaseSystem> + public BasePhaseSystem { protected: @@ -71,14 +72,50 @@ protected: phasePairKey::hash > interfaceCompositionModelTable; + typedef HashTable + < + Pair<autoPtr<BlendedInterfacialModel<massTransferModel>>>, + phasePairKey, + phasePairKey::hash + > massTransferModelTable; + + typedef HashPtrTable + < + HashPtrTable<volScalarField>, + phasePairKey, + phasePairKey::hash + > + iDmdtSuSpTable; + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + iDmdtTable; + // Protected data // Sub Models + //- The number of interface correctors + const label nInterfaceCorrectors_; + + //- Mass transfer models + massTransferModelTable massTransferModels_; + //- Interface composition models interfaceCompositionModelTable interfaceCompositionModels_; + //- The explicit part of the interfacial mass transfer rates + iDmdtSuSpTable iDmdtSu_; + + //- The implicit part of the interfacial mass transfer rates + iDmdtSuSpTable iDmdtSp_; + + + // Protected member functions + + //- Return the interfacial mass transfer rate for a pair for a pair + virtual tmp<volScalarField> iDmdt(const phasePairKey& key) const; + public: @@ -94,11 +131,17 @@ public: // Member Functions + //- Return the mass transfer rate for a pair + virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; + + //- Return the mass transfer rates for each phase + virtual PtrList<volScalarField> dmdts() const; + //- Return the mass transfer matrices virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; - //- Correct the thermodynamics - virtual void correctThermo(); + //- Correct the interface temperatures + virtual void correctInterfaceThermo(); //- Read base phaseProperties dictionary virtual bool read(); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..44955ee9f3cf8dad769411c8e63e414dc14656e1 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C @@ -0,0 +1,1272 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "MomentumTransferPhaseSystem.H" + +#include "BlendedInterfacialModel.H" +#include "dragModel.H" +#include "virtualMassModel.H" +#include "liftModel.H" +#include "wallLubricationModel.H" +#include "turbulentDispersionModel.H" + +#include "HashPtrTable.H" + +#include "fvmDdt.H" +#include "fvmDiv.H" +#include "fvmSup.H" +#include "fvcAverage.H" +#include "fvcDdt.H" +#include "fvcDiv.H" +#include "fvcFlux.H" +#include "fvcSnGrad.H" +#include "fvMatrix.H" + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd +( + const phasePairKey& key +) const +{ + if (dragModels_.found(key)) + { + return dragModels_[key]->K(); + } + else + { + return volScalarField::New + ( + dragModel::typeName + ":K", + this->mesh_, + dimensionedScalar(dragModel::dimK) + ); + } +} + + +template<class BasePhaseSystem> +Foam::tmp<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kdf +( + const phasePairKey& key +) const +{ + if (dragModels_.found(key)) + { + return dragModels_[key]->Kf(); + } + else + { + return surfaceScalarField::New + ( + dragModel::typeName + ":K", + this->mesh_, + dimensionedScalar(dragModel::dimK) + ); + } +} + + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Vm +( + const phasePairKey& key +) const +{ + if (virtualMassModels_.found(key)) + { + return virtualMassModels_[key]->K(); + } + else + { + return volScalarField::New + ( + virtualMassModel::typeName + ":K", + this->mesh_, + dimensionedScalar(virtualMassModel::dimK) + ); + } +} + + +template<class BasePhaseSystem> +void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>:: +addMassTransferMomentumTransfer(phaseSystem::momentumTransferTable& eqns) const +{ + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + // Note that the phase UEqn contains a continuity error term, which + // implicitly adds a mass transfer term of fvm::Sp(dmdt, U). These + // additions do not include this term. + + const volScalarField dmdt(this->dmdt(pair)); + + if (!pair.phase1().stationary()) + { + fvVectorMatrix& eqn = *eqns[pair.phase1().name()]; + const volScalarField dmdt21(posPart(dmdt)); + + eqn += dmdt21*pair.phase2().U() - fvm::Sp(dmdt21, eqn.psi()); + } + + if (!pair.phase2().stationary()) + { + fvVectorMatrix& eqn = *eqns[pair.phase2().name()]; + const volScalarField dmdt12(negPart(dmdt)); + + eqn -= dmdt12*pair.phase1().U() - fvm::Sp(dmdt12, eqn.psi()); + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>:: +MomentumTransferPhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh) +{ + this->generatePairsAndSubModels + ( + "drag", + dragModels_ + ); + + this->generatePairsAndSubModels + ( + "virtualMass", + virtualMassModels_ + ); + + this->generatePairsAndSubModels + ( + "lift", + liftModels_ + ); + + this->generatePairsAndSubModels + ( + "wallLubrication", + wallLubricationModels_ + ); + + this->generatePairsAndSubModels + ( + "turbulentDispersion", + turbulentDispersionModels_ + ); + + forAllConstIter + ( + dragModelTable, + dragModels_, + dragModelIter + ) + { + const phasePair& pair(this->phasePairs_[dragModelIter.key()]); + + Kds_.set + ( + pair, + new volScalarField + ( + IOobject::groupName("Kd", pair.name()), + dragModelIter()->K() + ) + ); + + Kdfs_.set + ( + pair, + new surfaceScalarField + ( + IOobject::groupName("Kdf", pair.name()), + dragModelIter()->Kf() + ) + ); + } + + forAllConstIter + ( + virtualMassModelTable, + virtualMassModels_, + virtualMassModelIter + ) + { + const phasePair& pair(this->phasePairs_[virtualMassModelIter.key()]); + + Vms_.set + ( + pair, + new volScalarField + ( + IOobject::groupName("Vm", pair.name()), + virtualMassModelIter()->K() + ) + ); + + Vmfs_.set + ( + pair, + new surfaceScalarField + ( + IOobject::groupName("Vmf", pair.name()), + virtualMassModelIter()->Kf() + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>:: +~MomentumTransferPhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::momentumTransferTable> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() +{ + // Create a momentum transfer matrix for each phase + autoPtr<phaseSystem::momentumTransferTable> eqnsPtr + ( + new phaseSystem::momentumTransferTable() + ); + + phaseSystem::momentumTransferTable& eqns = eqnsPtr(); + + forAll(this->movingPhases(), movingPhasei) + { + const phaseModel& phase = this->movingPhases()[movingPhasei]; + + eqns.set + ( + phase.name(), + new fvVectorMatrix(phase.U(), dimMass*dimVelocity/dimTime) + ); + } + + // Update the drag coefficients + forAllConstIter + ( + dragModelTable, + dragModels_, + dragModelIter + ) + { + *Kds_[dragModelIter.key()] = dragModelIter()->K(); + *Kdfs_[dragModelIter.key()] = dragModelIter()->Kf(); + } + + // Add the implicit part of the drag force + forAllConstIter(KdTable, Kds_, KdIter) + { + const volScalarField& K(*KdIter()); + const phasePair& pair(this->phasePairs_[KdIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + if (!iter().stationary()) + { + fvVectorMatrix& eqn = *eqns[iter().name()]; + + eqn -= fvm::Sp(K, eqn.psi()); + } + } + } + + // Update the virtual mass coefficients + forAllConstIter + ( + virtualMassModelTable, + virtualMassModels_, + virtualMassModelIter + ) + { + *Vms_[virtualMassModelIter.key()] = virtualMassModelIter()->K(); + *Vmfs_[virtualMassModelIter.key()] = virtualMassModelIter()->Kf(); + } + + // Add the virtual mass force + forAllConstIter(VmTable, Vms_, VmIter) + { + const volScalarField& Vm(*VmIter()); + const phasePair& pair(this->phasePairs_[VmIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + + if (!phase.stationary()) + { + fvVectorMatrix& eqn = *eqns[phase.name()]; + + const volVectorField& U = eqn.psi(); + const surfaceScalarField& phi = phase.phi(); + + eqn -= + Vm + *( + fvm::ddt(U) + + fvm::div(phi, U) + - fvm::Sp(fvc::div(phi), U) + - otherPhase.DUDt() + ) + + this->MRF_.DDt(Vm, U - otherPhase.U()); + } + } + } + + // Add the source term due to mass transfer + addMassTransferMomentumTransfer(eqns); + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::momentumTransferTable> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransferf() +{ + // Create a momentum transfer matrix for each phase + autoPtr<phaseSystem::momentumTransferTable> eqnsPtr + ( + new phaseSystem::momentumTransferTable() + ); + + phaseSystem::momentumTransferTable& eqns = eqnsPtr(); + + forAll(this->movingPhases(), movingPhasei) + { + const phaseModel& phase = this->movingPhases()[movingPhasei]; + + eqns.set + ( + phase.name(), + new fvVectorMatrix(phase.U(), dimMass*dimVelocity/dimTime) + ); + } + + // Create U & grad(U) fields + PtrList<fvVectorMatrix> UgradUs(this->phaseModels_.size()); + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + if (!phase.stationary()) + { + const volVectorField& U = phase.U(); + + UgradUs.set + ( + phasei, + new fvVectorMatrix + ( + fvm::div(phase.phi(), U) + - fvm::Sp(fvc::div(phase.phi()), U) + + this->MRF().DDt(U) + ) + ); + } + } + + // Add the virtual mass force + forAllConstIter(VmTable, Vms_, VmIter) + { + const volScalarField& Vm(*VmIter()); + const phasePair& pair(this->phasePairs_[VmIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + + if (!phase.stationary()) + { + *eqns[phase.name()] -= + Vm + *( + UgradUs[phase.index()] + - (UgradUs[otherPhase.index()] & otherPhase.U()) + ); + } + } + } + + // Add the source term due to mass transfer + addMassTransferMomentumTransfer(eqns); + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::AFfs() const +{ + PtrList<surfaceScalarField> AFfs(this->phaseModels_.size()); + + // Add the implicit part of the drag force + forAllConstIter(KdfTable, Kdfs_, KdfIter) + { + const surfaceScalarField& Kf(*KdfIter()); + const phasePair& pair(this->phasePairs_[KdfIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField(iter(), "AFf", Kf, AFfs); + } + } + + // Add the implicit part of the virtual mass force + forAllConstIter(VmfTable, Vmfs_, VmfIter) + { + const surfaceScalarField& Vmf(*VmfIter()); + const phasePair& pair(this->phasePairs_[VmfIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField(iter(), "AFf", byDt(Vmf), AFfs); + } + } + + if (this->fillFields_) + { + this->fillFields("AFf", dimDensity/dimTime, AFfs); + } + + return AFfs; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiFs +( + const PtrList<volScalarField>& rAUs +) +{ + PtrList<surfaceScalarField> phiFs(this->phaseModels_.size()); + + // Add the lift force + forAllConstIter + ( + liftModelTable, + liftModels_, + liftModelIter + ) + { + const volVectorField F(liftModelIter()->F<vector>()); + const phasePair& pair(this->phasePairs_[liftModelIter.key()]); + + this->addField + ( + pair.phase1(), + "phiF", + fvc::flux(rAUs[pair.phase1().index()]*F), + phiFs + ); + this->addField + ( + pair.phase2(), + "phiF", + - fvc::flux(rAUs[pair.phase2().index()]*F), + phiFs + ); + } + + // Add the wall lubrication force + forAllConstIter + ( + wallLubricationModelTable, + wallLubricationModels_, + wallLubricationModelIter + ) + { + const volVectorField F(wallLubricationModelIter()->F<vector>()); + const phasePair& + pair(this->phasePairs_[wallLubricationModelIter.key()]); + + this->addField + ( + pair.phase1(), + "phiF", + fvc::flux(rAUs[pair.phase1().index()]*F), + phiFs + ); + this->addField + ( + pair.phase2(), + "phiF", + - fvc::flux(rAUs[pair.phase2().index()]*F), + phiFs + ); + } + + // Add the phase pressure + DByAfs_.clear(); + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + const surfaceScalarField pPrimeByAf + ( + fvc::interpolate(rAUs[phasei]*phase.pPrime()) + ); + + const surfaceScalarField snGradAlpha1 + ( + fvc::snGrad(phase)*this->mesh_.magSf() + ); + + this->addField(phase, "phiF", pPrimeByAf*snGradAlpha1, phiFs); + + const bool implicitPhasePressure = + this->mesh_.solverDict(phase.volScalarField::name()). + template lookupOrDefault<Switch> + ( + "implicitPhasePressure", + false + ); + + if (implicitPhasePressure) + { + this->addField(phase, "DByAf", pPrimeByAf, DByAfs_); + } + } + + // Add the turbulent dispersion force + forAllConstIter + ( + turbulentDispersionModelTable, + turbulentDispersionModels_, + turbulentDispersionModelIter + ) + { + const phasePair& + pair(this->phasePairs_[turbulentDispersionModelIter.key()]); + + const volScalarField D(turbulentDispersionModelIter()->D()); + + const surfaceScalarField DByA1f + ( + fvc::interpolate(rAUs[pair.phase1().index()]*D) + ); + const surfaceScalarField DByA2f + ( + fvc::interpolate(rAUs[pair.phase2().index()]*D) + ); + + const surfaceScalarField snGradAlpha1 + ( + fvc::snGrad(pair.phase1())*this->mesh_.magSf() + ); + + this->addField(pair.phase1(), "phiF", DByA1f*snGradAlpha1, phiFs); + this->addField(pair.phase2(), "phiF", - DByA2f*snGradAlpha1, phiFs); + + if (DByAfs_.found(pair.phase1().name())) + { + this->addField(pair.phase1(), "DByAf", DByA1f, DByAfs_); + } + } + + if (this->fillFields_) + { + this->fillFields("phiF", dimForce/dimDensity/dimVelocity, phiFs); + } + + return phiFs; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiFfs +( + const PtrList<surfaceScalarField>& rAUfs +) +{ + PtrList<surfaceScalarField> phiFfs(this->phaseModels_.size()); + + // Add the explicit part of the virtual mass force + forAllConstIter(VmfTable, Vmfs_, VmfIter) + { + const surfaceScalarField& Vmf(*VmfIter()); + const phasePair& pair(this->phasePairs_[VmfIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField + ( + iter(), + "phiFf", + - rAUfs[iter().index()]*Vmf + *( + byDt(this->MRF().absolute(iter().phi()().oldTime())) + + iter.otherPhase().DUDtf() + ), + phiFfs + ); + } + } + + // Add the lift force + forAllConstIter + ( + liftModelTable, + liftModels_, + liftModelIter + ) + { + const surfaceScalarField Ff(liftModelIter()->Ff()); + const phasePair& pair(this->phasePairs_[liftModelIter.key()]); + + this->addField + ( + pair.phase1(), + "phiFs", + rAUfs[pair.phase1().index()]*Ff, + phiFfs + ); + this->addField + ( + pair.phase2(), + "phiFf", + - rAUfs[pair.phase2().index()]*Ff, + phiFfs + ); + } + + // Add the wall lubrication force + forAllConstIter + ( + wallLubricationModelTable, + wallLubricationModels_, + wallLubricationModelIter + ) + { + const surfaceScalarField Ff(wallLubricationModelIter()->Ff()); + const phasePair& + pair(this->phasePairs_[wallLubricationModelIter.key()]); + + this->addField + ( + pair.phase1(), + "phiFf", + rAUfs[pair.phase1().index()]*Ff, + phiFfs + ); + this->addField + ( + pair.phase2(), + "phiFf", + - rAUfs[pair.phase2().index()]*Ff, + phiFfs + ); + } + + // Add the phase pressure + DByAfs_.clear(); + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + const surfaceScalarField pPrimeByAf + ( + rAUfs[phasei]*fvc::interpolate(phase.pPrime()) + ); + + const surfaceScalarField snGradAlpha1 + ( + fvc::snGrad(phase)*this->mesh_.magSf() + ); + + this->addField(phase, "phiFf", pPrimeByAf*snGradAlpha1, phiFfs); + + const bool implicitPhasePressure = + this->mesh_.solverDict(phase.volScalarField::name()). + template lookupOrDefault<Switch> + ( + "implicitPhasePressure", + false + ); + + if (implicitPhasePressure) + { + this->addField(phase, "DByAf", pPrimeByAf, DByAfs_); + } + } + + // Add the turbulent dispersion force and phase pressure + forAllConstIter + ( + turbulentDispersionModelTable, + turbulentDispersionModels_, + turbulentDispersionModelIter + ) + { + const phasePair& + pair(this->phasePairs_[turbulentDispersionModelIter.key()]); + + const volScalarField D(turbulentDispersionModelIter()->D()); + + const surfaceScalarField DByAf1 + ( + rAUfs[pair.phase1().index()]*fvc::interpolate(D) + ); + const surfaceScalarField DByAf2 + ( + rAUfs[pair.phase2().index()]*fvc::interpolate(D) + ); + + const surfaceScalarField snGradAlpha1 + ( + fvc::snGrad(pair.phase1())*this->mesh_.magSf() + ); + + this->addField(pair.phase1(), "phiFf", DByAf1*snGradAlpha1, phiFfs); + this->addField(pair.phase2(), "phiFf", - DByAf2*snGradAlpha1, phiFfs); + + if (DByAfs_.found(pair.phase1().name())) + { + this->addField(pair.phase1(), "DByAf", DByAf1, DByAfs_); + } + } + + if (this->fillFields_) + { + this->fillFields("phiFf", dimForce/dimDensity/dimVelocity, phiFfs); + } + + return phiFfs; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiKdPhis +( + const PtrList<volScalarField>& rAUs +) const +{ + PtrList<surfaceScalarField> phiKdPhis(this->phaseModels_.size()); + + // Add the explicit part of the drag force + forAllConstIter(KdTable, Kds_, KdIter) + { + const volScalarField& K(*KdIter()); + const phasePair& pair(this->phasePairs_[KdIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField + ( + iter(), + "phiKdPhi", + - fvc::interpolate(rAUs[iter().index()]*K) + *this->MRF().absolute(iter.otherPhase().phi()), + phiKdPhis + ); + } + } + + if (this->fillFields_) + { + this->fillFields + ( + "phiKdPhi", + dimForce/dimDensity/dimVelocity, + phiKdPhis + ); + } + + return phiKdPhis; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::phiKdPhifs +( + const PtrList<surfaceScalarField>& rAUfs +) const +{ + PtrList<surfaceScalarField> phiKdPhifs(this->phaseModels_.size()); + + // Add the explicit part of the drag force + forAllConstIter(KdfTable, Kdfs_, KdfIter) + { + const surfaceScalarField& Kf(*KdfIter()); + const phasePair& pair(this->phasePairs_[KdfIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField + ( + iter(), + "phiKdPhif", + - rAUfs[iter().index()]*Kf + *this->MRF().absolute(iter.otherPhase().phi()), + phiKdPhifs + ); + } + } + + if (this->fillFields_) + { + this->fillFields + ( + "phiKdPhif", + dimForce/dimDensity/dimVelocity, + phiKdPhifs + ); + } + + return phiKdPhifs; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::volVectorField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::KdUByAs +( + const PtrList<volScalarField>& rAUs +) const +{ + PtrList<volVectorField> KdUByAs(this->phaseModels_.size()); + + // Add the explicit part of the drag force + forAllConstIter(KdTable, Kds_, KdIter) + { + const volScalarField& K(*KdIter()); + const phasePair& pair(this->phasePairs_[KdIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + this->addField + ( + iter(), + "KdUByA", + - rAUs[iter().index()]*K*iter.otherPhase().U(), + KdUByAs + ); + } + } + + if (this->fillFields_) + { + this->fillFields("KdUByA", dimVelocity, KdUByAs); + } + + return KdUByAs; +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::surfaceScalarField> +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::ddtCorrByAs +( + const PtrList<volScalarField>& rAUs, + const bool includeVirtualMass +) const +{ + PtrList<surfaceScalarField> ddtCorrByAs(this->phaseModels_.size()); + + // Construct phi differences + PtrList<surfaceScalarField> phiCorrs(this->phaseModels_.size()); + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + phiCorrs.set + ( + phasei, + this->MRF().absolute(phase.phi()().oldTime()) + - fvc::flux(phase.U()().oldTime()) + ); + } + + // Add correction + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + const volScalarField& alpha = phase; + + // Apply ddtPhiCorr filter in pure(ish) phases + surfaceScalarField alphafBar + ( + fvc::interpolate(fvc::average(fvc::interpolate(alpha))) + ); + + tmp<surfaceScalarField> phiCorrCoeff = pos0(alphafBar - 0.99); + + surfaceScalarField::Boundary& phiCorrCoeffBf = + phiCorrCoeff.ref().boundaryFieldRef(); + + forAll(this->mesh_.boundary(), patchi) + { + // Set ddtPhiCorr to 0 on non-coupled boundaries + if + ( + !this->mesh_.boundary()[patchi].coupled() + || isA<cyclicAMIFvPatch>(this->mesh_.boundary()[patchi]) + ) + { + phiCorrCoeffBf[patchi] = 0; + } + } + + this->addField + ( + phase, + "ddtCorrByA", + - phiCorrCoeff*phiCorrs[phasei]*fvc::interpolate + ( + byDt(alpha.oldTime()*phase.rho()().oldTime()*rAUs[phasei]) + ), + ddtCorrByAs + ); + } + + // Add virtual mass correction + if (includeVirtualMass) + { + forAllConstIter(VmTable, Vms_, VmIter) + { + const volScalarField& Vm(*VmIter()); + const phasePair& pair(this->phasePairs_[VmIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + + this->addField + ( + iter(), + "ddtCorrByA", + - fvc::interpolate(Vm*byDt(rAUs[phase.index()])) + *( + phiCorrs[phase.index()] + + this->MRF().absolute(otherPhase.phi()) + - fvc::flux(otherPhase.U()) + - phiCorrs[otherPhase.index()] + ), + ddtCorrByAs + ); + } + } + } + + return ddtCorrByAs; +} + + +template<class BasePhaseSystem> +void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::partialElimination +( + const PtrList<volScalarField>& rAUs +) +{ + Info<< "Inverting drag systems: "; + + phaseSystem::phaseModelList& phases = this->phaseModels_; + + // Create drag coefficient matrices + PtrList<PtrList<volScalarField>> KdByAs(phases.size()); + PtrList<PtrList<surfaceScalarField>> phiKds(phases.size()); + + forAll(phases, phasei) + { + KdByAs.set + ( + phasei, + new PtrList<volScalarField>(phases.size()) + ); + + phiKds.set + ( + phasei, + new PtrList<surfaceScalarField>(phases.size()) + ); + } + + forAllConstIter(KdTable, Kds_, KdIter) + { + const volScalarField& K(*KdIter()); + const phasePair& pair(this->phasePairs_[KdIter.key()]); + + const label phase1i = pair.phase1().index(); + const label phase2i = pair.phase2().index(); + + this->addField + ( + pair.phase2(), + "KdByA", + - rAUs[phase1i]*K, + KdByAs[phase1i] + ); + this->addField + ( + pair.phase1(), + "KdByA", + - rAUs[phase2i]*K, + KdByAs[phase2i] + ); + + this->addField + ( + pair.phase2(), + "phiKd", + fvc::interpolate(KdByAs[phase1i][phase2i]), + phiKds[phase1i] + ); + this->addField + ( + pair.phase1(), + "phiKd", + fvc::interpolate(KdByAs[phase2i][phase1i]), + phiKds[phase2i] + ); + } + + forAll(phases, phasei) + { + this->fillFields("KdByAs", dimless, KdByAs[phasei]); + this->fillFields("phiKds", dimless, phiKds[phasei]); + + KdByAs[phasei][phasei] = 1; + phiKds[phasei][phasei] = 1; + } + + // Decompose + for (label i = 0; i < phases.size(); ++ i) + { + for (label j = i + 1; j < phases.size(); ++ j) + { + KdByAs[i][j] /= KdByAs[i][i]; + phiKds[i][j] /= phiKds[i][i]; + for (label k = i + 1; k < phases.size(); ++ k) + { + KdByAs[j][k] -= KdByAs[j][i]*KdByAs[i][k]; + phiKds[j][k] -= phiKds[j][i]*phiKds[i][k]; + } + } + } + { + volScalarField detKdByAs(KdByAs[0][0]); + surfaceScalarField detPhiKdfs(phiKds[0][0]); + for (label i = 1; i < phases.size(); ++ i) + { + detKdByAs *= KdByAs[i][i]; + detPhiKdfs *= phiKds[i][i]; + } + Info<< "Min cell/face det = " << gMin(detKdByAs.primitiveField()) + << "/" << gMin(detPhiKdfs.primitiveField()) << endl; + } + + // Solve for the velocities and fluxes + for (label i = 1; i < phases.size(); ++ i) + { + if (!phases[i].stationary()) + { + for (label j = 0; j < i; j ++) + { + phases[i].URef() -= KdByAs[i][j]*phases[j].U(); + phases[i].phiRef() -= phiKds[i][j]*phases[j].phi(); + } + } + } + for (label i = phases.size() - 1; i >= 0; i --) + { + if (!phases[i].stationary()) + { + for (label j = phases.size() - 1; j > i; j --) + { + phases[i].URef() -= KdByAs[i][j]*phases[j].U(); + phases[i].phiRef() -= phiKds[i][j]*phases[j].phi(); + } + phases[i].URef() /= KdByAs[i][i]; + phases[i].phiRef() /= phiKds[i][i]; + } + } +} + + +template<class BasePhaseSystem> +void Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::partialEliminationf +( + const PtrList<surfaceScalarField>& rAUfs +) +{ + Info<< "Inverting drag system: "; + + phaseSystem::phaseModelList& phases = this->phaseModels_; + + // Create drag coefficient matrix + PtrList<PtrList<surfaceScalarField>> phiKdfs(phases.size()); + + forAll(phases, phasei) + { + phiKdfs.set + ( + phasei, + new PtrList<surfaceScalarField>(phases.size()) + ); + } + + forAllConstIter(KdfTable, Kdfs_, KdfIter) + { + const surfaceScalarField& K(*KdfIter()); + const phasePair& pair(this->phasePairs_[KdfIter.key()]); + + const label phase1i = pair.phase1().index(); + const label phase2i = pair.phase2().index(); + + this->addField + ( + pair.phase2(), + "phiKdf", + - rAUfs[phase1i]*K, + phiKdfs[phase1i] + ); + this->addField + ( + pair.phase1(), + "phiKdf", + - rAUfs[phase2i]*K, + phiKdfs[phase2i] + ); + } + + forAll(phases, phasei) + { + this->fillFields("phiKdf", dimless, phiKdfs[phasei]); + + phiKdfs[phasei][phasei] = 1; + } + + // Decompose + for (label i = 0; i < phases.size(); ++ i) + { + for (label j = i + 1; j < phases.size(); ++ j) + { + phiKdfs[i][j] /= phiKdfs[i][i]; + for (label k = i + 1; k < phases.size(); ++ k) + { + phiKdfs[j][k] -= phiKdfs[j][i]*phiKdfs[i][k]; + } + } + } + { + surfaceScalarField detPhiKdfs(phiKdfs[0][0]); + for (label i = 1; i < phases.size(); ++ i) + { + detPhiKdfs *= phiKdfs[i][i]; + } + Info<< "Min face det = " << gMin(detPhiKdfs.primitiveField()) << endl; + } + + // Solve for the fluxes + for (label i = 1; i < phases.size(); ++ i) + { + if (!phases[i].stationary()) + { + for (label j = 0; j < i; j ++) + { + phases[i].phiRef() -= phiKdfs[i][j]*phases[j].phi(); + } + } + } + for (label i = phases.size() - 1; i >= 0; i --) + { + if (!phases[i].stationary()) + { + for (label j = phases.size() - 1; j > i; j --) + { + phases[i].phiRef() -= phiKdfs[i][j]*phases[j].phi(); + } + phases[i].phiRef() /= phiKdfs[i][i]; + } + } +} + + +template<class BasePhaseSystem> +const Foam::HashPtrTable<Foam::surfaceScalarField>& +Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::DByAfs() const +{ + return DByAfs_; +} + + +template<class BasePhaseSystem> +bool Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Read models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H similarity index 53% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H index f4f0f96e7d4fca061fe4e7351cdb4bfad281c077..902a86601c5c12e5111a9aa24563dda2094e8a9b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,6 +72,34 @@ protected: // Protected typedefs + typedef HashPtrTable + < + volScalarField, + phasePairKey, + phasePairKey::hash + > KdTable; + + typedef HashPtrTable + < + surfaceScalarField, + phasePairKey, + phasePairKey::hash + > KdfTable; + + typedef HashPtrTable + < + volScalarField, + phasePairKey, + phasePairKey::hash + > VmTable; + + typedef HashPtrTable + < + surfaceScalarField, + phasePairKey, + phasePairKey::hash + > VmfTable; + typedef HashTable < autoPtr<BlendedInterfacialModel<dragModel>>, @@ -113,10 +141,19 @@ private: // Private data //- Drag coefficients - phaseSystem::KdTable Kds_; + KdTable Kds_; + + //- Face drag coefficients + KdfTable Kdfs_; //- Virtual mass coefficients - phaseSystem::VmTable Vms_; + VmTable Vms_; + + //- Face virtual mass coefficients + VmfTable Vmfs_; + + //- The phase diffusivities divided by the momentum coefficients + HashPtrTable<surfaceScalarField> DByAfs_; // Sub Models @@ -135,20 +172,23 @@ private: //- Turbulent dispersion models turbulentDispersionModelTable turbulentDispersionModels_; - //- Construct element phasei of Fs if not set and return - // Used by Fs() - volVectorField& setF - ( - PtrList<volVectorField>& Fs, const label phasei - ) const; - //- Construct element phasei of phiDs if not set and return - // Used by phiDs() - surfaceScalarField& setPhiD - ( - PtrList<surfaceScalarField>& phiDs, const label phasei - ) const; + // Private member functions + //- Return the drag coefficient for the phase pair + virtual tmp<volScalarField> Kd(const phasePairKey& key) const; + + //- Return the face drag coefficient for the phase pair + virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const; + + //- Return the virtual mass coefficient for the phase pair + virtual tmp<volScalarField> Vm(const phasePairKey& key) const; + + //- Add the mass-transfer-based momentum transfer to the equations + void addMassTransferMomentumTransfer + ( + phaseSystem::momentumTransferTable& eqns + ) const; public: @@ -164,49 +204,80 @@ public: // Member Functions - //- Constant access to drag coefficients - virtual const phaseSystem::KdTable& Kds() const - { - return Kds_; - } + //- Return the momentum transfer matrices for the cell-based algorithm. + // This includes implicit and explicit forces that add into the cell + // UEqn in the normal way. + virtual autoPtr<phaseSystem::momentumTransferTable> momentumTransfer(); - //- Return the drag coefficient - virtual tmp<volScalarField> Kd(const phasePairKey& key) const; + //- As momentumTransfer, but for the face-based algorithm + virtual autoPtr<phaseSystem::momentumTransferTable> momentumTransferf(); - //- Return the face drag coefficient - virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const; + //- Return implicit force coefficients on the faces, for the face-based + // algorithm. + virtual PtrList<surfaceScalarField> AFfs() const; - //- Return the drag coefficient for phase - virtual tmp<volScalarField> Kd(const phaseModel& phase) const; - - //- Return the virtual mass coefficient - virtual tmp<volScalarField> Vm(const phasePairKey& key) const; + //- Return the explicit force fluxes for the cell-based algorithm, that + // do not depend on phase mass/volume fluxes, and can therefore be + // evaluated outside the corrector loop. This includes things like + // lift, turbulent dispersion, and wall lubrication. + virtual PtrList<surfaceScalarField> phiFs + ( + const PtrList<volScalarField>& rAUs + ); - //- Return the face virtual mass coefficient - virtual tmp<surfaceScalarField> Vmf(const phasePairKey& key) const; + //- As phiFs, but for the face-based algorithm + virtual PtrList<surfaceScalarField> phiFfs + ( + const PtrList<surfaceScalarField>& rAUfs + ); - //- Return the combined force (lift + wall-lubrication) - virtual tmp<volVectorField> F(const phasePairKey& key) const; + //- Return the explicit drag force fluxes for the cell-based algorithm. + // These depend on phase mass/volume fluxes, and must therefore be + // evaluated inside the corrector loop. + virtual PtrList<surfaceScalarField> phiKdPhis + ( + const PtrList<volScalarField>& rAUs + ) const; - //- Return the combined force (lift + wall-lubrication) - virtual autoPtr<PtrList<volVectorField>> Fs() const; + //- As phiKdPhis, but for the face-based algorithm + virtual PtrList<surfaceScalarField> phiKdPhifs + ( + const PtrList<surfaceScalarField>& rAUfs + ) const; - //- Return the turbulent dispersion force on faces for phase pair - virtual autoPtr<PtrList<surfaceScalarField>> phiDs + //- Return the explicit part of the drag force for the cell-based + // algorithm. This is the cell-equivalent of phiKdPhis. These depend on + // phase velocities, and must therefore be evaluated inside the + // corrector loop. + virtual PtrList<volVectorField> KdUByAs ( const PtrList<volScalarField>& rAUs ) const; - //- Return the combined face-force (lift + wall-lubrication) - virtual tmp<surfaceScalarField> Ff(const phasePairKey& key) const; + //- Solve the drag system for the velocities and fluxes + virtual void partialElimination + ( + const PtrList<volScalarField>& rAUs + ); + + //- As partialElimination, but for the face-based algorithm. Only solves + // for the fluxes. + virtual void partialEliminationf + ( + const PtrList<surfaceScalarField>& rAUfs + ); - //- Return the turbulent diffusivity - // Multiplies the phase-fraction gradient - virtual tmp<volScalarField> D(const phasePairKey& key) const; + //- Return the flux corrections for the cell-based algorithm. These + // depend on phase mass/volume fluxes, and must therefore be evaluated + // inside the corrector loop. + virtual PtrList<surfaceScalarField> ddtCorrByAs + ( + const PtrList<volScalarField>& rAUs, + const bool includeVirtualMass = false + ) const; - //- Return the momentum transfer matrices - virtual autoPtr<phaseSystem::momentumTransferTable> - momentumTransfer() const; + //- Return the phase diffusivities divided by the momentum coefficients + virtual const HashPtrTable<surfaceScalarField>& DByAfs() const; //- Read base phaseProperties dictionary virtual bool read(); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..25d087d4f00ee3700f9a9218422c66c3012b7f58 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.C @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "OneResistanceHeatTransferPhaseSystem.H" +#include "fvmSup.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +OneResistanceHeatTransferPhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh) +{ + this->generatePairsAndSubModels + ( + "heatTransfer", + heatTransferModels_, + false + ); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +~OneResistanceHeatTransferPhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::heatTransferTable> +Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +heatTransfer() const +{ + autoPtr<phaseSystem::heatTransferTable> eqnsPtr + ( + new phaseSystem::heatTransferTable() + ); + + phaseSystem::heatTransferTable& eqns = eqnsPtr(); + + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + eqns.set + ( + phase.name(), + new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime) + ); + } + + // Heat transfer across the interface + forAllConstIter + ( + heatTransferModelTable, + heatTransferModels_, + heatTransferModelIter + ) + { + const volScalarField K(heatTransferModelIter()->K()); + + const phasePair& pair(this->phasePairs_[heatTransferModelIter.key()]); + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + + const volScalarField& he(phase.thermo().he()); + volScalarField Cpv(phase.thermo().Cpv()); + + *eqns[phase.name()] += + K*(otherPhase.thermo().T() - phase.thermo().T() + he/Cpv) + - fvm::Sp(K/Cpv, he); + } + } + + // Source term due to mass transfer + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + const volScalarField& he1(phase1.thermo().he()); + const volScalarField& he2(phase2.thermo().he()); + + const volScalarField K1(phase1.K()); + const volScalarField K2(phase2.K()); + + // Note that the phase heEqn contains a continuity error term, which + // implicitly adds a mass transfer term of fvm::Sp(dmdt, he). These + // additions do not include this term. + + const volScalarField dmdt(this->dmdt(pair)); + const volScalarField dmdt21(posPart(dmdt)); + const volScalarField dmdt12(negPart(dmdt)); + + *eqns[phase1.name()] += + dmdt21*he2 - fvm::Sp(dmdt21, he1) + dmdt21*(K2 - K1); + + *eqns[phase2.name()] -= + dmdt12*he1 - fvm::Sp(dmdt12, he2) + dmdt12*(K1 - K2); + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +bool Foam::OneResistanceHeatTransferPhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H similarity index 71% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H index d59160a0bf1e766b6c63de95a335c9f8f0e700a7..3b1812f50ef7ccea10ea4d490819badeda50f65a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/OneResistanceHeatTransferPhaseSystem/OneResistanceHeatTransferPhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,18 +24,22 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::HeatTransferPhaseSystem + Foam::OneResistanceHeatTransferPhaseSystem Description - Class which models interfacial heat transfer between a number of phases. + Class which models interfacial heat transfer between a number of phases. A + single heat transfer model is used for each interface. + +See also + TwoResistanceHeatTransferPhaseSystem SourceFiles - HeatTransferPhaseSystem.C + OneResistanceHeatTransferPhaseSystem.C \*---------------------------------------------------------------------------*/ -#ifndef HeatTransferPhaseSystem_H -#define HeatTransferPhaseSystem_H +#ifndef OneResistanceHeatTransferPhaseSystem_H +#define OneResistanceHeatTransferPhaseSystem_H #include "phaseSystem.H" @@ -49,11 +53,11 @@ template<class modelType> class BlendedInterfacialModel; class heatTransferModel; /*---------------------------------------------------------------------------*\ - Class HeatTransferPhaseSystem Declaration + Class OneResistanceHeatTransferPhaseSystem Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseSystem> -class HeatTransferPhaseSystem +class OneResistanceHeatTransferPhaseSystem : public BasePhaseSystem { @@ -82,34 +86,17 @@ public: // Constructors //- Construct from fvMesh - HeatTransferPhaseSystem(const fvMesh&); + OneResistanceHeatTransferPhaseSystem(const fvMesh&); //- Destructor - virtual ~HeatTransferPhaseSystem(); + virtual ~OneResistanceHeatTransferPhaseSystem(); // Member Functions - //- Return true if there is mass transfer for phase - virtual bool transfersMass(const phaseModel& phase) const; - - //- Return the interfacial mass flow rate - virtual tmp<volScalarField> dmdt - ( - const phasePairKey& key - ) const; - - //- Return the total interfacial mass transfer rate for phase - virtual tmp<volScalarField> dmdt(const phaseModel& phase) const; - //- Return the heat transfer matrices - virtual autoPtr<phaseSystem::heatTransferTable> - heatTransfer() const; - - //- Return the mass transfer matrices - virtual autoPtr<phaseSystem::massTransferTable> - massTransfer() const; + virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const; //- Read base phaseProperties dictionary virtual bool read(); @@ -123,7 +110,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository - #include "HeatTransferPhaseSystem.C" + #include "OneResistanceHeatTransferPhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..e6afd7ce645c011081a2c7d0b0b8248c68535ff3 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.C @@ -0,0 +1,247 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "PhaseTransferPhaseSystem.H" +#include "phaseTransferModel.H" +#include "fvmSup.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::rDmdt +( + const phasePairKey& key +) const +{ + if (!rDmdt_.found(key)) + { + return phaseSystem::dmdt(key); + } + + const scalar rDmdtSign(Pair<word>::compare(rDmdt_.find(key).key(), key)); + + return rDmdtSign**rDmdt_[key]; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::PhaseTransferPhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh) +{ + this->generatePairsAndSubModels + ( + "phaseTransfer", + phaseTransferModels_, + false + ); + + forAllConstIter + ( + phaseTransferModelTable, + phaseTransferModels_, + phaseTransferModelIter + ) + { + this->rDmdt_.set + ( + phaseTransferModelIter.key(), + phaseSystem::dmdt(phaseTransferModelIter.key()).ptr() + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>:: +~PhaseTransferPhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::dmdt +( + const phasePairKey& key +) const +{ + return BasePhaseSystem::dmdt(key) + this->rDmdt(key); +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::volScalarField> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::dmdts() const +{ + PtrList<volScalarField> dmdts(BasePhaseSystem::dmdts()); + + forAllConstIter(rDmdtTable, rDmdt_, rDmdtIter) + { + const phasePair& pair = this->phasePairs_[rDmdtIter.key()]; + const volScalarField& rDmdt = *rDmdtIter(); + + this->addField(pair.phase1(), "dmdt", rDmdt, dmdts); + this->addField(pair.phase2(), "dmdt", - rDmdt, dmdts); + } + + return dmdts; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::massTransferTable> +Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::massTransfer() const +{ + // Create a mass transfer matrix for each species of each phase + autoPtr<phaseSystem::massTransferTable> eqnsPtr + ( + new phaseSystem::massTransferTable() + ); + + phaseSystem::massTransferTable& eqns = eqnsPtr(); + + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + const PtrList<volScalarField>& Yi = phase.Y(); + + forAll(Yi, i) + { + eqns.set + ( + Yi[i].name(), + new fvScalarMatrix(Yi[i], dimMass/dimTime) + ); + } + } + + // Mass transfer across the interface + forAllConstIter + ( + phaseTransferModelTable, + phaseTransferModels_, + phaseTransferModelIter + ) + { + const phasePair& pair(this->phasePairs_[phaseTransferModelIter.key()]); + + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + + // Note that the phase YiEqn does not contain a continuity error term, + // so these additions represent the entire mass transfer + + const volScalarField dmdt(this->rDmdt(pair)); + const volScalarField dmdt12(negPart(dmdt)); + const volScalarField dmdt21(posPart(dmdt)); + + const PtrList<volScalarField>& Yi = phase.Y(); + + forAll(Yi, i) + { + const word name + ( + IOobject::groupName(Yi[i].member(), phase.name()) + ); + + const word otherName + ( + IOobject::groupName(Yi[i].member(), otherPhase.name()) + ); + + *eqns[name] += + dmdt21*eqns[otherName]->psi() + + fvm::Sp(dmdt12, eqns[name]->psi()); + + *eqns[otherName] -= + dmdt12*eqns[name]->psi() + + fvm::Sp(dmdt21, eqns[otherName]->psi()); + } + + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +void Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::correct() +{ + BasePhaseSystem::correct(); + + forAllConstIter + ( + phaseTransferModelTable, + phaseTransferModels_, + phaseTransferModelIter + ) + { + *rDmdt_[phaseTransferModelIter.key()] = + dimensionedScalar(dimDensity/dimTime); + } + + forAllConstIter + ( + phaseTransferModelTable, + phaseTransferModels_, + phaseTransferModelIter + ) + { + *rDmdt_[phaseTransferModelIter.key()] += + phaseTransferModelIter()->dmdt(); + } +} + + +template<class BasePhaseSystem> +bool Foam::PhaseTransferPhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.H new file mode 100644 index 0000000000000000000000000000000000000000..2e417e9d6db3775b631c0e8512e748b8d5e52c68 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PhaseTransferPhaseSystem/PhaseTransferPhaseSystem.H @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::PhaseTransferPhaseSystem + +Description + Class which models non-thermally-coupled mass transfers; i.e., + representation changes, rather than phase changes. + +SourceFiles + PhaseTransferPhaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PhaseTransferPhaseSystem_H +#define PhaseTransferPhaseSystem_H + +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class blendingMethod; +template<class modelType> class BlendedInterfacialModel; +class phaseTransferModel; + +/*---------------------------------------------------------------------------*\ + Class PhaseTransferPhaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasePhaseSystem> +class PhaseTransferPhaseSystem +: + public BasePhaseSystem +{ +protected: + + // Protected typedefs + + typedef HashTable + < + autoPtr<BlendedInterfacialModel<phaseTransferModel>>, + phasePairKey, + phasePairKey::hash + > phaseTransferModelTable; + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + rDmdtTable; + + + // Protected data + + // Sub Models + + //- Mass transfer models + phaseTransferModelTable phaseTransferModels_; + + //- Mass transfer rates + rDmdtTable rDmdt_; + + // Protected member functions + + //- Return the representation mass transfer rate + virtual tmp<volScalarField> rDmdt(const phasePairKey& key) const; + + +public: + + // Constructors + + //- Construct from fvMesh + PhaseTransferPhaseSystem(const fvMesh&); + + + //- Destructor + virtual ~PhaseTransferPhaseSystem(); + + + // Member Functions + + //- Return the mass transfer rate for a pair + virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; + + //- Return the mass transfer rates for each phase + virtual PtrList<volScalarField> dmdts() const; + + //- Return the mass transfer matrices + virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; + + //- Correct the mass transfer rates + virtual void correct(); + + //- Read base phaseProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "PhaseTransferPhaseSystem.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..351e8d357aefe3a35ef5592f0360427e7ce10b14 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.C @@ -0,0 +1,260 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "PopulationBalancePhaseSystem.H" + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::pDmdt +( + const phasePairKey& key +) const +{ + if (!pDmdt_.found(key)) + { + return phaseSystem::dmdt(key); + } + + const scalar pDmdtSign(Pair<word>::compare(pDmdt_.find(key).key(), key)); + + return pDmdtSign**pDmdt_[key]; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>:: +PopulationBalancePhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh), + + populationBalances_ + ( + this->lookup("populationBalances"), + diameterModels::populationBalanceModel::iNew(*this, pDmdt_) + ) +{ + forAll(populationBalances_, i) + { + const Foam::diameterModels::populationBalanceModel& popBal = + populationBalances_[i]; + + forAllConstIter(phaseSystem::phasePairTable, popBal.phasePairs(), iter) + { + const phasePairKey& key = iter.key(); + + if (!this->phasePairs_.found(key)) + { + this->phasePairs_.insert + ( + key, + autoPtr<phasePair> + ( + new phasePair + ( + this->phaseModels_[key.first()], + this->phaseModels_[key.second()] + ) + ) + ); + } + } + } + + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + // Initially assume no mass transfer + pDmdt_.set + ( + pair, + new volScalarField + ( + IOobject + ( + IOobject::groupName("pDmdt", pair.name()), + this->mesh().time().timeName(), + this->mesh(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimDensity/dimTime) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>:: +~PopulationBalancePhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::dmdt +( + const phasePairKey& key +) const +{ + return BasePhaseSystem::dmdt(key) + this->pDmdt(key); +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::volScalarField> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::dmdts() const +{ + PtrList<volScalarField> dmdts(BasePhaseSystem::dmdts()); + + forAllConstIter(pDmdtTable, pDmdt_, pDmdtIter) + { + const phasePair& pair = this->phasePairs_[pDmdtIter.key()]; + const volScalarField& pDmdt = *pDmdtIter(); + + this->addField(pair.phase1(), "dmdt", pDmdt, dmdts); + this->addField(pair.phase2(), "dmdt", - pDmdt, dmdts); + } + + return dmdts; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::massTransferTable> +Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::massTransfer() const +{ + autoPtr<phaseSystem::massTransferTable> eqnsPtr = + BasePhaseSystem::massTransfer(); + + phaseSystem::massTransferTable& eqns = eqnsPtr(); + + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + + // Note that the phase YiEqn does not contain a continuity error term, + // so these additions represent the entire mass transfer + + const volScalarField dmdt(this->pDmdt(pair)); + const volScalarField dmdt12(negPart(dmdt)); + const volScalarField dmdt21(posPart(dmdt)); + + const PtrList<volScalarField>& Yi = phase.Y(); + + forAll(Yi, i) + { + const word name + ( + IOobject::groupName(Yi[i].member(), phase.name()) + ); + + const word otherName + ( + IOobject::groupName(Yi[i].member(), otherPhase.name()) + ); + + *eqns[name] += + dmdt21*eqns[otherName]->psi() + + fvm::Sp(dmdt12, eqns[name]->psi()); + + *eqns[otherName] -= + dmdt12*eqns[name]->psi() + + fvm::Sp(dmdt21, eqns[otherName]->psi()); + } + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +bool Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +template<class BasePhaseSystem> +void Foam::PopulationBalancePhaseSystem<BasePhaseSystem>::solve() +{ + BasePhaseSystem::solve(); + + forAll(populationBalances_, i) + { + populationBalances_[i].solve(); + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.H new file mode 100644 index 0000000000000000000000000000000000000000..fdf6e7675752342ecc36f73920cb50121a807a2e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/PopulationBalancePhaseSystem/PopulationBalancePhaseSystem.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::PopulationBalancePhaseSystem + +Description + Class which provides population balance functionality. + +See also + Foam::diameterModels::populationBalanceModel + +SourceFiles + PopulationBalancePhaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PopulationBalancePhaseSystem_H +#define PopulationBalancePhaseSystem_H + +#include "phaseSystem.H" +#include "populationBalanceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PopulationBalancePhaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasePhaseSystem> +class PopulationBalancePhaseSystem +: + public BasePhaseSystem +{ +protected: + + // Protected typedefs + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + pDmdtTable; + + + // Protected data + + //- populationBalanceModels + PtrList<diameterModels::populationBalanceModel> populationBalances_; + + //- Interfacial Mass transfer rate + pDmdtTable pDmdt_; + + + // Protected member functions + + //- Return the population balance mass transfer rate + virtual tmp<volScalarField> pDmdt(const phasePairKey& key) const; + + +public: + + // Constructors + + //- Construct from fvMesh + PopulationBalancePhaseSystem(const fvMesh&); + + + //- Destructor + virtual ~PopulationBalancePhaseSystem(); + + + // Member Functions + + //- Return the mass transfer rate for a pair + virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; + + //- Return the mass transfer rates for each phase + virtual PtrList<volScalarField> dmdts() const; + + //- Return the mass transfer matrices + virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; + + //- Read base phaseProperties dictionary + virtual bool read(); + + //- Solve all population balance equations + virtual void solve(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "PopulationBalancePhaseSystem.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..3fd8764a350d9ac58a13620e6fac4c9d033327ba --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C @@ -0,0 +1,554 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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 "ThermalPhaseChangePhaseSystem.H" +#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" +#include "fvcVolumeIntegrate.H" +#include "fvmSup.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::iDmdt +( + const phasePairKey& key +) const +{ + if (!iDmdt_.found(key)) + { + return phaseSystem::dmdt(key); + } + + const scalar dmdtSign(Pair<word>::compare(iDmdt_.find(key).key(), key)); + + return dmdtSign**iDmdt_[key]; +} + + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::wDmdt +( + const phasePairKey& key +) const +{ + if (!wDmdt_.found(key)) + { + return phaseSystem::dmdt(key); + } + + const scalar dmdtSign(Pair<word>::compare(wDmdt_.find(key).key(), key)); + + return dmdtSign**wDmdt_[key]; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>:: +ThermalPhaseChangePhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh), + volatile_(this->template lookupOrDefault<word>("volatile", "none")), + saturationModel_ + ( + saturationModel::New(this->subDict("saturationModel"), mesh) + ), + phaseChange_(this->lookup("phaseChange")) +{ + + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + // Initially assume no mass transfer + iDmdt_.set + ( + pair, + new volScalarField + ( + IOobject + ( + IOobject::groupName("iDmdt", pair.name()), + this->mesh().time().timeName(), + this->mesh(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimDensity/dimTime) + ) + ); + + // Initially assume no mass transfer + wDmdt_.set + ( + pair, + new volScalarField + ( + IOobject + ( + IOobject::groupName("wDmdt", pair.name()), + this->mesh().time().timeName(), + this->mesh(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimDensity/dimTime) + ) + ); + + // Initially assume no mass transfer + wMDotL_.set + ( + pair, + new volScalarField + ( + IOobject + ( + IOobject::groupName("wMDotL", pair.name()), + this->mesh().time().timeName(), + this->mesh(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimEnergy/dimTime/dimVolume) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>:: +~ThermalPhaseChangePhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +const Foam::saturationModel& +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::saturation() const +{ + return saturationModel_(); +} + + +template<class BasePhaseSystem> +Foam::tmp<Foam::volScalarField> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::dmdt +( + const phasePairKey& key +) const +{ + return BasePhaseSystem::dmdt(key) + this->iDmdt(key) + this->wDmdt(key); +} + + +template<class BasePhaseSystem> +Foam::PtrList<Foam::volScalarField> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::dmdts() const +{ + PtrList<volScalarField> dmdts(BasePhaseSystem::dmdts()); + + forAllConstIter(iDmdtTable, iDmdt_, iDmdtIter) + { + const phasePair& pair = this->phasePairs_[iDmdtIter.key()]; + const volScalarField& iDmdt = *iDmdtIter(); + + this->addField(pair.phase1(), "dmdt", iDmdt, dmdts); + this->addField(pair.phase2(), "dmdt", - iDmdt, dmdts); + } + + forAllConstIter(wDmdtTable, wDmdt_, wDmdtIter) + { + const phasePair& pair = this->phasePairs_[wDmdtIter.key()]; + const volScalarField& wDmdt = *wDmdtIter(); + + this->addField(pair.phase1(), "dmdt", wDmdt, dmdts); + this->addField(pair.phase2(), "dmdt", - wDmdt, dmdts); + } + + return dmdts; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::heatTransferTable> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const +{ + autoPtr<phaseSystem::heatTransferTable> eqnsPtr = + BasePhaseSystem::heatTransfer(); + + phaseSystem::heatTransferTable& eqns = eqnsPtr(); + + // Add boundary term + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + if (this->wMDotL_.found(phasePairIter.key())) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + *eqns[phase1.name()] += negPart(*this->wMDotL_[pair]); + *eqns[phase2.name()] -= posPart(*this->wMDotL_[pair]); + + if + ( + phase1.thermo().he().member() == "e" + || phase2.thermo().he().member() == "e" + ) + { + const volScalarField dmdt + ( + this->iDmdt(pair) + this->wDmdt(pair) + ); + + if (phase1.thermo().he().member() == "e") + { + *eqns[phase1.name()] += + phase1.thermo().p()*dmdt/phase1.thermo().rho(); + } + + if (phase2.thermo().he().member() == "e") + { + *eqns[phase2.name()] -= + phase2.thermo().p()*dmdt/phase2.thermo().rho(); + } + } + } + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::massTransferTable> +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::massTransfer() const +{ + autoPtr<phaseSystem::massTransferTable> eqnsPtr = + BasePhaseSystem::massTransfer(); + + phaseSystem::massTransferTable& eqns = eqnsPtr(); + + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + const phaseModel& phase = pair.phase1(); + const phaseModel& otherPhase = pair.phase2(); + + const PtrList<volScalarField>& Yi = phase.Y(); + + forAll(Yi, i) + { + if (Yi[i].member() != volatile_) + { + continue; + } + + const word name + ( + IOobject::groupName(volatile_, phase.name()) + ); + + const word otherName + ( + IOobject::groupName(volatile_, otherPhase.name()) + ); + + // Note that the phase YiEqn does not contain a continuity error + // term, so these additions represent the entire mass transfer + + const volScalarField dmdt(this->iDmdt(pair) + this->wDmdt(pair)); + + *eqns[name] += dmdt; + *eqns[otherName] -= dmdt; + } + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +void +Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo() +{ + typedef compressible::alphatPhaseChangeWallFunctionFvPatchScalarField + alphatPhaseChangeWallFunction; + + forAllConstIter + ( + typename BasePhaseSystem::heatTransferModelTable, + this->heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair + ( + this->phasePairs_[heatTransferModelIter.key()] + ); + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + const volScalarField& T1(phase1.thermo().T()); + const volScalarField& T2(phase2.thermo().T()); + + const volScalarField& he1(phase1.thermo().he()); + const volScalarField& he2(phase2.thermo().he()); + + const volScalarField& p(phase1.thermo().p()); + + volScalarField& iDmdt(*this->iDmdt_[pair]); + volScalarField& Tf(*this->Tf_[pair]); + + const volScalarField Tsat(saturationModel_->Tsat(phase1.thermo().p())); + + volScalarField hf1 + ( + he1.member() == "e" + ? phase1.thermo().he(p, Tsat) + p/phase1.rho() + : phase1.thermo().he(p, Tsat) + ); + volScalarField hf2 + ( + he2.member() == "e" + ? phase2.thermo().he(p, Tsat) + p/phase2.rho() + : phase2.thermo().he(p, Tsat) + ); + + volScalarField h1 + ( + he1.member() == "e" + ? he1 + p/phase1.rho() + : tmp<volScalarField>(he1) + ); + + volScalarField h2 + ( + he2.member() == "e" + ? he2 + p/phase2.rho() + : tmp<volScalarField>(he2) + ); + + volScalarField L + ( + (neg0(iDmdt)*hf2 + pos(iDmdt)*h2) + - (pos0(iDmdt)*hf1 + neg(iDmdt)*h1) + ); + + volScalarField iDmdtNew(iDmdt); + + if (phaseChange_) + { + volScalarField H1(heatTransferModelIter().first()->K(0)); + volScalarField H2(heatTransferModelIter().second()->K(0)); + + iDmdtNew = (H1*(Tsat - T1) + H2*(Tsat - T2))/L; + } + else + { + iDmdtNew == dimensionedScalar(iDmdt.dimensions()); + } + + volScalarField H1(heatTransferModelIter().first()->K()); + volScalarField H2(heatTransferModelIter().second()->K()); + + // Limit the H[12] to avoid /0 + H1.max(SMALL); + H2.max(SMALL); + + Tf = (H1*T1 + H2*T2 + iDmdtNew*L)/(H1 + H2); + + Info<< "Tf." << pair.name() + << ": min = " << min(Tf.primitiveField()) + << ", mean = " << average(Tf.primitiveField()) + << ", max = " << max(Tf.primitiveField()) + << endl; + + scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt")); + iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew; + + if (phaseChange_) + { + Info<< "iDmdt." << pair.name() + << ": min = " << min(iDmdt.primitiveField()) + << ", mean = " << average(iDmdt.primitiveField()) + << ", max = " << max(iDmdt.primitiveField()) + << ", integral = " << fvc::domainIntegrate(iDmdt).value() + << endl; + } + + volScalarField& wDmdt(*this->wDmdt_[pair]); + volScalarField& wMDotL(*this->wMDotL_[pair]); + wDmdt *= 0.0; + wMDotL *= 0.0; + + bool wallBoilingActive = false; + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + const phaseModel& otherPhase = iter.otherPhase(); + + if + ( + phase.mesh().foundObject<volScalarField> + ( + "alphat." + phase.name() + ) + ) + { + const volScalarField& alphat = + phase.mesh().lookupObject<volScalarField> + ( + "alphat." + phase.name() + ); + + const fvPatchList& patches = this->mesh().boundary(); + forAll(patches, patchi) + { + const fvPatch& currPatch = patches[patchi]; + + if + ( + isA<alphatPhaseChangeWallFunction> + ( + alphat.boundaryField()[patchi] + ) + ) + { + const alphatPhaseChangeWallFunction& PCpatch = + refCast<const alphatPhaseChangeWallFunction> + ( + alphat.boundaryField()[patchi] + ); + + phasePairKey key(phase.name(), otherPhase.name()); + + if (PCpatch.activePhasePair(key)) + { + wallBoilingActive = true; + + const scalarField& patchDmdt = + PCpatch.dmdt(key); + const scalarField& patchMDotL = + PCpatch.mDotL(key); + + const scalar sign + ( + Pair<word>::compare(pair, key) + ); + + forAll(patchDmdt, facei) + { + const label faceCelli = + currPatch.faceCells()[facei]; + wDmdt[faceCelli] -= sign*patchDmdt[facei]; + wMDotL[faceCelli] -= sign*patchMDotL[facei]; + } + } + } + } + } + } + + if (wallBoilingActive) + { + Info<< "wDmdt." << pair.name() + << ": min = " << min(wDmdt.primitiveField()) + << ", mean = " << average(wDmdt.primitiveField()) + << ", max = " << max(wDmdt.primitiveField()) + << ", integral = " << fvc::domainIntegrate(wDmdt).value() + << endl; + } + } +} + + +template<class BasePhaseSystem> +bool Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H similarity index 71% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H index 6a35b7a851858f694845c6053eb995db4aa2fac2..76d07cc9aa5ff19f05723139fa89ab7412173ef1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,10 +31,6 @@ Description phases according the interfacial temperature approximated by the saturation temperature. - Currently only a single specified specie is considered volatile and changes - phase, all other species are considered nonvolatile and do not - affect the mass-transfer. - SourceFiles ThermalPhaseChangePhaseSystem.C @@ -43,8 +39,9 @@ SourceFiles #ifndef ThermalPhaseChangePhaseSystem_H #define ThermalPhaseChangePhaseSystem_H -#include "HeatAndMassTransferPhaseSystem.H" +#include "phaseSystem.H" #include "saturationModel.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,11 +55,23 @@ namespace Foam template<class BasePhaseSystem> class ThermalPhaseChangePhaseSystem : - public HeatAndMassTransferPhaseSystem<BasePhaseSystem> + public BasePhaseSystem { protected: + // Protected typedefs + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + iDmdtTable; + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + wDmdtTable; + + typedef HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> + wMDotLTable; + + // Protected data //- Name of the volatile specie @@ -71,12 +80,26 @@ protected: //- The saturation model used to evaluate Tsat = Tf autoPtr<saturationModel> saturationModel_; - // Mass transfer enabled - bool massTransfer_; + // Phase change enabled + Switch phaseChange_; //- Interfacial Mass transfer rate - HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> - iDmdt_; + iDmdtTable iDmdt_; + + //- Boundary Mass transfer rate + wDmdtTable wDmdt_; + + //- Boundary thermal energy transfer rate + wMDotLTable wMDotL_; + + + // Protected member functions + + //- Return the interfacial mass transfer rate for a pair + tmp<volScalarField> iDmdt(const phasePairKey& key) const; + + //- Return the boundary mass transfer rate for a pair + tmp<volScalarField> wDmdt(const phasePairKey& key) const; public: @@ -96,20 +119,20 @@ public: //- Return the saturationModel const saturationModel& saturation() const; + //- Return the mass transfer rate for a pair + virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; + + //- Return the mass transfer rates for each phase + virtual PtrList<volScalarField> dmdts() const; + //- Return the heat transfer matrices virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const; //- Return the mass transfer matrices virtual autoPtr<phaseSystem::massTransferTable> massTransfer() const; - //- Return the interfacial mass flow rate - virtual tmp<volScalarField> iDmdt(const phasePairKey& key) const; - - //- Return the total interfacial mass transfer rate for phase - virtual tmp<volScalarField> iDmdt(const phaseModel& phase) const; - - //- Correct the thermodynamics - virtual void correctThermo(); + //- Correct the interface thermodynamics + virtual void correctInterfaceThermo(); //- Read base phaseProperties dictionary virtual bool read(); diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..ba3aea0b989d70ab1a8e865a06cb64edda20461c --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C @@ -0,0 +1,330 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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 "TwoResistanceHeatTransferPhaseSystem.H" + +#include "BlendedInterfacialModel.H" +#include "heatTransferModel.H" + +#include "HashPtrTable.H" + +#include "fvcDiv.H" +#include "fvmSup.H" +#include "fvMatrix.H" +#include "zeroGradientFvPatchFields.H" + +// // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +TwoResistanceHeatTransferPhaseSystem +( + const fvMesh& mesh +) +: + BasePhaseSystem(mesh) +{ + this->generatePairsAndSubModels + ( + "heatTransfer", + heatTransferModels_, + false + ); + + // Check that models have been specified on both sides of the interfaces + forAllConstIter + ( + heatTransferModelTable, + heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()]; + + if (!heatTransferModels_[pair].first().valid()) + { + FatalErrorInFunction + << "A heat transfer model for the " << pair.phase1().name() + << " side of the " << pair << " pair is not specified" + << exit(FatalError); + } + if (!heatTransferModels_[pair].second().valid()) + { + FatalErrorInFunction + << "A heat transfer model for the " << pair.phase2().name() + << " side of the " << pair << " pair is not specified" + << exit(FatalError); + } + } + + // Calculate initial Tf-s as if there is no mass transfer + forAllConstIter + ( + heatTransferModelTable, + heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()]; + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + const volScalarField& T1(phase1.thermo().T()); + const volScalarField& T2(phase2.thermo().T()); + + volScalarField H1(heatTransferModels_[pair].first()->K()); + volScalarField H2(heatTransferModels_[pair].second()->K()); + dimensionedScalar HSmall("small", heatTransferModel::dimK, SMALL); + + Tf_.set + ( + pair, + new volScalarField + ( + IOobject + ( + IOobject::groupName("Tf", pair.name()), + this->mesh().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + (H1*T1 + H2*T2)/max(H1 + H2, HSmall) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +~TwoResistanceHeatTransferPhaseSystem() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class BasePhaseSystem> +Foam::autoPtr<Foam::phaseSystem::heatTransferTable> +Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +heatTransfer() const +{ + autoPtr<phaseSystem::heatTransferTable> eqnsPtr + ( + new phaseSystem::heatTransferTable() + ); + + phaseSystem::heatTransferTable& eqns = eqnsPtr(); + + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + eqns.set + ( + phase.name(), + new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime) + ); + } + + // Heat transfer with the interface + forAllConstIter + ( + heatTransferModelTable, + heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair + ( + this->phasePairs_[heatTransferModelIter.key()] + ); + + const volScalarField& Tf(*Tf_[pair]); + + const Pair<tmp<volScalarField>> Ks + ( + heatTransferModelIter().first()->K(), + heatTransferModelIter().second()->K() + ); + + forAllConstIter(phasePair, pair, iter) + { + const phaseModel& phase = iter(); + + const volScalarField& he(phase.thermo().he()); + const volScalarField Cpv(phase.thermo().Cpv()); + const volScalarField& K(Ks[iter.index()]); + + *eqns[phase.name()] += + K*(Tf - phase.thermo().T()) + + K/Cpv*he - fvm::Sp(K/Cpv, he); + } + } + + // Source term due to mass transfer + forAllConstIter + ( + phaseSystem::phasePairTable, + this->phasePairs_, + phasePairIter + ) + { + const phasePair& pair(phasePairIter()); + + if (pair.ordered()) + { + continue; + } + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + const volScalarField& he1(phase1.thermo().he()); + const volScalarField& he2(phase2.thermo().he()); + + const volScalarField K1(phase1.K()); + const volScalarField K2(phase2.K()); + + const volScalarField dmdt(this->dmdt(pair)); + const volScalarField dmdt21(posPart(dmdt)); + const volScalarField dmdt12(negPart(dmdt)); + + *eqns[phase1.name()] += - fvm::Sp(dmdt21, he1) + dmdt21*(K2 - K1); + + *eqns[phase2.name()] -= - fvm::Sp(dmdt12, he2) + dmdt12*(K1 - K2); + + if (this->heatTransferModels_.found(phasePairIter.key())) + { + const volScalarField& Tf(*Tf_[pair]); + + *eqns[phase1.name()] += + dmdt21*phase1.thermo().he(phase1.thermo().p(), Tf); + + *eqns[phase2.name()] -= + dmdt12*phase2.thermo().he(phase2.thermo().p(), Tf); + } + else + { + *eqns[phase1.name()] += dmdt21*he2; + + *eqns[phase2.name()] -= dmdt12*he1; + } + } + + return eqnsPtr; +} + + +template<class BasePhaseSystem> +void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +correctEnergyTransport() +{ + BasePhaseSystem::correctEnergyTransport(); + + correctInterfaceThermo(); +} + + +template<class BasePhaseSystem> +void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>:: +correctInterfaceThermo() +{ + forAllConstIter + ( + heatTransferModelTable, + heatTransferModels_, + heatTransferModelIter + ) + { + const phasePair& pair + ( + this->phasePairs_[heatTransferModelIter.key()] + ); + + const phaseModel& phase1 = pair.phase1(); + const phaseModel& phase2 = pair.phase2(); + + const volScalarField& p(phase1.thermo().p()); + + const volScalarField& T1(phase1.thermo().T()); + const volScalarField& T2(phase2.thermo().T()); + + volScalarField& Tf(*this->Tf_[pair]); + + const volScalarField L + ( + phase1.thermo().he(p, Tf) - phase2.thermo().he(p, Tf) + ); + + const volScalarField dmdt(this->dmdt(pair)); + + volScalarField H1 + ( + this->heatTransferModels_[pair].first()->K() + ); + + volScalarField H2 + ( + this->heatTransferModels_[pair].second()->K() + ); + + // Limit the H[12] to avoid /0 + H1.max(SMALL); + H2.max(SMALL); + + Tf = (H1*T1 + H2*T2 + dmdt*L)/(H1 + H2); + + Info<< "Tf." << pair.name() + << ": min = " << min(Tf.primitiveField()) + << ", mean = " << average(Tf.primitiveField()) + << ", max = " << max(Tf.primitiveField()) + << endl; + } +} + + +template<class BasePhaseSystem> +bool Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::read() +{ + if (BasePhaseSystem::read()) + { + bool readOK = true; + + // Models ... + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H similarity index 55% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H index da7bdfe538e29708fbef5693f775eb152258e075..7a77828f2dceaf00bacf81e35d055e8cbedd4c2d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,19 +24,25 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::HeatAndMassTransferPhaseSystem + Foam::TwoResistanceHeatTransferPhaseSystem Description - Base class to support interfacial heat and mass transfer between a number - of phases. + Class which models interfacial heat transfer between a number of phases. + Two heat transfer models are stored at each interface, one for each phase. + This permits definition of an interface temperature with which heat transfer + occurs. It also allows derived systems to define other thermodynamic + properties at the interface and therefore represent phase changes. + +See also + OneResistanceHeatTransferPhaseSystem SourceFiles - HeatAndMassTransferPhaseSystem.C + TwoResistanceHeatTransferPhaseSystem.C \*---------------------------------------------------------------------------*/ -#ifndef HeatAndMassTransferPhaseSystem_H -#define HeatAndMassTransferPhaseSystem_H +#ifndef TwoResistanceHeatTransferPhaseSystem_H +#define TwoResistanceHeatTransferPhaseSystem_H #include "phaseSystem.H" @@ -50,14 +56,13 @@ class BlendedInterfacialModel; class blendingMethod; class heatTransferModel; -class massTransferModel; /*---------------------------------------------------------------------------*\ - Class HeatAndMassTransferPhaseSystem Declaration + Class TwoResistanceHeatTransferPhaseSystem Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseSystem> -class HeatAndMassTransferPhaseSystem +class TwoResistanceHeatTransferPhaseSystem : public BasePhaseSystem { @@ -67,35 +72,14 @@ protected: typedef HashTable < - HashTable - < - autoPtr<BlendedInterfacialModel<heatTransferModel>> - >, + Pair<autoPtr<BlendedInterfacialModel<heatTransferModel>>>, phasePairKey, phasePairKey::hash > heatTransferModelTable; - typedef HashTable - < - HashTable - < - autoPtr<BlendedInterfacialModel<massTransferModel>> - >, - phasePairKey, - phasePairKey::hash - > massTransferModelTable; - // Protected data - //- Mass transfer rate - HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> - dmdt_; - - //- Explicit part of the mass transfer rate - HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> - dmdtExplicit_; - //- Interface temperatures HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash> Tf_; @@ -104,47 +88,29 @@ protected: //- Heat transfer models heatTransferModelTable heatTransferModels_; - //- Mass transfer models - massTransferModelTable massTransferModels_; - public: // Constructors //- Construct from fvMesh - HeatAndMassTransferPhaseSystem(const fvMesh&); + TwoResistanceHeatTransferPhaseSystem(const fvMesh&); //- Destructor - virtual ~HeatAndMassTransferPhaseSystem(); + virtual ~TwoResistanceHeatTransferPhaseSystem(); // Member Functions - //- Return true if there is mass transfer for phase - virtual bool transfersMass(const phaseModel& phase) const; - - //- Return the interfacial mass flow rate - virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; - - //- Return the total interfacial mass transfer rate for phase - virtual tmp<volScalarField> dmdt(const phaseModel& phase) const; - - //- Return the momentum transfer matrices - virtual autoPtr<phaseSystem::momentumTransferTable> - momentumTransfer() const; - //- Return the heat transfer matrices - virtual autoPtr<phaseSystem::heatTransferTable> - heatTransfer() const; + virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const; - //- Return the mass transfer matrices - virtual autoPtr<phaseSystem::massTransferTable> - massTransfer() const = 0; + //- Correct the energy transport e.g. alphat and Tf + virtual void correctEnergyTransport(); - //- Correct the thermodynamics - virtual void correctThermo() = 0; + //- Correct the interface thermodynamics + virtual void correctInterfaceThermo(); //- Read base phaseProperties dictionary virtual bool read(); @@ -158,7 +124,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository - #include "HeatAndMassTransferPhaseSystem.C" + #include "TwoResistanceHeatTransferPhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C index 1a30bf9b56ddd7d9190c51893768532b1d17e057..80184f13e77485154ee9c9905b4334915d48444a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -90,7 +90,7 @@ bool Foam::diameterModels::constant::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.readEntry("d", d_); + diameterProperties_.lookup("d") >> d_; return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H index 60a84550a15e78398cdddcf6108e0817e21e4af4..3ca9992568eb62c3f7e8c26a8f523d186914e09e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/constantDiameter/constantDiameter.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef constant_H -#define constant_H +#ifndef constantDiameter_H +#define constantDiameter_H #include "diameterModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C index aabf69c3198fcc3873afa737cb1da2d77f077125..261fbb52a4bf03045106c569b61e5ed8d0dcd312 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2017 OpenFOAM Foundation + | Copyright (C) 2011-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H index dc36fce1e684d22b659d152692b5c631758773e9..48cdb4fe444cc5712b304cf306963bf505b6f87f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C similarity index 75% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index fd0ca095ef96b4b77fdf8ad644b1542e4413f015..c02cc1e8a6aa636b4444a8247d09b61217445158 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -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. @@ -35,28 +35,32 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New const phaseModel& phase ) { - const word modelType(dict.get<word>("diameterModel")); + word diameterModelType + ( + dict.lookup("diameterModel") + ); Info << "Selecting diameterModel for phase " << phase.name() << ": " - << modelType << endl; + << diameterModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(diameterModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown diameterModel type " - << modelType << nl << nl - << "Valid diameterModel types :" << endl + << "Unknown diameterModelType type " + << diameterModelType << endl << endl + << "Valid diameterModel types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return cstrIter() ( - dict.optionalSubDict(modelType + "Coeffs"), + dict.optionalSubDict(diameterModelType + "Coeffs"), phase ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C similarity index 80% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C index d2f9ed364b220bf3aa09e10f399093ddbcfe7a46..02eb0ef4a91e9204ecf687358d8c7c76bef643d2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,7 +56,20 @@ Foam::diameterModels::isothermal::isothermal : diameterModel(diameterProperties, phase), d0_("d0", dimLength, diameterProperties_), - p0_("p0", dimPressure, diameterProperties_) + p0_("p0", dimPressure, diameterProperties_), + d_ + ( + IOobject + ( + IOobject::groupName("d", phase.name()), + phase_.time().timeName(), + phase_.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + phase_.mesh(), + d0_ + ) {} @@ -70,12 +83,15 @@ Foam::diameterModels::isothermal::~isothermal() Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const { - const volScalarField& p = phase_.db().lookupObject<volScalarField> - ( - "p" - ); + return d_; +} + + +void Foam::diameterModels::isothermal::correct() +{ + const volScalarField& p = phase_.db().lookupObject<volScalarField>("p"); - return d0_*cbrt(p0_/p); + d_ = d0_*pow(p0_/p, 1.0/3.0); } @@ -83,8 +99,8 @@ bool Foam::diameterModels::isothermal::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.readEntry("d0", d0_); - diameterProperties_.readEntry("p0", p0_); + diameterProperties_.lookup("d0") >> d0_; + diameterProperties_.lookup("p0") >> p0_; return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H index c6f3b752418a62749caf36f5320b9d6fd30e5063..e8cc13d43a45e35f2e8fecb9e03985da9cac5261 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/isothermalDiameter/isothermalDiameter.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +34,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef isothermal_H -#define isothermal_H +#ifndef isothermalDiameter_H +#define isothermalDiameter_H #include "diameterModel.H" @@ -62,6 +62,9 @@ class isothermal //- Reference pressure for the isothermal expansion dimensionedScalar p0_; + //- Actual diameter field + volScalarField d_; + public: @@ -88,6 +91,9 @@ public: //- Return the diameter field virtual tmp<volScalarField> d() const; + //- Correct the diameter field + virtual void correct(); + //- Read phaseProperties dictionary virtual bool read(const dictionary& phaseProperties); }; diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C new file mode 100644 index 0000000000000000000000000000000000000000..b3a38e9a69e03e4763bd97c55ed9f9e2249c9de4 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "linearTsubDiameter.H" +#include "phaseSystem.H" +#include "saturationModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(linearTsub, 0); + + addToRunTimeSelectionTable + ( + diameterModel, + linearTsub, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::linearTsub::linearTsub +( + const dictionary& diameterProperties, + const phaseModel& phase +) +: + diameterModel(diameterProperties, phase), + liquidPhaseName_(diameterProperties.lookup("liquidPhase")), + d2_("d2", dimLength, diameterProperties.lookupOrDefault("d2", 0.0015)), + Tsub2_ + ( + "Tsub2", + dimTemperature, + diameterProperties.lookupOrDefault("Tsub2", 0) + ), + d1_ + ( + "d1", + dimLength, + diameterProperties.lookupOrDefault("d1", 0.00015) + ), + Tsub1_ + ( + "Tsub1", + dimTemperature, + diameterProperties.lookupOrDefault("Tsub1", 13.5) + ), + d_ + ( + IOobject + ( + IOobject::groupName("d", phase.name()), + phase_.time().timeName(), + phase_.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + phase_.mesh(), + d1_ + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::linearTsub::~linearTsub() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::diameterModels::linearTsub::d() const +{ + return d_; +} + + +void Foam::diameterModels::linearTsub::correct() +{ + // Lookup the fluid model + const phaseSystem& fluid = + refCast<const phaseSystem> + ( + phase_.mesh().lookupObject<phaseSystem>("phaseProperties") + ); + + const phaseModel& liquid(fluid.phases()[liquidPhaseName_]); + + if (phase_.mesh().foundObject<saturationModel>("saturationModel")) + { + const saturationModel& satModel = + phase_.mesh().lookupObject<saturationModel>("saturationModel"); + + const volScalarField Tsub + ( + liquid.thermo().T() - satModel.Tsat(liquid.thermo().p()) + ); + + d_ = max + ( + d1_, + min + ( + d2_, + (d1_*(Tsub - Tsub2_) + d2_*(Tsub - Tsub1_))/(Tsub2_ - Tsub1_) + ) + ); + } +} + + +bool Foam::diameterModels::linearTsub::read(const dictionary& phaseProperties) +{ + diameterModel::read(phaseProperties); + diameterProperties_.lookup("liquidPhase") >> liquidPhaseName_; + diameterProperties_.lookup("d2") >> d2_; + diameterProperties_.lookup("Tsub2") >> Tsub2_; + diameterProperties_.lookup("d1") >> d1_; + diameterProperties_.lookup("Tsub1") >> Tsub1_; + + return true; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H new file mode 100644 index 0000000000000000000000000000000000000000..ecf9eb0531b10862f607ce4cc08445faf9fe6a92 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/linearTsubDiameter/linearTsubDiameter.H @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::linearTsub + +Description + Vapour bubble diameter model for modelling of condensation of vapour + bubbles. Calculates bubble diameter as a function of liquid phase + subcooling. + + Reference: + \verbatim + Anglart, H., Nylund, O., Kurul, N., & Podowski, M. Z. (1997). + CFD prediction of flow and phase distribution in fuel assemblies with + spacers. + Nuclear Engineering and Design, 177(1-3), 215-228. + \endverbatim + +SourceFiles + linearTsub.C + +\*---------------------------------------------------------------------------*/ + +#ifndef linearTsubDiameter_H +#define linearTsubDiameter_H + +#include "diameterModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class linearTsub Declaration +\*---------------------------------------------------------------------------*/ + +class linearTsub +: + public diameterModel +{ + // Private data + + //- Name of the liquid phase that is used to determine subcooling + // temperature + word liquidPhaseName_; + + //- Reference diameter for low subcooling temperature + dimensionedScalar d2_; + + //- Subcooling temperature where low subcooling diamter is reached + dimensionedScalar Tsub2_; + + //- Reference diameter for high subcooling temperature + dimensionedScalar d1_; + + //- Subcooling temperature where high subcooling diamter is reached + dimensionedScalar Tsub1_; + + //- Actual diameter field + mutable volScalarField d_; + + +public: + + //- Runtime type information + TypeName("linearTsub"); + + + // Constructors + + //- Construct from components + linearTsub + ( + const dictionary& diameterProperties, + const phaseModel& phase + ); + + + //- Destructor + virtual ~linearTsub(); + + + // Member Functions + + //- Return the diameter field + virtual tmp<volScalarField> d() const; + + //- Correct the diameter field + virtual void correct(); + + //- Read phaseProperties dictionary + virtual bool read(const dictionary& phaseProperties); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C new file mode 100644 index 0000000000000000000000000000000000000000..e2b977ba04c4d997b4e377458651b7fb652d945d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "sizeGroup.H" +#include "populationBalanceModel.H" +#include "mixedFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::sizeGroup::sizeGroup +( + const word& name, + const dictionary& dict, + const phaseModel& phase, + const velocityGroup& velocityGroup, + const fvMesh& mesh +) +: + volScalarField + ( + IOobject + ( + IOobject::groupName + ( + name, + IOobject::groupName + ( + velocityGroup.phase().name(), + velocityGroup.popBalName() + ) + ), + mesh.time().timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar(name, dimless, readScalar(dict.lookup("value"))), + velocityGroup.f().boundaryField().types() + ), + phase_(phase), + velocityGroup_(velocityGroup), + d_("d", dimLength, dict), + x_("x", velocityGroup.formFactor()*pow3(d_)), + value_(readScalar(dict.lookup("value"))) +{ + // Adjust refValue at mixedFvPatchField boundaries + forAll(this->boundaryField(), patchi) + { + typedef mixedFvPatchField<scalar> mixedFvPatchScalarField; + + if + ( + isA<mixedFvPatchScalarField>(this->boundaryFieldRef()[patchi]) + ) + { + mixedFvPatchScalarField& f = + refCast<mixedFvPatchScalarField> + ( + this->boundaryFieldRef()[patchi] + ); + + f.refValue() = value_; + } + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::sizeGroup::~sizeGroup() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::sizeGroup> +Foam::diameterModels::sizeGroup::clone() const +{ + notImplemented("sizeGroup::clone() const"); + return autoPtr<sizeGroup>(nullptr); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H new file mode 100644 index 0000000000000000000000000000000000000000..a328e437fbdd73343f6283aa3063a2bcfdbc8503 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroup.H @@ -0,0 +1,190 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::sizeGroup + +Description + This class represents a single sizeGroup belonging to a velocityGroup. + The main property of a sizeGroup is its representative diameter. The + corresponding volScalarField f<number>.<phaseName>.<populationBalanceName> + gives the volume fraction of the sizeGroup such that all sizeGroup fractions + over a velocityGroup must sum to unity. The field is either read from the + startTime directory if present or constructed from a reference field called + f.<phaseName>.<populationBalanceName> where the boundary condition types + must be specified. All field and boundary condition values are reset to + match the "value" given in the sizeGroup subdictionary. + +Usage + \table + Property | Description | Required | Default value + d | Representative diameter | yes | + value | Field and BC value | yes | + \endtable + + Example + \verbatim + f1 + { + d 3e-3; + value 1.0; + } + \endverbatim + +See also + Foam::diameterModels::velocityGroup + Foam::diameterModels::populationBalanceModel + +SourceFiles + sizeGroup.C + +\*---------------------------------------------------------------------------*/ + +#ifndef sizeGroup_H +#define sizeGroup_H + +#include "dictionaryEntry.H" +#include "velocityGroup.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class sizeGroup Declaration +\*---------------------------------------------------------------------------*/ + +class sizeGroup +: + public volScalarField +{ + // Private data + + //- Phase this sizeGroup belongs to + const phaseModel& phase_; + + //- VelocityGroup this sizeGroup belongs to + const velocityGroup& velocityGroup_; + + //- Representative diameter of the sizeGroup + const dimensionedScalar d_; + + //- Representative volume of the sizeGroup + const dimensionedScalar x_; + + //- Initial value and value at boundaries + const scalar value_; + + +public: + + // Constructors + + sizeGroup + ( + const word& name, + const dictionary& dict, + const phaseModel& phase, + const velocityGroup& velocityGroup, + const fvMesh& mesh + ); + + //- Return clone + autoPtr<sizeGroup> clone() const; + + //- Return a pointer to a new sizeGroup created on freestore + // from Istream + class iNew + { + const phaseModel& phase_; + const velocityGroup& velocityGroup_; + + public: + + iNew + ( + const phaseModel& phase, + const velocityGroup& velocityGroup + ) + : + phase_(phase), + velocityGroup_(velocityGroup) + {} + + autoPtr<sizeGroup> operator()(Istream& is) const + { + dictionaryEntry ent(dictionary::null, is); + return autoPtr<sizeGroup> + ( + new sizeGroup + ( + ent.keyword(), + ent, + phase_, + velocityGroup_, + phase_.mesh() + ) + ); + } + }; + + + //- Destructor + virtual ~sizeGroup(); + + + // Member Functions + + inline const word& keyword() const; + + //- Return const-reference to the phase + inline const phaseModel& phase() const; + + //- Return const-reference to the velocityGroup + inline const velocityGroup& VelocityGroup() const; + + //- Return representative diameter of the sizeGroup + inline const dimensionedScalar& d() const; + + //- Return representative volume of the sizeGroup + inline const dimensionedScalar& x() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "sizeGroupI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroupI.H similarity index 65% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroupI.H index cc9673933fbb9b4ab6a44a9172afe8d03f355f13..58f34f638a88129d3f6ea375203d584d092a4f3c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/sizeGroupI.H @@ -1,11 +1,9 @@ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,21 +25,38 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::phaseModel& Foam::phasePair::phase1() const +inline const Foam::word& +Foam::diameterModels::sizeGroup::keyword() const +{ + return name(); +} + + +inline const Foam::phaseModel& +Foam::diameterModels::sizeGroup::phase() const +{ + return phase_; +} + + +inline const Foam::diameterModels::velocityGroup& +Foam::diameterModels::sizeGroup::VelocityGroup() const { - return phase1_; + return velocityGroup_; } -inline const Foam::phaseModel& Foam::phasePair::phase2() const +inline const Foam::dimensionedScalar& +Foam::diameterModels::sizeGroup::d() const { - return phase2_; + return d_; } -inline const Foam::uniformDimensionedVectorField& Foam::phasePair::g() const +inline const Foam::dimensionedScalar& +Foam::diameterModels::sizeGroup::x() const { - return g_; + return x_; } diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.C new file mode 100644 index 0000000000000000000000000000000000000000..e04a4ec94720e14af90d4c2d743be46a1598e696 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.C @@ -0,0 +1,334 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "velocityGroup.H" +#include "sizeGroup.H" +#include "populationBalanceModel.H" +#include "addToRunTimeSelectionTable.H" +#include "zeroGradientFvPatchFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(velocityGroup, 0); + + addToRunTimeSelectionTable + ( + diameterModel, + velocityGroup, + dictionary + ); +} +} + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::diameterModels::velocityGroup::dsm() const +{ + tmp<volScalarField> tInvDsm + ( + volScalarField::New + ( + "invDsm", + phase_.mesh(), + dimensionedScalar(inv(dimLength)) + ) + ); + + volScalarField& invDsm = tInvDsm.ref(); + + forAll(sizeGroups_, i) + { + const sizeGroup& fi = sizeGroups_[i]; + + invDsm += fi/fi.d(); + } + + return 1.0/tInvDsm; +} + + +Foam::tmp<Foam::volScalarField> +Foam::diameterModels::velocityGroup::fSum() const +{ + tmp<volScalarField> tsumSizeGroups + ( + volScalarField::New + ( + "sumSizeGroups", + phase_.mesh(), + dimensionedScalar("zero", dimless, 0) + ) + ); + + volScalarField& sumSizeGroups = tsumSizeGroups.ref(); + + forAll(sizeGroups_, i) + { + sumSizeGroups += sizeGroups_[i]; + } + + return tsumSizeGroups; +} + + +void Foam::diameterModels::velocityGroup::renormalize() +{ + Info<< "Renormalizing sizeGroups for velocityGroup " + << phase_.name() + << endl; + + // Set negative values to zero + forAll(sizeGroups_, i) + { + sizeGroups_[i] *= pos(sizeGroups_[i]); + }; + + forAll(sizeGroups_, i) + { + sizeGroups_[i] /= fSum_; + }; +} + + +Foam::tmp<Foam::fv::convectionScheme<Foam::scalar>> +Foam::diameterModels::velocityGroup::mvconvection() const +{ + tmp<fv::convectionScheme<Foam::scalar> > mvConvection + ( + fv::convectionScheme<Foam::scalar>::New + ( + phase_.mesh(), + fields_, + phase_.alphaRhoPhi(), + phase_.mesh().divScheme + ( + "div(" + phase_.alphaRhoPhi()().name() + ",f)" + ) + ) + ); + + return mvConvection; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::velocityGroup::velocityGroup +( + const dictionary& diameterProperties, + const phaseModel& phase +) +: + diameterModel(diameterProperties, phase), + popBalName_(diameterProperties.lookup("populationBalance")), + f_ + ( + IOobject + ( + IOobject::groupName + ( + "f", + IOobject::groupName + ( + phase.name(), + popBalName_ + ) + ), + phase.time().timeName(), + phase.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + phase.mesh() + ), + formFactor_("formFactor", dimless, diameterProperties), + sizeGroups_ + ( + diameterProperties.lookup("sizeGroups"), + sizeGroup::iNew(phase, *this) + ), + fSum_ + ( + IOobject + ( + IOobject::groupName + ( + "fsum", + IOobject::groupName + ( + phase.name(), + popBalName_ + ) + ), + phase.time().timeName(), + phase.mesh() + ), + fSum() + ), + d_ + ( + IOobject + ( + IOobject::groupName("d", phase.name()), + phase.time().timeName(), + phase.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + phase.mesh(), + dimensionedScalar(dimLength) + ), + dmdt_ + ( + IOobject + ( + IOobject::groupName("source", phase.name()), + phase.time().timeName(), + phase.mesh() + ), + phase.mesh(), + dimensionedScalar(dimDensity/dimTime) + ) +{ + if + ( + phase_.mesh().solverDict(popBalName_).lookupOrDefault<Switch> + ( + "renormalizeAtRestart", + false + ) + || + phase_.mesh().solverDict(popBalName_).lookupOrDefault<Switch> + ( + "renormalize", + false + ) + ) + { + renormalize(); + } + + fSum_ = fSum(); + + if + ( + mag(1 - fSum_.weightedAverage(fSum_.mesh().V()).value()) >= 1e-5 + || mag(1 - max(fSum_).value()) >= 1e-5 + || mag(1 - min(fSum_).value()) >= 1e-5 + ) + { + FatalErrorInFunction + << " Initial values of the sizeGroups belonging to velocityGroup " + << this->phase().name() + << " must add to" << nl << " unity. This condition might be" + << " violated due to wrong entries in the" << nl + << " velocityGroupCoeffs subdictionary or bad initial conditions in" + << " the startTime" << nl + << " directory. The sizeGroups can be renormalized at every" + << " timestep or at restart" << nl + << " only by setting the corresponding switch renormalize or" + << " renormalizeAtRestart" << nl + << " in the fvSolution subdictionary " << popBalName_ << "." + << " Note that boundary conditions are not" << nl << "renormalized." + << exit(FatalError); + } + + forAll(sizeGroups_, i) + { + fields_.add(sizeGroups_[i]); + } + + d_ = dsm(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::velocityGroup::~velocityGroup() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +void Foam::diameterModels::velocityGroup::preSolve() +{ + mvConvection_ = mvconvection(); +} + + +void Foam::diameterModels::velocityGroup::postSolve() +{ + d_ = dsm(); + + Info<< this->phase().name() << " Sauter mean diameter, min, max = " + << d_.weightedAverage(d_.mesh().V()).value() + << ' ' << min(d_).value() + << ' ' << max(d_).value() + << endl; + + fSum_ = fSum(); + + Info<< phase_.name() << " sizeGroups-sum volume fraction, min, max = " + << fSum_.weightedAverage(phase_.mesh().V()).value() + << ' ' << min(fSum_).value() + << ' ' << max(fSum_).value() + << endl; + + if + ( + phase_.mesh().solverDict(popBalName_).lookupOrDefault<Switch> + ( + "renormalize", + false + ) + ) + { + renormalize(); + } +} + + +bool Foam::diameterModels::velocityGroup:: +read(const dictionary& phaseProperties) +{ + diameterModel::read(phaseProperties); + + return true; +} + + +Foam::tmp<Foam::volScalarField> +Foam::diameterModels::velocityGroup::d() const +{ + return d_; +} + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.H new file mode 100644 index 0000000000000000000000000000000000000000..801a1ba11c74f3fc953a3cddda0ee15e0462d2d6 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroup.H @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::velocityGroup + +Description + This diameterModel is intended for use with a populationBalanceModel in + order to simulate polydispersed bubbly or particulate flows. It can hold any + number of sizeGroups from which the Sauter mean diameter is calculated. It + can also be used as a diameterModel without a populationBalance and would + then behave like a constantDiameter model. In this case, some arbitrary name + must be entered for the populationBalance keyword. + +Usage + \table + Property | Description + populationBalance | Name of the corresponding populationBalance + formFactor | Form factor for converting diameter into volume + sizeGroups | List of sizeGroups + \endtable + + Example + \verbatim + diameterModel velocityGroup; + velocityGroupCoeffs + { + populationBalance bubbles; + + formFactor 0.5235987756; + + sizeGroups + ( + f0{d 1.00e-3; value 0;} + f1{d 1.08e-3; value 0;} + f2{d 1.16e-3; value 0.25;} + f3{d 1.25e-3; value 0.5;} + f4{d 1.36e-3; value 0.25;} + f5{d 1.46e-3; value 0;} + ... + ); + } + \endverbatim + +See also + Foam::diameterModels::sizeGroup + Foam::diameterModels::populationBalanceModel + +SourceFiles + velocityGroup.C + +\*---------------------------------------------------------------------------*/ + +#ifndef velocityGroup_H +#define velocityGroup_H + +#include "diameterModel.H" +#include "multivariateScheme.H" +#include "convectionScheme.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +class sizeGroup; + +/*---------------------------------------------------------------------------*\ + Class velocityGroup Declaration +\*---------------------------------------------------------------------------*/ + +class velocityGroup +: + public diameterModel +{ + // Private data + + //- Name of the populationBalance this velocityGroup belongs to + word popBalName_; + + //- Reference field from which the sizeGroup fields are derived + volScalarField f_; + + //- Form factor relating diameter and volume + dimensionedScalar formFactor_; + + //- sizeGroups belonging to this velocityGroup + PtrList<sizeGroup> sizeGroups_; + + //- Sum of sizeGroup volume fractions + volScalarField fSum_; + + //- Number-based Sauter-mean diameter of the phase + volScalarField d_; + + //- Multivariate convection scheme + tmp<fv::convectionScheme<scalar>> mvConvection_; + + //- Table of fields for multivariate convection + multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields_; + + //- Mass transfer rate + volScalarField dmdt_; + + + // Private member functions + + tmp<volScalarField> dsm() const; + + tmp<volScalarField> fSum() const; + + void renormalize(); + + tmp<Foam::fv::convectionScheme<Foam::scalar>> mvconvection() const; + + +public: + + //- Runtime type information + TypeName("velocityGroup"); + + + // Constructors + + //- Construct from components + velocityGroup + ( + const dictionary& diameterProperties, + const phaseModel& phase + ); + + + //- Destructor + virtual ~velocityGroup(); + + + // Member Functions + + //- Return name of populationBalance this velocityGroup belongs to + inline const word& popBalName() const; + + //- Return reference field for sizeGroup's + inline const volScalarField& f() const; + + //- Return the form factor + inline const dimensionedScalar& formFactor() const; + + //- Return sizeGroups belonging to this velocityGroup + inline const PtrList<sizeGroup>& sizeGroups() const; + + //- Return const-reference to multivariate convectionScheme + inline const tmp<fv::convectionScheme<scalar>>& mvConvection() const; + + //- Return const-reference to the mass transfer rate + inline const volScalarField& dmdt() const; + + //- Return reference to the mass transfer rate + inline volScalarField& dmdtRef(); + + //- Corrections before populationBalanceModel::solve() + void preSolve(); + + //- Corrections after populationBalanceModel::solve() + void postSolve(); + + //- Read diameterProperties dictionary + virtual bool read(const dictionary& diameterProperties); + + //- Return the Sauter-mean diameter + virtual tmp<volScalarField> d() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "velocityGroupI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroupI.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroupI.H new file mode 100644 index 0000000000000000000000000000000000000000..d91e6b2de5088cb3d50853daa997de0c1dfd3247 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/diameterModels/velocityGroup/velocityGroupI.H @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::word& +Foam::diameterModels::velocityGroup::popBalName() const +{ + return popBalName_; +} + + +inline const Foam::volScalarField& +Foam::diameterModels::velocityGroup::f() const +{ + return f_; +} + + +inline const Foam::dimensionedScalar& +Foam::diameterModels::velocityGroup::formFactor() const +{ + return formFactor_; +} + + +inline const Foam::PtrList<Foam::diameterModels::sizeGroup>& +Foam::diameterModels::velocityGroup::sizeGroups() const +{ + return sizeGroups_; +} + + +inline const Foam::tmp<Foam::fv::convectionScheme<Foam::scalar>>& +Foam::diameterModels::velocityGroup::mvConvection() const +{ + return mvConvection_; +} + + +inline const Foam::volScalarField& Foam::diameterModels::velocityGroup:: +dmdt() const +{ + return dmdt_; +} + + +inline Foam::volScalarField& Foam::diameterModels::velocityGroup::dmdtRef() +{ + return dmdt_; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C similarity index 75% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C index cd58dd39d9afb8e1f4c7dd1882b42f9e14ba228b..af16d839e969d9b67acb4253ba4ca0affcde33ca 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,6 +28,35 @@ License #include "AnisothermalPhaseModel.H" #include "phaseSystem.H" +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::AnisothermalPhaseModel<BasePhaseModel>::filterPressureWork +( + const tmp<volScalarField>& pressureWork +) const +{ + const volScalarField& alpha = *this; + + scalar pressureWorkAlphaLimit = + this->thermo_->lookupOrDefault("pressureWorkAlphaLimit", 0.0); + + if (pressureWorkAlphaLimit > 0) + { + return + ( + max(alpha - pressureWorkAlphaLimit, scalar(0)) + /max(alpha - pressureWorkAlphaLimit, pressureWorkAlphaLimit) + )*pressureWork; + } + else + { + return pressureWork; + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class BasePhaseModel> @@ -38,18 +67,7 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::AnisothermalPhaseModel const label index ) : - BasePhaseModel(fluid, phaseName, index), - K_ - ( - IOobject - ( - IOobject::groupName("K", this->name()), - fluid.mesh().time().timeName(), - fluid.mesh() - ), - fluid.mesh(), - dimensionedScalar(sqr(dimVelocity), Zero) - ) + BasePhaseModel(fluid, phaseName, index) {} @@ -62,21 +80,6 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::~AnisothermalPhaseModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class BasePhaseModel> -bool Foam::AnisothermalPhaseModel<BasePhaseModel>::compressible() const -{ - return !this->thermo().incompressible(); -} - - -template<class BasePhaseModel> -void Foam::AnisothermalPhaseModel<BasePhaseModel>::correctKinematics() -{ - BasePhaseModel::correctKinematics(); - K_ = 0.5*magSqr(this->U()); -} - - template<class BasePhaseModel> void Foam::AnisothermalPhaseModel<BasePhaseModel>::correctThermo() { @@ -87,29 +90,9 @@ void Foam::AnisothermalPhaseModel<BasePhaseModel>::correctThermo() template<class BasePhaseModel> -Foam::tmp<Foam::volScalarField> -Foam::AnisothermalPhaseModel<BasePhaseModel>::filterPressureWork -( - const tmp<volScalarField>& pressureWork -) const +bool Foam::AnisothermalPhaseModel<BasePhaseModel>::isothermal() const { - const volScalarField& alpha = *this; - - scalar pressureWorkAlphaLimit = - this->thermo_->lookupOrDefault("pressureWorkAlphaLimit", 0.0); - - if (pressureWorkAlphaLimit > 0) - { - return - ( - max(alpha - pressureWorkAlphaLimit, scalar(0)) - /max(alpha - pressureWorkAlphaLimit, pressureWorkAlphaLimit) - )*pressureWork; - } - else - { - return pressureWork; - } + return false; } @@ -118,13 +101,13 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn() { const volScalarField& alpha = *this; - const volVectorField& U = this->U(); - const surfaceScalarField& alphaPhi = this->alphaPhi(); - const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi(); - const volScalarField& contErr(this->continuityError()); + const volVectorField U(this->U()); + const surfaceScalarField alphaPhi(this->alphaPhi()); + const surfaceScalarField alphaRhoPhi(this->alphaRhoPhi()); - const volScalarField alphaEff(this->turbulence().alphaEff()); + const volScalarField contErr(this->continuityError()); + const volScalarField K(this->K()); volScalarField& he = this->thermo_->he(); @@ -134,13 +117,13 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn() + fvm::div(alphaRhoPhi, he) - fvm::Sp(contErr, he) - + fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_) - - contErr*K_ + + fvc::ddt(alpha, this->rho(), K) + fvc::div(alphaRhoPhi, K) + - contErr*K - fvm::laplacian ( fvc::interpolate(alpha) - *fvc::interpolate(alphaEff), + *fvc::interpolate(this->alphaEff()), he ) == @@ -165,12 +148,4 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn() } -template<class BasePhaseModel> -const Foam::volScalarField& -Foam::AnisothermalPhaseModel<BasePhaseModel>::K() const -{ - return K_; -} - - // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H index 96f9c255e19314a111678b0121ca0eaa81dd33a8..2aa7db4ee61defb607a3d2064591128d5a55eedd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class AnisothermalPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -54,12 +54,6 @@ class AnisothermalPhaseModel : public BasePhaseModel { - // Private data - - //- Kinetic energy - volScalarField K_; - - // Private member functions //- Optionally filter the pressure work term as the phase-fraction -> 0 @@ -87,20 +81,14 @@ public: // Member Functions - //- Return true if the phase is compressible otherwise false - virtual bool compressible() const; - - //- Correct the kinematics - virtual void correctKinematics(); - //- Correct the thermodynamics virtual void correctThermo(); + //- Return whether the phase is isothermal + virtual bool isothermal() const; + //- Return the enthalpy equation virtual tmp<fvScalarMatrix> heEqn(); - - //- Return the phase kinetic energy - virtual const volScalarField& K() const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C similarity index 87% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C index a70cd7a95edaa40b05e5aed87070be6734324803..a1dc1f49fc7e9cabf0045585f934f510ba95e1b2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,16 +69,11 @@ template<class BasePhaseModel> Foam::tmp<Foam::volScalarField> Foam::InertPhaseModel<BasePhaseModel>::Qdot() const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - IOobject::groupName("Qdot", this->name()), - this->mesh().time().timeName(), - this->mesh() - ), + IOobject::groupName("Qdot", this->name()), this->mesh(), - dimensionedScalar(dimEnergy/dimTime/dimVolume, Zero) + dimensionedScalar(dimEnergy/dimTime/dimVolume) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H index c15ceed46f889e589536aca9b2a4fca3d3cb0020..dc367fcbc35a1c7efb294006f1c827d375c505d4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class InertPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -75,10 +75,7 @@ public: // Thermo //- Return the fuel consumption rate matrix - virtual tmp<fvScalarMatrix> R - ( - volScalarField& Yi - ) const; + virtual tmp<fvScalarMatrix> R(volScalarField& Yi) const; //- Return the heat release rate virtual tmp<volScalarField> Qdot() const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C similarity index 72% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C index db27d4f059cb022ed18c30c803870b16ba2c726d..4edd08c424567921d11c601c622825ca281ed193 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,22 +45,41 @@ Foam::IsothermalPhaseModel<BasePhaseModel>::IsothermalPhaseModel // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class BasePhaseModel> -bool Foam::IsothermalPhaseModel<BasePhaseModel>::compressible() const +void Foam::IsothermalPhaseModel<BasePhaseModel>::correctThermo() { - return !this->thermo().incompressible(); + BasePhaseModel::correctThermo(); + + // Correct the thermo, but make sure that the temperature remains the same + tmp<volScalarField> TCopy + ( + volScalarField::New + ( + this->thermo().T().name() + ":Copy", + this->thermo().T() + ) + ); + this->thermo_->he() = this->thermo().he(this->thermo().p(), TCopy); + this->thermo_->correct(); + this->thermo_->T() = TCopy; } template<class BasePhaseModel> -void Foam::IsothermalPhaseModel<BasePhaseModel>::correctThermo() -{} +bool Foam::IsothermalPhaseModel<BasePhaseModel>::isothermal() const +{ + return true; +} template<class BasePhaseModel> Foam::tmp<Foam::fvScalarMatrix> Foam::IsothermalPhaseModel<BasePhaseModel>::heEqn() { - return nullptr; + FatalErrorInFunction + << "Cannot construct an energy equation for an isothermal phase" + << exit(FatalError); + + return tmp<fvScalarMatrix>(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H index 5ff66b5128aaf2b0b13950accdecf159375acfa0..22ab0c9fc24ae79cd1adb7e1063fa519a162db64 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class IsothermalPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -73,12 +73,12 @@ public: // Member Functions - //- Return true if the phase is compressible otherwise false - virtual bool compressible() const; - //- Correct the thermodynamics virtual void correctThermo(); + //- Return whether the phase is isothermal + virtual bool isothermal() const; + //- Return the enthalpy equation virtual tmp<fvScalarMatrix> heEqn(); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C similarity index 62% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 6d820c60f67945399deca051132eed416cfe493e..4163c0cdc34aa0b78329ed614da2db2a9913bf08 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -153,7 +153,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel fluid.mesh() ), fluid.mesh(), - dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero) + dimensionedScalar(dimensionSet(0, 3, -1, 0, 0)) ), alphaRhoPhi_ ( @@ -164,19 +164,10 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel fluid.mesh() ), fluid.mesh(), - dimensionedScalar(dimensionSet(1, 0, -1, 0, 0), Zero) - ), - DUDt_ - ( - IOobject - ( - IOobject::groupName("DUDt", this->name()), - fluid.mesh().time().timeName(), - fluid.mesh() - ), - fluid.mesh(), - dimensionedVector(dimAcceleration, Zero) + dimensionedScalar(dimensionSet(1, 0, -1, 0, 0)) ), + DUDt_(nullptr), + DUDtf_(nullptr), divU_(nullptr), turbulence_ ( @@ -190,22 +181,32 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel *this ) ), - continuityError_ + continuityErrorFlow_ + ( + IOobject + ( + IOobject::groupName("continuityErrorFlow", this->name()), + fluid.mesh().time().timeName(), + fluid.mesh() + ), + fluid.mesh(), + dimensionedScalar(dimDensity/dimTime) + ), + continuityErrorSources_ ( IOobject ( - IOobject::groupName("continuityError", this->name()), + IOobject::groupName("continuityErrorSources", this->name()), fluid.mesh().time().timeName(), fluid.mesh() ), fluid.mesh(), - dimensionedScalar(dimDensity/dimTime, Zero) - ) + dimensionedScalar(dimDensity/dimTime) + ), + K_(nullptr) { - alphaPhi_.setOriented(); - alphaRhoPhi_.setOriented(); - phi_.writeOpt() = IOobject::AUTO_WRITE; + correctKinematics(); } @@ -226,11 +227,11 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correct() this->fluid().MRF().correctBoundaryVelocity(U_); - volScalarField& rho = this->thermo().rho(); + volScalarField& rho = this->thermoRef().rho(); + + continuityErrorFlow_ = fvc::ddt(*this, rho) + fvc::div(alphaRhoPhi_); - continuityError_ = - fvc::ddt(*this, rho) + fvc::div(alphaRhoPhi_) - - (this->fluid().fvOptions()(*this, rho)&rho); + continuityErrorSources_ = - (this->fluid().fvOptions()(*this, rho)&rho); } @@ -239,7 +240,23 @@ void Foam::MovingPhaseModel<BasePhaseModel>::correctKinematics() { BasePhaseModel::correctKinematics(); - DUDt_ = fvc::ddt(U_) + fvc::div(phi_, U_) - fvc::div(phi_)*U_; + if (DUDt_.valid()) + { + DUDt_.clear(); + DUDt(); + } + + if (DUDtf_.valid()) + { + DUDtf_.clear(); + DUDtf(); + } + + if (K_.valid()) + { + K_.clear(); + K(); + } } @@ -256,47 +273,53 @@ template<class BasePhaseModel> void Foam::MovingPhaseModel<BasePhaseModel>::correctEnergyTransport() { BasePhaseModel::correctEnergyTransport(); + turbulence_->correctEnergyTransport(); } +template<class BasePhaseModel> +bool Foam::MovingPhaseModel<BasePhaseModel>::stationary() const +{ + return false; +} + + template<class BasePhaseModel> Foam::tmp<Foam::fvVectorMatrix> Foam::MovingPhaseModel<BasePhaseModel>::UEqn() { + const volScalarField& alpha = *this; + const volScalarField& rho = this->thermo().rho(); + return ( - fvm::ddt(*this, this->thermo().rho(), U_) + fvm::ddt(alpha, rho, U_) + fvm::div(alphaRhoPhi_, U_) - - fvm::Sp(continuityError_, U_) - + this->fluid().MRF().DDt(*this*this->thermo().rho(), U_) + + fvm::SuSp(- this->continuityError(), U_) + + this->fluid().MRF().DDt(alpha*rho, U_) + turbulence_->divDevRhoReff(U_) ); } template<class BasePhaseModel> -const Foam::surfaceScalarField& -Foam::MovingPhaseModel<BasePhaseModel>::DbyA() const +Foam::tmp<Foam::fvVectorMatrix> +Foam::MovingPhaseModel<BasePhaseModel>::UfEqn() { - if (DbyA_.valid()) - { - return DbyA_; - } - else - { - return surfaceScalarField::null(); - } -} + // As the "normal" U-eqn but without the ddt terms + const volScalarField& alpha = *this; + const volScalarField& rho = this->thermo().rho(); -template<class BasePhaseModel> -void Foam::MovingPhaseModel<BasePhaseModel>::DbyA -( - const tmp<surfaceScalarField>& DbyA -) -{ - DbyA_ = DbyA; + return + ( + fvm::div(alphaRhoPhi_, U_) + - fvm::Sp(fvc::div(alphaRhoPhi_), U_) + + fvm::SuSp(- this->continuityErrorSources(), U_) + + this->fluid().MRF().DDt(alpha*rho, U_) + + turbulence_->divDevRhoReff(U_) + ); } @@ -310,34 +333,137 @@ Foam::MovingPhaseModel<BasePhaseModel>::U() const template<class BasePhaseModel> Foam::volVectorField& -Foam::MovingPhaseModel<BasePhaseModel>::U() +Foam::MovingPhaseModel<BasePhaseModel>::URef() { return U_; } +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::phi() const +{ + return phi_; +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::MovingPhaseModel<BasePhaseModel>::phiRef() +{ + return phi_; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::alphaPhi() const +{ + return alphaPhi_; +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::MovingPhaseModel<BasePhaseModel>::alphaPhiRef() +{ + return alphaPhi_; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::alphaRhoPhi() const +{ + return alphaRhoPhi_; +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::MovingPhaseModel<BasePhaseModel>::alphaRhoPhiRef() +{ + return alphaRhoPhi_; +} + + template<class BasePhaseModel> Foam::tmp<Foam::volVectorField> Foam::MovingPhaseModel<BasePhaseModel>::DUDt() const { - return DUDt_; + if (!DUDt_.valid()) + { + DUDt_ = fvc::ddt(U_) + fvc::div(phi_, U_) - fvc::div(phi_)*U_; + } + + return tmp<volVectorField>(DUDt_()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::DUDtf() const +{ + if (!DUDtf_.valid()) + { + DUDtf_ = byDt(phi_ - phi_.oldTime()); + } + + return tmp<surfaceScalarField>(DUDtf_()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::continuityError() const +{ + return continuityErrorFlow_ + continuityErrorSources_; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::continuityErrorFlow() const +{ + return continuityErrorFlow_; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::continuityErrorSources() const +{ + return continuityErrorSources_; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::K() const +{ + if (!K_.valid()) + { + K_ = volScalarField::New + ( + IOobject::groupName("K", this->name()), + 0.5*magSqr(this->U()) + ); + } + + return tmp<volScalarField>(K_()); } template<class BasePhaseModel> -const Foam::tmp<Foam::volScalarField>& +Foam::tmp<Foam::volScalarField> Foam::MovingPhaseModel<BasePhaseModel>::divU() const { - return divU_; + return divU_.valid() ? tmp<volScalarField>(divU_()) : tmp<volScalarField>(); } template<class BasePhaseModel> -void -Foam::MovingPhaseModel<BasePhaseModel>::divU -( - const tmp<volScalarField>& divU -) +void Foam::MovingPhaseModel<BasePhaseModel>::divU(tmp<volScalarField> divU) { divU_ = divU; } @@ -345,65 +471,81 @@ Foam::MovingPhaseModel<BasePhaseModel>::divU template<class BasePhaseModel> Foam::tmp<Foam::volScalarField> -Foam::MovingPhaseModel<BasePhaseModel>::continuityError() const +Foam::MovingPhaseModel<BasePhaseModel>::mut() const { - return continuityError_; + return turbulence_->mut(); } template<class BasePhaseModel> -Foam::tmp<Foam::surfaceScalarField> -Foam::MovingPhaseModel<BasePhaseModel>::phi() const +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::muEff() const { - return phi_; + return turbulence_->muEff(); } template<class BasePhaseModel> -Foam::surfaceScalarField& -Foam::MovingPhaseModel<BasePhaseModel>::phi() +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::nut() const { - return phi_; + return turbulence_->nut(); } template<class BasePhaseModel> -Foam::tmp<Foam::surfaceScalarField> -Foam::MovingPhaseModel<BasePhaseModel>::alphaPhi() const +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::nuEff() const { - return alphaPhi_; + return turbulence_->nuEff(); } template<class BasePhaseModel> -Foam::surfaceScalarField& -Foam::MovingPhaseModel<BasePhaseModel>::alphaPhi() +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::kappaEff() const { - return alphaPhi_; + return turbulence_->kappaEff(); } template<class BasePhaseModel> -Foam::tmp<Foam::surfaceScalarField> -Foam::MovingPhaseModel<BasePhaseModel>::alphaRhoPhi() const +Foam::tmp<Foam::scalarField> +Foam::MovingPhaseModel<BasePhaseModel>::kappaEff(const label patchi) const { - return alphaRhoPhi_; + return turbulence_->kappaEff(patchi); } template<class BasePhaseModel> -Foam::surfaceScalarField& -Foam::MovingPhaseModel<BasePhaseModel>::alphaRhoPhi() +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::alphaEff() const { - return alphaRhoPhi_; + return turbulence_->alphaEff(); } template<class BasePhaseModel> -const Foam::phaseCompressibleTurbulenceModel& -Foam::MovingPhaseModel<BasePhaseModel>::turbulence() const +Foam::tmp<Foam::scalarField> +Foam::MovingPhaseModel<BasePhaseModel>::alphaEff(const label patchi) const +{ + return turbulence_->alphaEff(patchi); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::k() const +{ + return turbulence_->k(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::MovingPhaseModel<BasePhaseModel>::pPrime() const { - return *turbulence_; + return turbulence_->pPrime(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H similarity index 54% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index 087f8c480f272c921d269d82db7ed1875de2174a..79ca8425c20ff1869e19d829cf1e191e5e45289e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,17 +28,15 @@ Class Description Class which represents a moving fluid phase. Holds the velocity, fluxes and - turbulence model. Provides access to the turbulent quantities. + turbulence model and can generate the momentum equation. The interface is + quite restrictive as it also has to support an equivalent stationary model, + which does not store motion fields or a turbulence model. Possible future extensions include separating the turbulent fuctionality - into another layer. It should also be possible to replace this layer with a - stationary phase model, in order to model packed beds or simple porous - media. This would probably require extra functionality, such as returning - the inputs into the general pressure equation (A, HbyA, etc ...). + into another layer. - Note that this class does not return the turbulence model, it just provides - indirect access to the turbulent data. This is so a layer without - turbulence modelling (such as a stationary model) could be substituted. +See also + StationaryPhaseModel SourceFiles MovingPhaseModel.C @@ -57,7 +55,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class MovingPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -82,7 +80,10 @@ protected: surfaceScalarField alphaRhoPhi_; //- Lagrangian acceleration field (needed for virtual-mass) - volVectorField DUDt_; + mutable tmp<volVectorField> DUDt_; + + //- Lagrangian acceleration field on the faces (needed for virtual-mass) + mutable tmp<surfaceScalarField> DUDtf_; //- Dilatation rate tmp<volScalarField> divU_; @@ -90,12 +91,14 @@ protected: //- Turbulence model autoPtr<phaseCompressibleTurbulenceModel> turbulence_; - //- Continuity error - volScalarField continuityError_; + //- Continuity error due to the flow + volScalarField continuityErrorFlow_; + + //- Continuity error due to any sources + volScalarField continuityErrorSources_; - //- Phase diffusivity divided by the momentum coefficient. - // Used for implicit treatment of the phase pressure and dispersion - tmp<surfaceScalarField> DbyA_; + //- Kinetic Energy + mutable tmp<volScalarField> K_; private: @@ -136,62 +139,109 @@ public: //- Correct the energy transport e.g. alphat virtual void correctEnergyTransport(); - //- Return the momentum equation - virtual tmp<fvVectorMatrix> UEqn(); - - // Implicit phase pressure and dispersion support - - //- Return the phase diffusivity divided by the momentum coefficient - virtual const surfaceScalarField& DbyA() const; + // Momentum - //- Set the phase diffusivity divided by the momentum coefficient - virtual void DbyA(const tmp<surfaceScalarField>& DbyA); + //- Return whether the phase is stationary + virtual bool stationary() const; + //- Return the momentum equation + virtual tmp<fvVectorMatrix> UEqn(); - // Momentum + //- Return the momentum equation for the face-based algorithm + virtual tmp<fvVectorMatrix> UfEqn(); - //- Constant access the velocity + //- Return the velocity virtual tmp<volVectorField> U() const; //- Access the velocity - virtual volVectorField& U(); + virtual volVectorField& URef(); + + //- Return the volumetric flux + virtual tmp<surfaceScalarField> phi() const; + + //- Access the volumetric flux + virtual surfaceScalarField& phiRef(); + + //- Return the volumetric flux of the phase + virtual tmp<surfaceScalarField> alphaPhi() const; + + //- Access the volumetric flux of the phase + virtual surfaceScalarField& alphaPhiRef(); + + //- Return the mass flux of the phase + virtual tmp<surfaceScalarField> alphaRhoPhi() const; + + //- Access the mass flux of the phase + virtual surfaceScalarField& alphaRhoPhiRef(); //- Return the substantive acceleration virtual tmp<volVectorField> DUDt() const; + //- Return the substantive acceleration on the faces + virtual tmp<surfaceScalarField> DUDtf() const; + + //- Return the continuity error + virtual tmp<volScalarField> continuityError() const; + + //- Return the continuity error due to the flow field + virtual tmp<volScalarField> continuityErrorFlow() const; + + //- Return the continuity error due to any sources + virtual tmp<volScalarField> continuityErrorSources() const; + + //- Return the phase kinetic energy + virtual tmp<volScalarField> K() const; + + + // Compressibility (variable density) + //- Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) - virtual const tmp<volScalarField>& divU() const; + virtual tmp<volScalarField> divU() const; //- Set the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) - virtual void divU(const tmp<volScalarField>& divU); + virtual void divU(tmp<volScalarField> divU); - //- Constant access the continuity error - virtual tmp<volScalarField> continuityError() const; - //- Constant access the volumetric flux - virtual tmp<surfaceScalarField> phi() const; + // Turbulence - //- Access the volumetric flux - virtual surfaceScalarField& phi(); + //- Return the turbulent dynamic viscosity + virtual tmp<volScalarField> mut() const; - //- Constant access the volumetric flux of the phase - virtual tmp<surfaceScalarField> alphaPhi() const; + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const; - //- Access the volumetric flux of the phase - virtual surfaceScalarField& alphaPhi(); + //- Return the turbulent kinematic viscosity + virtual tmp<volScalarField> nut() const; - //- Constant access the mass flux of the phase - virtual tmp<surfaceScalarField> alphaRhoPhi() const; + //- Return the effective kinematic viscosity + virtual tmp<volScalarField> nuEff() const; - //- Access the mass flux of the phase - virtual surfaceScalarField& alphaRhoPhi(); + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] + using BasePhaseModel::kappaEff; + //- Return the effective thermal conductivity + virtual tmp<volScalarField> kappaEff() const; - // Turbulence + //- Return the effective thermal conductivity on a patch + virtual tmp<scalarField> kappaEff(const label patchi) const; + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + using BasePhaseModel::alphaEff; + + //- Return the effective thermal diffusivity + virtual tmp<volScalarField> alphaEff() const; + + //- Return the effective thermal conductivity on a patch + virtual tmp<scalarField> alphaEff(const label patchi) const; + + //- Return the turbulent kinetic energy + virtual tmp<volScalarField> k() const; - //- Return the turbulence model - virtual const phaseCompressibleTurbulenceModel& turbulence() const; + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H index 2eace6639b91f2e1bcc801409f56aecef05a476c..f816e34a4952fc97625e440ba1c509f16715af1a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H index 67da436c7412bc4925f896e86a3cf3e00c732517..a907f0e2f20400fa64514f6d5ce51a4fe193e81c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C similarity index 72% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C index d2a99b14f7d4d3657433de6816347cf1c82dfeba..567644270874b61959ee4450ab6a5c8e0dee87b1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C @@ -1,11 +1,11 @@ /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,9 +48,9 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::MultiComponentPhaseModel ) : BasePhaseModel(fluid, phaseName, index), - Sc_ + Sct_ ( - "Sc", + "Sct", dimless, fluid.subDict(phaseName) ), @@ -71,6 +71,18 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::MultiComponentPhaseModel { inertIndex_ = this->thermo_->composition().species()[inertSpecie]; } + + PtrList<volScalarField>& Y = this->thermo_->composition().Y(); + + forAll(Y, i) + { + if (i != inertIndex_ && this->thermo_->composition().active(i)) + { + const label j = YActive_.size(); + YActive_.resize(j + 1); + YActive_.set(j, &Y[i]); + } + } } @@ -95,10 +107,10 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel>::correctThermo() this->fluid().mesh() ), this->fluid().mesh(), - dimensionedScalar(dimless, Zero) + dimensionedScalar(dimless) ); - PtrList<volScalarField>& Yi = Y(); + PtrList<volScalarField>& Yi = YRef(); forAll(Yi, i) { @@ -127,50 +139,29 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel>::correctThermo() template<class BasePhaseModel> -Foam::tmp<Foam::fvScalarMatrix> -Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn -( - volScalarField& Yi -) +bool Foam::MultiComponentPhaseModel<BasePhaseModel>::pure() const { - if - ( - (inertIndex_ != -1) - && ( - ( - Yi.name() - == IOobject::groupName - ( - this->thermo_->composition().species()[inertIndex_], - this->name() - ) - ) - || ( - !this->thermo_->composition().active - ( - this->thermo_->composition().species()[Yi.member()] - ) - ) - ) - ) - { - return nullptr; - } + return false; +} + +template<class BasePhaseModel> +Foam::tmp<Foam::fvScalarMatrix> +Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi) +{ const volScalarField& alpha = *this; - const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi(); - const volScalarField& rho = this->rho(); + const surfaceScalarField alphaRhoPhi(this->alphaRhoPhi()); + const volScalarField& rho = this->thermo().rho(); return ( fvm::ddt(alpha, rho, Yi) + fvm::div(alphaRhoPhi, Yi, "div(" + alphaRhoPhi.name() + ",Yi)") - - fvm::Sp(this->continuityError(), Yi) - fvm::laplacian ( fvc::interpolate(alpha) - *fvc::interpolate(this->turbulence().muEff()/Sc_), + *fvc::interpolate(this->muEff()/Sct_), Yi ) == @@ -190,12 +181,36 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::Y() const } +template<class BasePhaseModel> +const Foam::volScalarField& +Foam::MultiComponentPhaseModel<BasePhaseModel>::Y(const word& name) const +{ + return this->thermo_->composition().Y(name); +} + + template<class BasePhaseModel> Foam::PtrList<Foam::volScalarField>& -Foam::MultiComponentPhaseModel<BasePhaseModel>::Y() +Foam::MultiComponentPhaseModel<BasePhaseModel>::YRef() { return this->thermo_->composition().Y(); } +template<class BasePhaseModel> +const Foam::UPtrList<Foam::volScalarField>& +Foam::MultiComponentPhaseModel<BasePhaseModel>::YActive() const +{ + return YActive_; +} + + +template<class BasePhaseModel> +Foam::UPtrList<Foam::volScalarField>& +Foam::MultiComponentPhaseModel<BasePhaseModel>::YActiveRef() +{ + return YActive_; +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H similarity index 71% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H index cfa12bb4ab2730f0fe19f7400292b458bdf59906..d025c9bf87fc7deacf259c2f3476e33d14da2fdf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class MultiComponentPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -58,8 +58,8 @@ protected: // Protected data - //- Schmidt number - dimensionedScalar Sc_; + //- Turbulent Schmidt number + dimensionedScalar Sct_; //- Residual phase fraction dimensionedScalar residualAlpha_; @@ -67,6 +67,9 @@ protected: //- Inert species index label inertIndex_; + //- Pointer list to active species + UPtrList<volScalarField> YActive_; + public: @@ -89,17 +92,28 @@ public: //- Correct the thermodynamics virtual void correctThermo(); - //- Return the species fraction equation - virtual tmp<fvScalarMatrix> YiEqn - ( - volScalarField& Yi - ); + // Species + + //- Return whether the phase is pure (i.e., not multi-component) + virtual bool pure() const; + + //- Return the species fraction equation + virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi); + + //- Return the species mass fractions + virtual const PtrList<volScalarField>& Y() const; + + //- Return a species mass fraction by name + virtual const volScalarField& Y(const word& name) const; + + //- Access the species mass fractions + virtual PtrList<volScalarField>& YRef(); - //- Constant access the species mass fractions - virtual const PtrList<volScalarField>& Y() const; + //- Return the active species mass fractions + virtual const UPtrList<volScalarField>& YActive() const; - //- Access the species mass fractions - virtual PtrList<volScalarField>& Y(); + //- Access the active species mass fractions + virtual UPtrList<volScalarField>& YActiveRef(); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C similarity index 60% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C index 7674db97ec0983f854301234d6c2b2c263127633..2ae638e616a25a6dd5f077b7d2b27a500120a1dc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,15 +51,22 @@ Foam::PurePhaseModel<BasePhaseModel>::~PurePhaseModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class BasePhaseModel> +bool Foam::PurePhaseModel<BasePhaseModel>::pure() const +{ + return true; +} + + template<class BasePhaseModel> Foam::tmp<Foam::fvScalarMatrix> -Foam::PurePhaseModel<BasePhaseModel>::YiEqn -( - volScalarField& Yi -) +Foam::PurePhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi) { - NotImplemented; - return nullptr; + FatalErrorInFunction + << "Cannot construct a species fraction equation for a pure phase" + << exit(FatalError); + + return tmp<fvScalarMatrix>(); } @@ -67,14 +74,54 @@ template<class BasePhaseModel> const Foam::PtrList<Foam::volScalarField>& Foam::PurePhaseModel<BasePhaseModel>::Y() const { + // Y_ has never been set, so we are returning an empty list + return Y_; } +template<class BasePhaseModel> +const Foam::volScalarField& +Foam::PurePhaseModel<BasePhaseModel>::Y(const word& name) const +{ + FatalErrorInFunction + << "Cannot get a species fraction by name from a pure phase" + << exit(FatalError); + + return NullObjectRef<volScalarField>(); +} + + template<class BasePhaseModel> Foam::PtrList<Foam::volScalarField>& -Foam::PurePhaseModel<BasePhaseModel>::Y() +Foam::PurePhaseModel<BasePhaseModel>::YRef() { + FatalErrorInFunction + << "Cannot access the species fractions of for a pure phase" + << exit(FatalError); + + return Y_; +} + + +template<class BasePhaseModel> +const Foam::UPtrList<Foam::volScalarField>& +Foam::PurePhaseModel<BasePhaseModel>::YActive() const +{ + // Y_ has never been set, so we are returning an empty list + + return Y_; +} + + +template<class BasePhaseModel> +Foam::UPtrList<Foam::volScalarField>& +Foam::PurePhaseModel<BasePhaseModel>::YActiveRef() +{ + FatalErrorInFunction + << "Cannot access the species fractions of for a pure phase" + << exit(FatalError); + return Y_; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H index 375e1e26faef699aef09c50af90686c232bbf1eb..6de32dcf041e7aab34069c83ba5102549402c7d5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class PurePhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel> @@ -80,17 +80,28 @@ public: // Member Functions - //- Return the species fraction equation - virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi); + // Species + //- Return whether the phase is pure (i.e., not multi-component) + virtual bool pure() const; - // Thermo + //- Return the species fraction equation + virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi); //- Return the species mass fractions virtual const PtrList<volScalarField>& Y() const; + //- Return a species mass fraction by name + virtual const volScalarField& Y(const word& name) const; + //- Access the species mass fractions - virtual PtrList<volScalarField>& Y(); + virtual PtrList<volScalarField>& YRef(); + + //- Return the active species mass fractions + virtual const UPtrList<volScalarField>& YActive() const; + + //- Access the active species mass fractions + virtual UPtrList<volScalarField>& YActiveRef(); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C index 4de8371cdc973cbbecc2b0750e0498ca1b84e3d9..d5131fb59a21a527ea106536e169c99dd7805c2f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H index 9872c3df6a1f1cf454d62b1cbe8d8416faf264df..6f5d0b119ef9f3d049db46969a02d19b4642c25e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2016 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class ReactingPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel, class ReactionType> @@ -84,10 +84,7 @@ public: virtual void correctThermo(); //- Return the species fraction equation - virtual tmp<fvScalarMatrix> R - ( - volScalarField& Yi - ) const; + virtual tmp<fvScalarMatrix> R(volScalarField& Yi) const; //- Return heat release rate virtual tmp<volScalarField> Qdot() const; diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C new file mode 100644 index 0000000000000000000000000000000000000000..e793988a5bff7664d72b79c12b3142453f086e0a --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C @@ -0,0 +1,367 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "StationaryPhaseModel.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template<class BasePhaseModel> +template<class Type, template<class> class PatchField, class GeoMesh> +Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>> +Foam::StationaryPhaseModel<BasePhaseModel>::zeroField +( + const word& name, + const dimensionSet& dims, + const bool cache +) const +{ + return tmp<GeometricField<Type, PatchField, GeoMesh>> + ( + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + IOobject::groupName(name, this->name()), + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensioned<Type>("zero", dims, pTraits<Type>::zero) + ) + ); +} + + +template<class BasePhaseModel> +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>> +Foam::StationaryPhaseModel<BasePhaseModel>::zeroVolField +( + const word& name, + const dimensionSet& dims, + const bool cache +) const +{ + return zeroField<Type, fvPatchField, volMesh>(name, dims, cache); +} + + +template<class BasePhaseModel> +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>> +Foam::StationaryPhaseModel<BasePhaseModel>::zeroSurfaceField +( + const word& name, + const dimensionSet& dims, + const bool cache +) const +{ + return zeroField<Type, fvsPatchField, surfaceMesh>(name, dims, cache); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasePhaseModel> +Foam::StationaryPhaseModel<BasePhaseModel>::StationaryPhaseModel +( + const phaseSystem& fluid, + const word& phaseName, + const label index +) +: + BasePhaseModel(fluid, phaseName, index) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class BasePhaseModel> +Foam::StationaryPhaseModel<BasePhaseModel>::~StationaryPhaseModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasePhaseModel> +bool Foam::StationaryPhaseModel<BasePhaseModel>::stationary() const +{ + return true; +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::StationaryPhaseModel<BasePhaseModel>::UEqn() +{ + FatalErrorInFunction + << "Cannot construct a momentum equation for a stationary phase" + << exit(FatalError); + + return tmp<fvVectorMatrix>(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::StationaryPhaseModel<BasePhaseModel>::UfEqn() +{ + FatalErrorInFunction + << "Cannot construct a momentum equation for a stationary phase" + << exit(FatalError); + + return tmp<fvVectorMatrix>(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volVectorField> +Foam::StationaryPhaseModel<BasePhaseModel>::U() const +{ + return zeroVolField<vector>("U", dimVelocity, true); +} + + +template<class BasePhaseModel> +Foam::volVectorField& +Foam::StationaryPhaseModel<BasePhaseModel>::URef() +{ + FatalErrorInFunction + << "Cannot access the velocity of a stationary phase" + << exit(FatalError); + + return const_cast<volVectorField&>(volVectorField::null()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::phi() const +{ + return zeroSurfaceField<scalar>("phi", dimVolume/dimTime); +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::StationaryPhaseModel<BasePhaseModel>::phiRef() +{ + FatalErrorInFunction + << "Cannot access the flux of a stationary phase" + << exit(FatalError); + + return const_cast<surfaceScalarField&>(surfaceScalarField::null()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::alphaPhi() const +{ + return zeroSurfaceField<scalar>("alphaPhi", dimVolume/dimTime); +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::StationaryPhaseModel<BasePhaseModel>::alphaPhiRef() +{ + FatalErrorInFunction + << "Cannot access the volumetric flux of a stationary phase" + << exit(FatalError); + + return const_cast<surfaceScalarField&>(surfaceScalarField::null()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::alphaRhoPhi() const +{ + return zeroSurfaceField<scalar>("alphaRhoPhi", dimMass/dimTime); +} + + +template<class BasePhaseModel> +Foam::surfaceScalarField& +Foam::StationaryPhaseModel<BasePhaseModel>::alphaRhoPhiRef() +{ + FatalErrorInFunction + << "Cannot access the mass flux of a stationary phase" + << exit(FatalError); + + return const_cast<surfaceScalarField&>(surfaceScalarField::null()); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volVectorField> +Foam::StationaryPhaseModel<BasePhaseModel>::DUDt() const +{ + return zeroVolField<vector>("DUDt", dimVelocity/dimTime); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::DUDtf() const +{ + return zeroSurfaceField<scalar>("DUDtf", dimVelocity*dimArea/dimTime); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::continuityError() const +{ + return zeroVolField<scalar>("continuityError", dimDensity/dimTime); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::continuityErrorFlow() const +{ + return zeroVolField<scalar>("continuityErrorFlow", dimDensity/dimTime); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::continuityErrorSources() const +{ + return zeroVolField<scalar>("continuityErrorSources", dimDensity/dimTime); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::K() const +{ + return zeroVolField<scalar>("K", sqr(dimVelocity)); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::divU() const +{ + return tmp<volScalarField>(); +} + + +template<class BasePhaseModel> +void Foam::StationaryPhaseModel<BasePhaseModel>::divU +( + tmp<volScalarField> divU +) +{ + FatalErrorInFunction + << "Cannot set the dilatation rate of a stationary phase" + << exit(FatalError); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::mut() const +{ + return zeroVolField<scalar>("continuityError", dimDynamicViscosity); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::muEff() const +{ + return this->thermo().mu(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::nut() const +{ + return zeroVolField<scalar>("continuityError", dimViscosity); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::nuEff() const +{ + return this->thermo().nu(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::kappaEff() const +{ + return this->thermo().kappa(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::scalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::kappaEff(const label patchi) const +{ + return this->thermo().kappa(patchi); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::alphaEff() const +{ + return this->thermo().alpha(); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::scalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::alphaEff(const label patchi) const +{ + return this->thermo().alpha(patchi); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::k() const +{ + return zeroVolField<scalar>("k", sqr(dimVelocity)); +} + + +template<class BasePhaseModel> +Foam::tmp<Foam::volScalarField> +Foam::StationaryPhaseModel<BasePhaseModel>::pPrime() const +{ + return zeroVolField<scalar>("pPrime", dimPressure); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.H new file mode 100644 index 0000000000000000000000000000000000000000..4e259447fc36df14346ae79abda5aff7a01d9180 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.H @@ -0,0 +1,230 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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::StationaryPhaseModel + +Description + Class which represents a stationary (and therefore probably solid) phase. + Generates, but does not store, zero velocity and flux field and turbulent + qauantities. Throws an error when non-const access is requested to the + motion fields or when the momentum equation is requested. Usage must + must protect against such calls. + +See also + MovingPhaseModel + +SourceFiles + StationaryPhaseModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef StationaryPhaseModel_H +#define StationaryPhaseModel_H + +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class StationaryPhaseModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasePhaseModel> +class StationaryPhaseModel +: + public BasePhaseModel +{ +private: + + // Private member functions + + //- Create a zero geometric field + template<class Type, template<class> class PatchField, class GeoMesh> + tmp<GeometricField<Type, PatchField, GeoMesh>> zeroField + ( + const word& name, + const dimensionSet& dims, + const bool cache = false + ) const; + + //- Create a zero vol field + template<class Type> + tmp<GeometricField<Type, fvPatchField, volMesh>> zeroVolField + ( + const word& name, + const dimensionSet& dims, + const bool cache = false + ) const; + + //- Create a zero surface field + template<class Type> + tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> zeroSurfaceField + ( + const word& name, + const dimensionSet& dims, + const bool cache = false + ) const; + + +public: + + // Constructors + + StationaryPhaseModel + ( + const phaseSystem& fluid, + const word& phaseName, + const label index + ); + + + //- Destructor + virtual ~StationaryPhaseModel(); + + + // Member Functions + + // Momentum + + //- Return whether the phase is stationary + virtual bool stationary() const; + + //- Return the momentum equation + virtual tmp<fvVectorMatrix> UEqn(); + + //- Return the momentum equation for the face-based algorithm + virtual tmp<fvVectorMatrix> UfEqn(); + + //- Return the velocity + virtual tmp<volVectorField> U() const; + + //- Access the velocity + virtual volVectorField& URef(); + + //- Return the volumetric flux + virtual tmp<surfaceScalarField> phi() const; + + //- Access the volumetric flux + virtual surfaceScalarField& phiRef(); + + //- Return the volumetric flux of the phase + virtual tmp<surfaceScalarField> alphaPhi() const; + + //- Access the volumetric flux of the phase + virtual surfaceScalarField& alphaPhiRef(); + + //- Return the mass flux of the phase + virtual tmp<surfaceScalarField> alphaRhoPhi() const; + + //- Access the mass flux of the phase + virtual surfaceScalarField& alphaRhoPhiRef(); + + //- Return the substantive acceleration + virtual tmp<volVectorField> DUDt() const; + + //- Return the substantive acceleration on the faces + virtual tmp<surfaceScalarField> DUDtf() const; + + //- Return the continuity error + virtual tmp<volScalarField> continuityError() const; + + //- Return the continuity error due to the flow field + virtual tmp<volScalarField> continuityErrorFlow() const; + + //- Return the continuity error due to any sources + virtual tmp<volScalarField> continuityErrorSources() const; + + //- Return the phase kinetic energy + virtual tmp<volScalarField> K() const; + + + // Compressibility (variable density) + + //- Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) + virtual tmp<volScalarField> divU() const; + + //- Set the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) + virtual void divU(tmp<volScalarField> divU); + + + // Turbulence + + //- Return the turbulent dynamic viscosity + virtual tmp<volScalarField> mut() const; + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const; + + //- Return the turbulent kinematic viscosity + virtual tmp<volScalarField> nut() const; + + //- Return the effective kinematic viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] + using BasePhaseModel::kappaEff; + + //- Return the effective thermal conductivity + virtual tmp<volScalarField> kappaEff() const; + + //- Return the effective thermal conductivity on a patch + virtual tmp<scalarField> kappaEff(const label patchi) const; + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + using BasePhaseModel::alphaEff; + + //- Return the effective thermal diffusivity + virtual tmp<volScalarField> alphaEff() const; + + //- Return the effective thermal conductivity on a patch + virtual tmp<scalarField> alphaEff(const label patchi) const; + + //- Return the turbulent kinetic energy + virtual tmp<volScalarField> k() const; + + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "StationaryPhaseModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C index a82f89470825e9954f2649ccb7dbde1def69e400..e634783b5e64aa64a2c36c3358910a484768f87b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,6 +67,13 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::~ThermoPhaseModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class BasePhaseModel, class ThermoType> +bool Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::compressible() const +{ + return !thermo_().incompressible(); +} + + template<class BasePhaseModel, class ThermoType> const Foam::rhoThermo& Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermo() const @@ -77,7 +84,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermo() const template<class BasePhaseModel, class ThermoType> Foam::rhoThermo& -Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermo() +Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermoRef() { return thermo_(); } @@ -148,6 +155,25 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappa } +template<class BasePhaseModel, class ThermoType> +Foam::tmp<Foam::volScalarField> +Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alphahe() const +{ + return thermo_->alphahe(); +} + + +template<class BasePhaseModel, class ThermoType> +Foam::tmp<Foam::scalarField> +Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alphahe +( + const label patchi +) const +{ + return thermo_->alphahe(patchi); +} + + template<class BasePhaseModel, class ThermoType> Foam::tmp<Foam::volScalarField> Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappaEff diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H similarity index 68% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H index 55ca4462b2b4f7b86fad6084050854364b38ed65..e7f269657a74ce20d2b7a63599c1c037140da160 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,7 +29,7 @@ Class Description Class which represents a phase with a thermodynamic model. Provides access to the thermodynamic variables. Note that the thermo model itself is not - returned as this class could be substituted in the hierarcy for one which + returned as this class could be substituted in the hierarchy for one which mirrors the functionality, but does not include a thermo model; an incompressible phase model, for example. @@ -51,7 +51,7 @@ namespace Foam class rhoThermo; /*---------------------------------------------------------------------------*\ - Class phaseModel Declaration + Class ThermoPhaseModel Declaration \*---------------------------------------------------------------------------*/ template<class BasePhaseModel, class ThermoType> @@ -87,12 +87,14 @@ public: // Thermo - //- Return const access to the thermophysical model + //- Return whether the phase is compressible + virtual bool compressible() const; + + //- Return the thermophysical model virtual const rhoThermo& thermo() const; - //- Return non-const access to the thermophysical model - // for correction - virtual rhoThermo& thermo(); + //- Access the thermophysical model + virtual rhoThermo& thermoRef(); //- Return the density field virtual tmp<volScalarField> rho() const; @@ -103,47 +105,67 @@ public: //- Return the laminar dynamic viscosity virtual tmp<volScalarField> mu() const; - //- Access the laminar dynamic viscosity + //- Return the laminar dynamic viscosity on a patch virtual tmp<scalarField> mu(const label patchi) const; //- Return the laminar kinematic viscosity virtual tmp<volScalarField> nu() const; - //- Access the laminar kinematic viscosity + //- Return the laminar kinematic viscosity on a patch virtual tmp<scalarField> nu(const label patchi) const; - //- Return the laminar thermal conductivity + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual tmp<volScalarField> alpha() const; + + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual tmp<scalarField> alpha(const label patchi) const; + + //- Thermal diffusivity for temperature of mixture [J/m/s/K] virtual tmp<volScalarField> kappa() const; - //- Access the laminar thermal conductivity + //- Thermal diffusivity for temperature of mixture + // for patch [J/m/s/K] virtual tmp<scalarField> kappa(const label patchi) const; - //- Return the laminar thermal conductivity + //- 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; + + + // Turbulence + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] + using BasePhaseModel::kappaEff; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [J/m/s/K] virtual tmp<volScalarField> kappaEff ( const volScalarField& alphat ) const; - //- Access the laminar thermal conductivity + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] virtual tmp<scalarField> kappaEff ( const scalarField& alphat, const label patchi ) const; - //- Return the thermal diffusivity for enthalpy - virtual tmp<volScalarField> alpha() const; - - //- Return the thermal diffusivity for enthalpy on a patch - virtual tmp<scalarField> alpha(const label patchi) const; + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + using BasePhaseModel::alphaEff; - //- Return the thermal diffusivity for enthalpy + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp<volScalarField> alphaEff ( const volScalarField& alphat ) const; - //- Return the thermal diffusivity for enthalpy on a patch + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] virtual tmp<scalarField> alphaEff ( const scalarField& alphat, diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C index a23341b3d94b15813856a377303c9dbeb61347db..1ecd45349b23ebaf7e38ba0d83f2e49dd36cb725 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/newPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,19 +37,20 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New const label index ) { - const word modelType(fluid.subDict(phaseName).get<word>("type")); + word phaseModelType(fluid.subDict(phaseName).lookup("type")); Info<< "Selecting phaseModel for " - << phaseName << ": " << modelType << endl; + << phaseName << ": " << phaseModelType << endl; - auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType); + phaseSystemConstructorTable::iterator cstrIter = + phaseSystemConstructorTablePtr_->find(phaseModelType); - if (!cstrIter.found()) + if (cstrIter == phaseSystemConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown phaseModel type " - << modelType << nl << nl - << "Valid phaseModel types :" << endl + << "Unknown phaseModelType type " + << phaseModelType << endl << endl + << "Valid phaseModel types are : " << endl << phaseSystemConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C similarity index 81% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index 82ec37f05642d61290a50076e6f753102c005d64..9bfb7826e8ee840128be78ba1a6b669b941e887c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,7 +58,7 @@ Foam::phaseModel::phaseModel IOobject::AUTO_WRITE ), fluid.mesh(), - dimensionedScalar(dimless, Zero) + dimensionedScalar("zero", dimless, 0) ), fluid_(fluid), @@ -79,7 +79,7 @@ Foam::phaseModel::phaseModel Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::clone() const { NotImplemented; - return nullptr; + return autoPtr<phaseModel>(nullptr); } @@ -133,6 +133,12 @@ Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const } +const Foam::autoPtr<Foam::diameterModel>& Foam::phaseModel::dPtr() const +{ + return diameterModel_; +} + + void Foam::phaseModel::correct() { diameterModel_->correct(); @@ -161,12 +167,6 @@ bool Foam::phaseModel::read() } -bool Foam::phaseModel::compressible() const -{ - return false; -} - - void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const { surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef(); @@ -185,41 +185,4 @@ void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const } -const Foam::tmp<Foam::volScalarField>& Foam::phaseModel::divU() const -{ - NotImplemented; - static tmp<Foam::volScalarField> divU_(nullptr); - return divU_; -} - - -void Foam::phaseModel::divU(const tmp<volScalarField>& divU) -{ - WarningInFunction - << "Attempt to set the dilatation rate of an incompressible phase" - << endl; -} - - -const Foam::volScalarField& Foam::phaseModel::K() const -{ - NotImplemented; - return volScalarField::null(); -} - - -const Foam::surfaceScalarField& Foam::phaseModel::DbyA() const -{ - return surfaceScalarField::null(); -} - - -void Foam::phaseModel::DbyA(const tmp<surfaceScalarField>& DbyA) -{ - WarningInFunction - << "Attempt to set the dilatation rate of an incompressible phase" - << endl; -} - - // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H similarity index 60% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H index 067eb6a50211dfd22092ae97d1a43bc158eb9f31..359d8ab75e0f16ce99b1733b1c353563ba43aa12 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -182,6 +182,9 @@ public: //- Return the Sauter-mean diameter tmp<volScalarField> d() const; + //- Return const-reference to diameterModel of the phase + const autoPtr<diameterModel>& dPtr() const; + //- Correct the phase properties virtual void correct(); @@ -194,17 +197,11 @@ public: //- Correct the turbulence virtual void correctTurbulence(); - //- Correct the energy transport e.g. alphat + //- Correct the energy transport virtual void correctEnergyTransport(); - //- Return the momentum equation - virtual tmp<fvVectorMatrix> UEqn() = 0; - - //- Return the enthalpy equation - virtual tmp<fvScalarMatrix> heEqn() = 0; - - //- Return the species fraction equation - virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi) = 0; + //- Ensure that the flux at inflow/outflow BCs is preserved + void correctInflowOutflow(surfaceScalarField& alphaPhi) const; //- Read phase properties dictionary virtual bool read(); @@ -213,80 +210,109 @@ public: // Compressibility (variable density) //- Return true if the phase is compressible otherwise false - virtual bool compressible() const; + virtual bool compressible() const = 0; //- Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) - virtual const tmp<volScalarField>& divU() const; + virtual tmp<volScalarField> divU() const = 0; //- Set the phase dilatation rate (d(alpha)/dt + div(alpha*phi)) - virtual void divU(const tmp<volScalarField>& divU); - - //- Return the phase kinetic energy - virtual const volScalarField& K() const; - - - // Implicit phase pressure and dispersion support + virtual void divU(tmp<volScalarField> divU) = 0; - //- Return the phase diffusivity divided by the momentum coefficient - virtual const surfaceScalarField& DbyA() const; - //- Set the phase diffusivity divided by the momentum coefficient - virtual void DbyA(const tmp<surfaceScalarField>& DbyA); + // Thermo + //- Return whether the phase is isothermal + virtual bool isothermal() const = 0; - // Thermo + //- Return the enthalpy equation + virtual tmp<fvScalarMatrix> heEqn() = 0; - //- Return const access to the thermophysical model + //- Return the thermophysical model virtual const rhoThermo& thermo() const = 0; - //- Return non-const access to the thermophysical model - // for correction - virtual rhoThermo& thermo() = 0; + //- Access the thermophysical model + virtual rhoThermo& thermoRef() = 0; //- Return the density field virtual tmp<volScalarField> rho() const = 0; - //- Constant access the species mass fractions + + // Species + + //- Return whether the phase is pure (i.e., not multi-component) + virtual bool pure() const = 0; + + //- Return the species fraction equation + virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi) = 0; + + //- Return the species mass fractions virtual const PtrList<volScalarField>& Y() const = 0; + //- Return a species mass fraction by name + virtual const volScalarField& Y(const word& name) const = 0; + //- Access the species mass fractions - virtual PtrList<volScalarField>& Y() = 0; + virtual PtrList<volScalarField>& YRef() = 0; + + //- Return the active species mass fractions + virtual const UPtrList<volScalarField>& YActive() const = 0; + + //- Access the active species mass fractions + virtual UPtrList<volScalarField>& YActiveRef() = 0; // Momentum - //- Constant access the velocity - virtual tmp<volVectorField> U() const = 0; + //- Return whether the phase is stationary + virtual bool stationary() const = 0; - //- Access the velocity - virtual volVectorField& U() = 0; + //- Return the momentum equation + virtual tmp<fvVectorMatrix> UEqn() = 0; - //- Return the substantive acceleration - virtual tmp<volVectorField> DUDt() const = 0; + //- Return the momentum equation for the face-based algorithm + virtual tmp<fvVectorMatrix> UfEqn() = 0; - //- Constant access the continuity error - virtual tmp<volScalarField> continuityError() const = 0; + //- Return the velocity + virtual tmp<volVectorField> U() const = 0; + + //- Access the velocity + virtual volVectorField& URef() = 0; - //- Constant access the volumetric flux + //- Return the volumetric flux virtual tmp<surfaceScalarField> phi() const = 0; //- Access the volumetric flux - virtual surfaceScalarField& phi() = 0; + virtual surfaceScalarField& phiRef() = 0; - //- Constant access the volumetric flux of the phase + //- Return the volumetric flux of the phase virtual tmp<surfaceScalarField> alphaPhi() const = 0; //- Access the volumetric flux of the phase - virtual surfaceScalarField& alphaPhi() = 0; + virtual surfaceScalarField& alphaPhiRef() = 0; - //- Constant access the mass flux of the phase + //- Return the mass flux of the phase virtual tmp<surfaceScalarField> alphaRhoPhi() const = 0; //- Access the mass flux of the phase - virtual surfaceScalarField& alphaRhoPhi() = 0; + virtual surfaceScalarField& alphaRhoPhiRef() = 0; + + //- Return the substantive acceleration + virtual tmp<volVectorField> DUDt() const = 0; + + //- Return the substantive acceleration on the faces + virtual tmp<surfaceScalarField> DUDtf() const = 0; + + //- Return the continuity error + virtual tmp<volScalarField> continuityError() const = 0; - //- Ensure that the flux at inflow/outflow BCs is preserved - void correctInflowOutflow(surfaceScalarField& alphaPhi) const; + //- Return the continuity error due to the flow field + virtual tmp<volScalarField> continuityErrorFlow() const = 0; + + //- Return the continuity error due to any sources + virtual tmp<volScalarField> continuityErrorSources() const = 0; + + //- Return the phase kinetic energy + virtual tmp<volScalarField> K() const = 0; // Transport @@ -303,38 +329,48 @@ public: //- Return the laminar kinematic viscosity on a patch virtual tmp<scalarField> nu(const label patchi) const = 0; - //- Return the laminar thermal conductivity + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual tmp<volScalarField> alpha() const = 0; + + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual tmp<scalarField> alpha(const label patchi) const = 0; + + //- Thermal diffusivity for temperature of mixture [J/m/s/K] virtual tmp<volScalarField> kappa() const = 0; - //- Return the laminar thermal conductivity on a patch + //- Thermal diffusivity for temperature of mixture + // for patch [J/m/s/K] virtual tmp<scalarField> kappa(const label patchi) const = 0; - //- Return the effective thermal conductivity + //- Thermal diffusivity for energy of mixture [kg/m/s] + virtual tmp<volScalarField> alphahe() const = 0; + + //- Thermal diffusivity for energy of mixture for patch [kg/m/s] + virtual tmp<scalarField> alphahe(const label patchi) const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [J/m/s/K] virtual tmp<volScalarField> kappaEff ( const volScalarField& alphat ) const = 0; - //- Access the effective thermal conductivity + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] virtual tmp<scalarField> kappaEff ( const scalarField& alphat, const label patchi ) const = 0; - //- Return the laminar thermal diffusivity for enthalpy - virtual tmp<volScalarField> alpha() const = 0; - - //- Return the laminar thermal diffusivity for enthalpy on a patch - virtual tmp<scalarField> alpha(const label patchi) const = 0; - - //- Return the effective thermal diffusivity for enthalpy + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp<volScalarField> alphaEff ( const volScalarField& alphat ) const = 0; - //- Return the effective thermal diffusivity for enthalpy on a patch + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] virtual tmp<scalarField> alphaEff ( const scalarField& alphat, @@ -344,9 +380,39 @@ public: // Turbulence - //- Return the turbulence model - virtual const phaseCompressibleTurbulenceModel& - turbulence() const = 0; + //- Return the turbulent dynamic viscosity + virtual tmp<volScalarField> mut() const = 0; + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const = 0; + + //- Return the turbulent kinematic viscosity + virtual tmp<volScalarField> nut() const = 0; + + //- Return the effective kinematic viscosity + virtual tmp<volScalarField> nuEff() const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [J/m/s/K] + virtual tmp<volScalarField> kappaEff() const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [J/m/s/K] + virtual tmp<scalarField> kappaEff(const label patchi) const = 0; + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp<volScalarField> alphaEff() const = 0; + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp<scalarField> alphaEff(const label patchi) const = 0; + + //- Return the turbulent kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const = 0; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C similarity index 69% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C index 4f1427a26faaf49fd1e4d8d5334cd7dbfe76b2fd..afd07f5f7e4de55e76ff343bc7fd981e05c850d5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,6 +41,7 @@ License #include "InertPhaseModel.H" #include "ReactingPhaseModel.H" #include "MovingPhaseModel.H" +#include "StationaryPhaseModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,6 +71,30 @@ namespace Foam purePhaseModel ); + typedef + AnisothermalPhaseModel + < + PurePhaseModel + < + InertPhaseModel + < + StationaryPhaseModel + < + ThermoPhaseModel<phaseModel, rhoThermo> + > + > + > + > + pureStationaryPhaseModel; + + addNamedToRunTimeSelectionTable + ( + phaseModel, + pureStationaryPhaseModel, + phaseSystem, + pureStationaryPhaseModel + ); + typedef IsothermalPhaseModel < @@ -94,6 +119,30 @@ namespace Foam pureIsothermalPhaseModel ); + typedef + IsothermalPhaseModel + < + PurePhaseModel + < + InertPhaseModel + < + StationaryPhaseModel + < + ThermoPhaseModel<phaseModel, rhoThermo> + > + > + > + > + pureStationaryIsothermalPhaseModel; + + addNamedToRunTimeSelectionTable + ( + phaseModel, + pureStationaryIsothermalPhaseModel, + phaseSystem, + pureStationaryIsothermalPhaseModel + ); + typedef AnisothermalPhaseModel < @@ -118,6 +167,30 @@ namespace Foam multiComponentPhaseModel ); + typedef + IsothermalPhaseModel + < + MultiComponentPhaseModel + < + InertPhaseModel + < + MovingPhaseModel + < + ThermoPhaseModel<phaseModel, rhoReactionThermo> + > + > + > + > + multiComponentIsothermalPhaseModel; + + addNamedToRunTimeSelectionTable + ( + phaseModel, + multiComponentIsothermalPhaseModel, + phaseSystem, + multiComponentIsothermalPhaseModel + ); + typedef AnisothermalPhaseModel < diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C index b4f6627452d4d9885abf0f58ed5e189b6ad5f28b..f89f39a2573278fe663d220aed7c4167aa5f4984 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -73,6 +73,16 @@ Foam::word Foam::orderedPhasePair::name() const } +Foam::word Foam::orderedPhasePair::otherName() const +{ + FatalErrorInFunction + << "Requested other name phase from an ordered pair." + << exit(FatalError); + + return word::null; +} + + Foam::tmp<Foam::volScalarField> Foam::orderedPhasePair::E() const { return phase1().fluid().E(*this); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H index 219bf22430ec9189fb85fb331a3f9e547eae235d..1449358758f27d287adec1a3dbbf316da1703817 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,6 +79,9 @@ public: //- Pair name virtual word name() const; + //- Other pair name + virtual word otherName() const; + //- Aspect ratio virtual tmp<volScalarField> E() const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C index 1b67905e2f61beb66d47ce82418c9605ea8e0f8c..acd31af6713b2f790e982ee407e6bc0f4f0eb4a7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,8 +26,8 @@ License \*---------------------------------------------------------------------------*/ #include "phasePair.H" +#include "phaseSystem.H" #include "surfaceTensionModel.H" -#include "gravityMeshObject.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -56,7 +56,7 @@ Foam::phasePair::phasePair phasePairKey(phase1.name(), phase2.name(), ordered), phase1_(phase1), phase2_(phase2), - g_(meshObjects::gravity::New(phase1.db().time())) + g_(phase1.mesh().time().lookupObject<uniformDimensionedVectorField>("g")) {} @@ -96,6 +96,14 @@ Foam::word Foam::phasePair::name() const } +Foam::word Foam::phasePair::otherName() const +{ + word name1(first()); + name1[0] = toupper(name1[0]); + return second() + "And" + name1; +} + + Foam::tmp<Foam::volScalarField> Foam::phasePair::rho() const { return phase1()*phase1().rho() + phase2()*phase2().rho(); @@ -161,13 +169,9 @@ Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH2() const Foam::tmp<Foam::volScalarField> Foam::phasePair::sigma() const { return - phase1().mesh().lookupObject<surfaceTensionModel> + phase1().fluid().lookupSubModel<surfaceTensionModel> ( - IOobject::groupName - ( - surfaceTensionModel::typeName, - phasePair::name() - ) + phasePair(phase1(), phase2()) ).sigma(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H similarity index 64% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H index 3a4e3b4842035df2148b0e38e5b5865cfda37d8b..464a8a69d43af420c9df6d50d8c2a1300bc77d51 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -114,6 +114,9 @@ public: //- Pair name virtual word name() const; + //- Other pair name + virtual word otherName() const; + //- Average density tmp<volScalarField> rho() const; @@ -152,14 +155,85 @@ public: // Access - // Phase 1 + //- Return phase 1 inline const phaseModel& phase1() const; - // Phase 2 + //- Return phase 2 inline const phaseModel& phase2() const; - // Gravitation acceleration + //- Return true if this phasePair contains the given phase + inline bool contains(const phaseModel& phase) const; + + //- Return the other phase relative to the given phase + // Generates a FatalError if this phasePair does not contain + // the given phase + inline const phaseModel& otherPhase(const phaseModel& phase) const; + + //- Return the index of the given phase. Generates a FatalError if + // this phasePair does not contain the given phase + inline label index(const phaseModel& phase) const; + + //- Return gravitation acceleration inline const uniformDimensionedVectorField& g() const; + + + //- STL const_iterator + class const_iterator + { + // Private data + + //- Reference to the pair for which this is an iterator + const phasePair& pair_; + + //- Current index + label index_; + + //- Construct an iterator with the given index + inline const_iterator(const phasePair&, const label index); + + public: + + friend class phasePair; + + // Constructors + + //- Construct from pair, moving to its 'begin' position + inline explicit const_iterator(const phasePair&); + + + // Access + + //- Return the current index + inline label index() const; + + + // Member operators + + inline bool operator==(const const_iterator&) const; + + inline bool operator!=(const const_iterator&) const; + + inline const phaseModel& operator*() const; + inline const phaseModel& operator()() const; + + inline const phaseModel& otherPhase() const; + + inline const_iterator& operator++(); + inline const_iterator operator++(int); + }; + + + //- const_iterator set to the beginning of the pair + inline const_iterator cbegin() const; + + //- const_iterator set to beyond the end of the pair + inline const_iterator cend() const; + + //- const_iterator set to the beginning of the pair + inline const_iterator begin() const; + + //- const_iterator set to beyond the end of the pair + inline const_iterator end() const; }; diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H new file mode 100644 index 0000000000000000000000000000000000000000..e63bcc8e77019fc994f0fc24941912d15db936c4 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePair/phasePairI.H @@ -0,0 +1,216 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2014-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/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::phaseModel& Foam::phasePair::phase1() const +{ + return phase1_; +} + + +inline const Foam::phaseModel& Foam::phasePair::phase2() const +{ + return phase2_; +} + + +inline bool Foam::phasePair::contains(const phaseModel& phase) const +{ + return &phase1_ == &phase || & phase2_ == &phase; +} + + +inline const Foam::phaseModel& Foam::phasePair::otherPhase +( + const phaseModel& phase +) const +{ + if (&phase1_ == &phase) + { + return phase2_; + } + else if (&phase2_ == &phase) + { + return phase1_; + } + else + { + FatalErrorInFunction + << "this phasePair does not contain phase " << phase.name() + << exit(FatalError); + + return phase; + } +} + + +inline Foam::label Foam::phasePair::index(const phaseModel& phase) const +{ + if (&phase1_ == &phase) + { + return 0; + } + else if (&phase2_ == &phase) + { + return 1; + } + else + { + FatalErrorInFunction + << "this phasePair does not contain phase " << phase.name() + << exit(FatalError); + + return -1; + } +} + + +inline const Foam::uniformDimensionedVectorField& Foam::phasePair::g() const +{ + return g_; +} + + +// * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * // + +inline Foam::phasePair::const_iterator::const_iterator +( + const phasePair& pair, + const label index +) +: + pair_(pair), + index_(index) +{} + + +inline Foam::phasePair::const_iterator::const_iterator(const phasePair& pair) +: + const_iterator(pair, 0) +{} + + +inline Foam::label Foam::phasePair::const_iterator::index() const +{ + return index_; +} + + +inline bool Foam::phasePair::const_iterator::operator== +( + const const_iterator& iter +) const +{ + return (this->index_ == iter.index_); +} + + +inline bool Foam::phasePair::const_iterator::operator!= +( + const const_iterator& iter +) const +{ + return !(this->operator==(iter)); +} + + +inline const Foam::phaseModel& +Foam::phasePair::const_iterator::operator*() const +{ + if (index_ == 0) + { + return pair_.phase1_; + } + else + { + return pair_.phase2_; + } +} + + +inline const Foam::phaseModel& +Foam::phasePair::const_iterator::operator()() const +{ + return operator*(); +} + + +inline const Foam::phaseModel& +Foam::phasePair::const_iterator::otherPhase() const +{ + if (index_ == 0) + { + return pair_.phase2_; + } + else + { + return pair_.phase1_; + } +} + + +inline Foam::phasePair::const_iterator& +Foam::phasePair::const_iterator::operator++() +{ + index_++; + return *this; +} + + +inline Foam::phasePair::const_iterator +Foam::phasePair::const_iterator::operator++(int) +{ + const_iterator old = *this; + this->operator++(); + return old; +} + + +inline Foam::phasePair::const_iterator Foam::phasePair::cbegin() const +{ + return const_iterator(*this); +} + + +inline Foam::phasePair::const_iterator Foam::phasePair::cend() const +{ + return const_iterator(*this, 2); +} + + +inline Foam::phasePair::const_iterator Foam::phasePair::begin() const +{ + return const_iterator(*this); +} + + +inline Foam::phasePair::const_iterator Foam::phasePair::end() const +{ + return const_iterator(*this, 2); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C index d1920284bdbe8e67c5243fe3b37b1930056257d7..c86794a6266586e2f8d161c6cb608c07c1ccb138 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,14 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::phasePairKey::hash::hash() +{} + + +Foam::phasePairKey::phasePairKey() +{} + + Foam::phasePairKey::phasePairKey ( const word& name1, @@ -41,6 +49,12 @@ Foam::phasePairKey::phasePairKey {} +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phasePairKey::~phasePairKey() +{} + + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::phasePairKey::ordered() const @@ -65,8 +79,12 @@ Foam::label Foam::phasePairKey::hash::operator() word::hash()(key.second()) ); } - - return word::hash()(key.first()) + word::hash()(key.second()); + else + { + return + word::hash()(key.first()) + + word::hash()(key.second()); + } } @@ -78,13 +96,14 @@ bool Foam::operator== const phasePairKey& b ) { - const auto cmp = Pair<word>::compare(a,b); + const label c = Pair<word>::compare(a, b); return - ( (a.ordered_ == b.ordered_) - && (a.ordered_ ? (cmp == 1) : cmp) - ); + && ( + (a.ordered_ && (c == 1)) + || (!a.ordered_ && (c != 0)) + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H similarity index 74% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H index 734a41d98d9a5b9b5bdaf61157c0fe489ea3cf6c..5a19578d2ecca65a4bf22a005d12adcff2efb95f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,14 +42,15 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward declaration of friend functions and operators + class phasePairKey; -bool operator==(const phasePairKey& a, const phasePairKey& b); -bool operator!=(const phasePairKey& a, const phasePairKey& b); +bool operator==(const phasePairKey&, const phasePairKey&); +bool operator!=(const phasePairKey&, const phasePairKey&); -Istream& operator>>(Istream& is, phasePairKey& key); -Ostream& operator<<(Ostream& os, const phasePairKey& key); +Istream& operator>>(Istream&, phasePairKey&); +Ostream& operator<<(Ostream&, const phasePairKey&); /*---------------------------------------------------------------------------*\ @@ -60,6 +61,29 @@ class phasePairKey : public Pair<word> { +public: + + class hash + : + public Hash<phasePairKey> + { + public: + + // Constructors + + // Construct null + hash(); + + + // Member operators + + // Generate a hash from a phase pair key + label operator()(const phasePairKey& key) const; + }; + + +private: + // Private data //- Flag to indicate whether ordering is important @@ -68,20 +92,12 @@ class phasePairKey public: - //- Ordered or unordered hashing of word pair - struct hash - { - //- Generate a hash from a phase pair key - label operator()(const phasePairKey& key) const; - }; - - // Constructors //- Construct null - phasePairKey() {} // = default + phasePairKey(); - //- Construct from names and optional ordering flag + //- Construct from names and the ordering flag phasePairKey ( const word& name1, @@ -90,8 +106,8 @@ public: ); - //- Destructor - virtual ~phasePairKey() = default; + // Destructor + virtual ~phasePairKey(); // Access @@ -102,16 +118,16 @@ public: // Friend Operators - //- Test for equality + //- Test if keys are equal friend bool operator==(const phasePairKey& a, const phasePairKey& b); - //- Test for inequality + //- Test if keys are unequal friend bool operator!=(const phasePairKey& a, const phasePairKey& b); - //- Read from Istream + //- Read from stdin friend Istream& operator>>(Istream& is, phasePairKey& key); - //- Write to Ostream + //- Write to stdout friend Ostream& operator<<(Ostream& os, const phasePairKey& key); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C similarity index 61% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index 1f44f1befd6605ba28a2281875dad68ed7d35719..8af23398daf8064e99a7f80e30a815cb42c50e3b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C @@ -2,10 +2,10 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,10 @@ License #include "aspectRatioModel.H" #include "surfaceInterpolate.H" #include "fvcDdt.H" +#include "localEulerDdtScheme.H" + +#include "dragModel.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -48,9 +52,9 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::calcPhi const phaseModelList& phaseModels ) const { - tmp<surfaceScalarField> tmpPhi + tmp<surfaceScalarField> tphi ( - new surfaceScalarField + surfaceScalarField::New ( "phi", fvc::interpolate(phaseModels[0])*phaseModels[0].phi() @@ -59,11 +63,11 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::calcPhi for (label phasei=1; phasei<phaseModels.size(); ++phasei) { - tmpPhi.ref() += + tphi.ref() += fvc::interpolate(phaseModels[phasei])*phaseModels[phasei].phi(); } - return tmpPhi; + return tphi; } @@ -151,22 +155,67 @@ Foam::phaseSystem::phaseSystem mesh ), mesh, - dimensionedScalar(dimPressure/dimTime, Zero) + dimensionedScalar("zero", dimPressure/dimTime, 0) ), MRF_(mesh_) { + // Groupings + label movingPhasei = 0; + label stationaryPhasei = 0; + label anisothermalPhasei = 0; + label multiComponentPhasei = 0; + forAll(phaseModels_, phasei) + { + phaseModel& phase = phaseModels_[phasei]; + movingPhasei += !phase.stationary(); + stationaryPhasei += phase.stationary(); + anisothermalPhasei += !phase.isothermal(); + multiComponentPhasei += !phase.pure(); + } + movingPhaseModels_.resize(movingPhasei); + stationaryPhaseModels_.resize(stationaryPhasei); + anisothermalPhaseModels_.resize(anisothermalPhasei); + multiComponentPhaseModels_.resize(multiComponentPhasei); + + movingPhasei = 0; + stationaryPhasei = 0; + anisothermalPhasei = 0; + multiComponentPhasei = 0; + forAll(phaseModels_, phasei) + { + phaseModel& phase = phaseModels_[phasei]; + if (!phase.stationary()) + { + movingPhaseModels_.set(movingPhasei ++, &phase); + } + if (phase.stationary()) + { + stationaryPhaseModels_.set(stationaryPhasei ++, &phase); + } + if (!phase.isothermal()) + { + anisothermalPhaseModels_.set(anisothermalPhasei ++, &phase); + } + if (!phase.pure()) + { + multiComponentPhaseModels_.set(multiComponentPhasei ++, &phase); + } + } + + // Write phi phi_.writeOpt() = IOobject::AUTO_WRITE; // Blending methods - for (const entry& dEntry : subDict("blending")) + forAllConstIter(dictionary, subDict("blending"), iter) { blendingMethods_.insert ( - dEntry.dict().dictName(), + iter().keyword(), blendingMethod::New ( - dEntry.dict(), + iter().keyword(), + iter().dict(), phaseModels_.toc() ) ); @@ -176,6 +225,7 @@ Foam::phaseSystem::phaseSystem generatePairsAndSubModels("surfaceTension", surfaceTensionModels_); generatePairsAndSubModels("aspectRatio", aspectRatioModels_); + // Update motion fields correctKinematics(); } @@ -190,37 +240,58 @@ Foam::phaseSystem::~phaseSystem() Foam::tmp<Foam::volScalarField> Foam::phaseSystem::rho() const { - auto phasei = phaseModels_.cbegin(); + auto phasei = movingPhaseModels_.cbegin(); - tmp<volScalarField> tmpRho - ( - phasei() * phasei().rho() - ); + tmp<volScalarField> trho(phasei()*phasei().rho()); - for (++phasei; phasei != phaseModels_.cend(); ++phasei) + for (++phasei; phasei != movingPhaseModels_.cend(); ++phasei) { - tmpRho.ref() += phasei() * phasei().rho(); + trho.ref() += phasei()*phasei().rho(); } - return tmpRho; + if (stationaryPhaseModels_.empty()) + { + return trho; + } + + phasei = movingPhaseModels_.cbegin(); + + volScalarField alpha(phasei()); + for (++phasei; phasei != movingPhaseModels_.cend(); ++phasei) + { + alpha += phasei(); + } + + return trho/alpha; } Foam::tmp<Foam::volVectorField> Foam::phaseSystem::U() const { - auto phasei = phaseModels_.cbegin(); + auto phasei = movingPhaseModels_.cbegin(); - tmp<volVectorField> tmpU - ( - phasei() * phasei().U() - ); + tmp<volVectorField> tU(phasei()*phasei().U()); - for (++phasei; phasei != phaseModels_.cend(); ++phasei) + for (++phasei; phasei != movingPhaseModels_.cend(); ++phasei) { - tmpU.ref() += phasei() * phasei().U(); + tU.ref() += phasei()*phasei().U(); } - return tmpU; + if (stationaryPhaseModels_.empty()) + { + return tU; + } + + phasei = movingPhaseModels_.cbegin(); + + volScalarField alpha(phasei()); + for (++phasei; phasei != movingPhaseModels_.cend(); ++phasei) + { + alpha += phasei(); + } + + + return tU/alpha; } @@ -231,21 +302,15 @@ Foam::phaseSystem::E(const phasePairKey& key) const { return aspectRatioModels_[key]->E(); } - - return tmp<volScalarField>::New - ( - IOobject + else + { + return volScalarField::New ( aspectRatioModel::typeName + ":E", - this->mesh_.time().timeName(), this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh_, - dimensionedScalar("one", dimless, 1) - ); + dimensionedScalar("one", dimless, 1) + ); + } } @@ -256,24 +321,40 @@ Foam::phaseSystem::sigma(const phasePairKey& key) const { return surfaceTensionModels_[key]->sigma(); } - - return tmp<volScalarField>::New - ( - IOobject + else + { + return volScalarField::New ( surfaceTensionModel::typeName + ":sigma", - this->mesh_.time().timeName(), this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + dimensionedScalar("zero", surfaceTensionModel::dimSigma, 0) + ); + } +} + + +Foam::tmp<Foam::volScalarField> Foam::phaseSystem::dmdt +( + const phasePairKey& key +) const +{ + return volScalarField::New + ( + IOobject::groupName("dmdt", phasePairs_[key]->name()), this->mesh_, - dimensionedScalar(surfaceTensionModel::dimSigma, Zero) + dimensionedScalar("zero", dimDensity/dimTime, 0) ); } +Foam::PtrList<Foam::volScalarField> Foam::phaseSystem::dmdts() const +{ + PtrList<volScalarField> dmdts(this->phaseModels_.size()); + + return dmdts; +} + + void Foam::phaseSystem::solve() {} @@ -353,4 +434,30 @@ bool Foam::phaseSystem::read() } +Foam::tmp<Foam::volScalarField> Foam::byDt(const volScalarField& vf) +{ + if (fv::localEulerDdt::enabled(vf.mesh())) + { + return fv::localEulerDdt::localRDeltaT(vf.mesh())*vf; + } + else + { + return vf/vf.mesh().time().deltaT(); + } +} + + +Foam::tmp<Foam::surfaceScalarField> Foam::byDt(const surfaceScalarField& sf) +{ + if (fv::localEulerDdt::enabled(sf.mesh())) + { + return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf; + } + else + { + return sf/sf.mesh().time().deltaT(); + } +} + + // ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H new file mode 100644 index 0000000000000000000000000000000000000000..4239a08d78007a1f59e68465118d7e973b4748a8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H @@ -0,0 +1,572 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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::phaseSystem + +Description + Class to represent a system of phases and model interfacial transfers + between them. + +SourceFiles + phaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseSystem_H +#define phaseSystem_H + +#include "IOdictionary.H" + +#include "phaseModel.H" +#include "phasePair.H" +#include "orderedPhasePair.H" +#include "HashPtrTable.H" +#include "PtrListDictionary.H" + +#include "IOMRFZoneList.H" +#include "fvOptions.H" + +#include "volFields.H" +#include "surfaceFields.H" +#include "fvMatricesFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class blendingMethod; +template<class modelType> class BlendedInterfacialModel; +class surfaceTensionModel; +class aspectRatioModel; + +/*---------------------------------------------------------------------------*\ + Class phaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +class phaseSystem +: + public IOdictionary +{ +public: + + // Public typedefs + + typedef HashPtrTable<fvVectorMatrix> momentumTransferTable; + + typedef HashPtrTable<fvScalarMatrix> heatTransferTable; + + typedef HashPtrTable<fvScalarMatrix> massTransferTable; + + typedef PtrListDictionary<phaseModel> phaseModelList; + + typedef UPtrList<phaseModel> phaseModelPartialList; + + typedef + HashTable<autoPtr<phasePair>, phasePairKey, phasePairKey::hash> + phasePairTable; + + +protected: + + // Protected typedefs + + typedef + HashTable<dictionary, phasePairKey, phasePairKey::hash> + dictTable; + + typedef + HashTable<autoPtr<blendingMethod>, word, word::hash> + blendingMethodTable; + + typedef + HashTable + < + autoPtr<surfaceTensionModel>, + phasePairKey, + phasePairKey::hash + > + surfaceTensionModelTable; + + typedef + HashTable + < + autoPtr<aspectRatioModel>, + phasePairKey, + phasePairKey::hash + > + aspectRatioModelTable; + + + // Protected data + + //- Reference to the mesh + const fvMesh& mesh_; + + //- Phase models + phaseModelList phaseModels_; + + //- Moving phase models + phaseModelPartialList movingPhaseModels_; + + //- Stationary phase models + phaseModelPartialList stationaryPhaseModels_; + + //- Anisothermal phase models + phaseModelPartialList anisothermalPhaseModels_; + + //- Multi-component phase models + phaseModelPartialList multiComponentPhaseModels_; + + //- Phase pairs + phasePairTable phasePairs_; + + //- Total volumetric flux + surfaceScalarField phi_; + + //- Rate of change of pressure + volScalarField dpdt_; + + //- Optional MRF zones + IOMRFZoneList MRF_; + + //- Blending methods + blendingMethodTable blendingMethods_; + + + // Sub Models + + //- Surface tension models + surfaceTensionModelTable surfaceTensionModels_; + + //- Aspect ratio models + aspectRatioModelTable aspectRatioModels_; + + + // Protected member functions + + //- Calculate and return the mixture flux + tmp<surfaceScalarField> calcPhi + ( + const phaseModelList& phaseModels + ) const; + + //- Generate pairs + void generatePairs + ( + const dictTable& modelDicts + ); + + //- Generate pairs and sub-model tables + template<class modelType> + void createSubModels + ( + const dictTable& modelDicts, + HashTable + < + autoPtr<modelType>, + phasePairKey, + phasePairKey::hash + >& models + ); + + //- Generate pairs and sub-model tables + template<class modelType> + void generatePairsAndSubModels + ( + const word& modelName, + HashTable + < + autoPtr<modelType>, + phasePairKey, + phasePairKey::hash + >& models + ); + + //- Generate pairs and blended sub-model tables + template<class modelType> + void generatePairsAndSubModels + ( + const word& modelName, + HashTable + < + autoPtr<BlendedInterfacialModel<modelType>>, + phasePairKey, + phasePairKey::hash + >& models, + const bool correctFixedFluxBCs = true + ); + + //- Generate pairs and two-sided sub-model tables + template<class modelType> + void generatePairsAndSubModels + ( + const word& modelName, + HashTable + < + Pair<autoPtr<modelType>>, + phasePairKey, + phasePairKey::hash + >& models, + const bool correctFixedFluxBCs = true + ); + + //- Add the field to a phase-indexed list, with the given name, + // constructing if necessary + template<class GeoField> + void addField + ( + const phaseModel& phase, + const word& fieldName, + tmp<GeoField> field, + PtrList<GeoField>& fieldList + ) const; + + //- Add the field to a phase-indexed list, with the given name, + // constructing if necessary + template<class GeoField> + void addField + ( + const phaseModel& phase, + const word& fieldName, + const GeoField& field, + PtrList<GeoField>& fieldList + ) const; + + //- Add the field to a phase-indexed table, with the given name, + // constructing if necessary + template<class GeoField> + void addField + ( + const phaseModel& phase, + const word& fieldName, + tmp<GeoField> field, + HashPtrTable<GeoField>& fieldTable + ) const; + + //- Add the field to a phase-indexed table, with the given name, + // constructing if necessary + template<class GeoField> + void addField + ( + const phaseModel& phase, + const word& fieldName, + const GeoField& field, + HashPtrTable<GeoField>& fieldTable + ) const; + + +public: + + //- Runtime type information + TypeName("phaseSystem"); + + //- Default name of the phase properties dictionary + static const word propertiesName; + + + // Constructors + + //- Construct from fvMesh + phaseSystem(const fvMesh& mesh); + + + //- Destructor + virtual ~phaseSystem(); + + + // Member Functions + + // Access + + //- Return the mesh + inline const fvMesh& mesh() const; + + //- Return the phase models + inline const phaseModelList& phases() const; + + //- Access the phase models + inline phaseModelList& phases(); + + //- Return the models for phases that are moving + inline const phaseModelPartialList& movingPhases() const; + + //- Access the models for phases that are moving + inline phaseModelPartialList& movingPhases(); + + //- Return the models for phases that are stationary + inline const phaseModelPartialList& stationaryPhases() const; + + //- Access the models for phases that are stationary + inline phaseModelPartialList& stationaryPhases(); + + //- Return the models for phases that have variable temperature + inline const phaseModelPartialList& anisothermalPhases() const; + + //- Access the models for phases that have variable temperature + inline phaseModelPartialList& anisothermalPhases(); + + //- Return the models for phases that have multiple species + inline const phaseModelPartialList& multiComponentPhases() const; + + //- Access the models for phases that have multiple species + inline phaseModelPartialList& multiComponentPhases(); + + //- Return the phase pairs + inline const phasePairTable& phasePairs() const; + + //- Return the mixture flux + inline const surfaceScalarField& phi() const; + + //- Access the mixture flux + inline surfaceScalarField& phi(); + + //- Return the rate of change of the pressure + inline const volScalarField& dpdt() const; + + //- Access the rate of change of the pressure + inline volScalarField& dpdt(); + + //- Return MRF zones + inline const IOMRFZoneList& MRF() const; + + //- Access the fvOptions + inline fv::options& fvOptions() const; + + + // Sub-model lookup + + //- Check availability of a sub model for a given phase pair + template<class modelType> + bool foundSubModel(const phasePair& key) const; + + //- Return a sub model between a phase pair + template<class modelType> + const modelType& lookupSubModel(const phasePair& key) const; + + //- Check availability of a sub model between two phases + template<class modelType> + bool foundSubModel + ( + const phaseModel& dispersed, + const phaseModel& continuous + ) const; + + //- Return a sub model between two phases + template<class modelType> + const modelType& lookupSubModel + ( + const phaseModel& dispersed, + const phaseModel& continuous + ) const; + + //- Check availability of a blended sub model for a given phase pair + template<class modelType> + bool foundBlendedSubModel(const phasePair& key) const; + + //- Return a blended sub model between a phase pair + template<class modelType> + const BlendedInterfacialModel<modelType>& + lookupBlendedSubModel(const phasePair& key) const; + + + // Field construction + + //- Fill up gaps in a phase-indexed list of fields with zeros + template + < + class Type, + template<class> class PatchField, + class GeoMesh + > + void fillFields + ( + const word& name, + const dimensionSet& dims, + PtrList<GeometricField<Type, PatchField, GeoMesh>>& fieldList + ) const; + + //- Fill up gaps in a phase-indexed table of fields with zeros + template + < + class Type, + template<class> class PatchField, + class GeoMesh + > + void fillFields + ( + const word& name, + const dimensionSet& dims, + HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& + fieldTable + ) const; + + + // Properties + + //- Return the mixture density + tmp<volScalarField> rho() const; + + //- Return the mixture velocity + tmp<volVectorField> U() const; + + //- Return the aspect-ratio for a pair + tmp<volScalarField> E(const phasePairKey& key) const; + + //- Return the surface tension coefficient for a pair + tmp<volScalarField> sigma(const phasePairKey& key) const; + + //- Return the mass transfer rate for a pair + virtual tmp<volScalarField> dmdt(const phasePairKey& key) const; + + //- Return the mass transfer rates for each phase + virtual PtrList<volScalarField> dmdts() const; + + + // Transfers + + //- Return the momentum transfer matrices for the cell-based + // algorithm + virtual autoPtr<momentumTransferTable> momentumTransfer() = 0; + + //- Return the momentum transfer matrices for the face-based + // algorithm + virtual autoPtr<momentumTransferTable> momentumTransferf() = 0; + + //- Return the implicit force coefficients for the face-based + // algorithm + virtual PtrList<surfaceScalarField> AFfs() const = 0; + + //- Return the force fluxes for the cell-based algorithm + virtual PtrList<surfaceScalarField> phiFs + ( + const PtrList<volScalarField>& rAUs + ) = 0; + + //- Return the force fluxes for the face-based algorithm + virtual PtrList<surfaceScalarField> phiFfs + ( + const PtrList<surfaceScalarField>& rAUfs + ) = 0; + + //- Return the force fluxes for the cell-based algorithm + virtual PtrList<surfaceScalarField> phiKdPhis + ( + const PtrList<volScalarField>& rAUs + ) const = 0; + + //- Return the force fluxes for the face-based algorithm + virtual PtrList<surfaceScalarField> phiKdPhifs + ( + const PtrList<surfaceScalarField>& rAUfs + ) const = 0; + + //- Return the explicit part of the drag force + virtual PtrList<volVectorField> KdUByAs + ( + const PtrList<volScalarField>& rAUs + ) const = 0; + + //- Solve the drag system for the new velocities and fluxes + virtual void partialElimination + ( + const PtrList<volScalarField>& rAUs + ) = 0; + + //- Solve the drag system for the new fluxes + virtual void partialEliminationf + ( + const PtrList<surfaceScalarField>& rAUfs + ) = 0; + + //- Return the flux corrections for the cell-based algorithm + virtual PtrList<surfaceScalarField> ddtCorrByAs + ( + const PtrList<volScalarField>& rAUs, + const bool includeVirtualMass = false + ) const = 0; + + //- Return the phase diffusivities divided by the momentum + // coefficients + virtual const HashPtrTable<surfaceScalarField>& DByAfs() const = 0; + + //- Return the heat transfer matrices + virtual autoPtr<heatTransferTable> heatTransfer() const = 0; + + //- Return the mass transfer matrices + virtual autoPtr<massTransferTable> massTransfer() const = 0; + + + // Evolution + + //- Solve for the phase fractions + virtual void solve(); + + //- Correct the fluid properties other than those listed below + virtual void correct(); + + //- Correct the kinematics + virtual void correctKinematics(); + + //- Correct the thermodynamics + virtual void correctThermo(); + + //- Correct the turbulence + virtual void correctTurbulence(); + + //- Correct the energy transport e.g. alphat + virtual void correctEnergyTransport(); + + + // IO + + //- Read base phaseProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +tmp<volScalarField> byDt(const volScalarField& vf); +tmp<surfaceScalarField> byDt(const surfaceScalarField& sf); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "phaseSystemI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "phaseSystemTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H similarity index 66% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H index 0bbfabda861950cfeecd7c5d7e2c37a3275e3560..99ef134e2b6c685c45e6216cee5bad1312a3b11b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,6 +47,62 @@ Foam::phaseSystem::phases() } +inline const Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::movingPhases() const +{ + return movingPhaseModels_; +} + + +inline Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::movingPhases() +{ + return movingPhaseModels_; +} + + +inline const Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::stationaryPhases() const +{ + return stationaryPhaseModels_; +} + + +inline Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::stationaryPhases() +{ + return stationaryPhaseModels_; +} + + +inline const Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::anisothermalPhases() const +{ + return anisothermalPhaseModels_; +} + + +inline Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::anisothermalPhases() +{ + return anisothermalPhaseModels_; +} + + +inline const Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::multiComponentPhases() const +{ + return multiComponentPhaseModels_; +} + + +inline Foam::phaseSystem::phaseModelPartialList& +Foam::phaseSystem::multiComponentPhases() +{ + return multiComponentPhaseModels_; +} + + inline const Foam::phaseSystem::phasePairTable& Foam::phaseSystem::phasePairs() const { diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..51803447d2856e70ef2b9419150ab047c57b8ba0 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C @@ -0,0 +1,517 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2015-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 "BlendedInterfacialModel.H" + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class modelType> +void Foam::phaseSystem::createSubModels +( + const dictTable& modelDicts, + HashTable + < + autoPtr<modelType>, + phasePairKey, + phasePairKey::hash + >& models +) +{ + forAllConstIter(dictTable, modelDicts, iter) + { + const phasePairKey& key = iter.key(); + + models.insert + ( + key, + modelType::New + ( + *iter, + phasePairs_[key] + ) + ); + } +} + + +template<class modelType> +void Foam::phaseSystem::generatePairsAndSubModels +( + const word& modelName, + HashTable + < + autoPtr<modelType>, + phasePairKey, + phasePairKey::hash + >& models +) +{ + dictTable modelDicts(lookup(modelName)); + + generatePairs(modelDicts); + + createSubModels(modelDicts, models); +} + + +template<class modelType> +void Foam::phaseSystem::generatePairsAndSubModels +( + const word& modelName, + HashTable + < + autoPtr<BlendedInterfacialModel<modelType>>, + phasePairKey, + phasePairKey::hash + >& models, + const bool correctFixedFluxBCs +) +{ + typedef + HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash> + modelTypeTable; + + modelTypeTable tempModels; + generatePairsAndSubModels(modelName, tempModels); + + const blendingMethod& blending + ( + blendingMethods_.found(modelName) + ? blendingMethods_[modelName] + : blendingMethods_.found(member(modelName)) + ? blendingMethods_[member(modelName)] + : blendingMethods_["default"] + ); + + autoPtr<modelType> noModel(nullptr); + + forAllConstIter(typename modelTypeTable, tempModels, iter) + { + if (!iter().valid()) + { + continue; + } + + const phasePairKey key(iter.key().first(), iter.key().second()); + const phasePairKey key1In2(key.first(), key.second(), true); + const phasePairKey key2In1(key.second(), key.first(), true); + + models.insert + ( + key, + autoPtr<BlendedInterfacialModel<modelType>> + ( + new BlendedInterfacialModel<modelType> + ( + phaseModels_[key.first()], + phaseModels_[key.second()], + blending, + tempModels.found(key ) ? tempModels[key ] : noModel, + tempModels.found(key1In2) ? tempModels[key1In2] : noModel, + tempModels.found(key2In1) ? tempModels[key2In1] : noModel, + correctFixedFluxBCs + ) + ) + ); + + if (!phasePairs_.found(key)) + { + phasePairs_.insert + ( + key, + autoPtr<phasePair> + ( + new phasePair + ( + phaseModels_[key.first()], + phaseModels_[key.second()] + ) + ) + ); + } + } +} + + +template<class modelType> +void Foam::phaseSystem::generatePairsAndSubModels +( + const word& modelName, + HashTable + < + Pair<autoPtr<modelType>>, + phasePairKey, + phasePairKey::hash + >& models, + const bool correctFixedFluxBCs +) +{ + typedef + HashTable<autoPtr<modelType>, phasePairKey, phasePairKey::hash> + modelTypeTable; + + forAll(phaseModels_, phasei) + { + const phaseModel& phase = phaseModels_[phasei]; + + modelTypeTable tempModels; + generatePairsAndSubModels + ( + IOobject::groupName(modelName, phase.name()), + tempModels, + correctFixedFluxBCs + ); + + forAllIter(typename modelTypeTable, tempModels, tempModelIter) + { + const phasePairKey& key(tempModelIter.key()); + + if (!models.found(key)) + { + models.insert + ( + key, + Pair<autoPtr<modelType>>() + ); + } + + const phasePair& pair = phasePairs_[key]; + + if (!pair.contains(phase)) + { + FatalErrorInFunction + << "A two-sided " << modelType::typeName << " was " + << "specified for the " << phase.name() << " side of the " + << pair << " pair, but that phase is not part of that pair." + << exit(FatalError); + } + + models[key][pair.index(phase)].set(tempModelIter().ptr()); + } + } +} + + +template<class GeoField> +void Foam::phaseSystem::addField +( + const phaseModel& phase, + const word& fieldName, + tmp<GeoField> field, + PtrList<GeoField>& fieldList +) const +{ + if (fieldList.set(phase.index())) + { + fieldList[phase.index()] += field; + } + else + { + fieldList.set + ( + phase.index(), + new GeoField + ( + IOobject::groupName(fieldName, phase.name()), + field + ) + ); + } +} + + +template<class GeoField> +void Foam::phaseSystem::addField +( + const phaseModel& phase, + const word& fieldName, + const GeoField& field, + PtrList<GeoField>& fieldList +) const +{ + addField(phase, fieldName, tmp<GeoField>(field), fieldList); +} + + +template<class GeoField> +void Foam::phaseSystem::addField +( + const phaseModel& phase, + const word& fieldName, + tmp<GeoField> field, + HashPtrTable<GeoField>& fieldTable +) const +{ + if (fieldTable.found(phase.name())) + { + *fieldTable[phase.name()] += field; + } + else + { + fieldTable.set + ( + phase.name(), + new GeoField + ( + IOobject::groupName(fieldName, phase.name()), + field + ) + ); + } +} + + +template<class GeoField> +void Foam::phaseSystem::addField +( + const phaseModel& phase, + const word& fieldName, + const GeoField& field, + HashPtrTable<GeoField>& fieldTable +) const +{ + addField(phase, fieldName, tmp<GeoField>(field), fieldTable); +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class Type, template<class> class PatchField, class GeoMesh> +void Foam::phaseSystem::fillFields +( + const word& name, + const dimensionSet& dims, + PtrList<GeometricField<Type, PatchField, GeoMesh>>& fieldList +) const +{ + forAll(this->phaseModels_, phasei) + { + if (fieldList.set(phasei)) + { + continue; + } + + const phaseModel& phase = this->phaseModels_[phasei]; + + fieldList.set + ( + phasei, + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + IOobject::groupName(name, phase.name()), + this->mesh_.time().timeName(), + this->mesh_ + ), + this->mesh_, + dimensioned<Type>("zero", dims, pTraits<Type>::zero) + ) + ); + } +} + + +template<class Type, template<class> class PatchField, class GeoMesh> +void Foam::phaseSystem::fillFields +( + const word& name, + const dimensionSet& dims, + HashPtrTable<GeometricField<Type, PatchField, GeoMesh>>& fieldTable +) const +{ + forAll(this->phaseModels_, phasei) + { + const phaseModel& phase = this->phaseModels_[phasei]; + + if (fieldTable.set(phase.name())) + { + continue; + } + + fieldTable.set + ( + phase.name(), + new GeometricField<Type, PatchField, GeoMesh> + ( + IOobject + ( + IOobject::groupName(name, phase.name()), + this->mesh_.time().timeName(), + this->mesh_ + ), + this->mesh_, + dimensioned<Type>("zero", dims, pTraits<Type>::zero) + ) + ); + } +} + + +template<class modelType> +bool Foam::phaseSystem::foundSubModel(const phasePair& key) const +{ + const word name(IOobject::groupName(modelType::typeName, key.name())); + + if (key.ordered()) + { + if (mesh().foundObject<modelType>(name)) + { + return true; + } + else + { + return false; + } + } + else + { + if + ( + mesh().foundObject<modelType>(name) + || + mesh().foundObject<modelType> + ( + IOobject::groupName(modelType::typeName, key.otherName()) + ) + ) + { + return true; + } + else + { + return false; + } + } +} + + +template<class modelType> +const modelType& Foam::phaseSystem::lookupSubModel(const phasePair& key) const +{ + const word name(IOobject::groupName(modelType::typeName, key.name())); + + if (key.ordered() || mesh().foundObject<modelType>(name)) + { + return mesh().lookupObject<modelType>(name); + } + else + { + return + mesh().lookupObject<modelType> + ( + IOobject::groupName(modelType::typeName, key.otherName()) + ); + } +} + + +template<class modelType> +bool Foam::phaseSystem::foundSubModel +( + const phaseModel& dispersed, + const phaseModel& continuous +) const +{ + return foundSubModel<modelType>(orderedPhasePair(dispersed, continuous)); +} + + +template<class modelType> +const modelType& Foam::phaseSystem::lookupSubModel +( + const phaseModel& dispersed, + const phaseModel& continuous +) const +{ + return lookupSubModel<modelType>(orderedPhasePair(dispersed, continuous)); +} + + +template<class modelType> +bool Foam::phaseSystem::foundBlendedSubModel(const phasePair& key) const +{ + if + ( + mesh().foundObject<BlendedInterfacialModel<modelType>> + ( + IOobject::groupName + ( + BlendedInterfacialModel<modelType>::typeName, + key.name() + ) + ) + || mesh().foundObject<BlendedInterfacialModel<modelType>> + ( + IOobject::groupName + ( + BlendedInterfacialModel<modelType>::typeName, + key.otherName() + ) + ) + ) + { + return true; + } + else + { + return false; + } +} + + +template<class modelType> +const Foam::BlendedInterfacialModel<modelType>& +Foam::phaseSystem::lookupBlendedSubModel(const phasePair& key) const +{ + const word name + ( + IOobject::groupName + ( + BlendedInterfacialModel<modelType>::typeName, + key.name() + ) + ); + + if (mesh().foundObject<BlendedInterfacialModel<modelType>>(name)) + { + return mesh().lookupObject<BlendedInterfacialModel<modelType>>(name); + } + else + { + return + mesh().lookupObject<BlendedInterfacialModel<modelType>> + ( + IOobject::groupName + ( + BlendedInterfacialModel<modelType>::typeName, + key.otherName() + ) + ); + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.C new file mode 100644 index 0000000000000000000000000000000000000000..cec218917796baa2bdec34cd160add0e86773c67 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 "LehrMilliesMewes.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseCompressibleTurbulenceModel.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + defineTypeNameAndDebug(LehrMilliesMewes, 0); + addToRunTimeSelectionTable + ( + binaryBreakupModel, + LehrMilliesMewes, + dictionary + ); +} +} +} + +using Foam::constant::mathematical::pi; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::binaryBreakupModels::LehrMilliesMewes::LehrMilliesMewes +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + binaryBreakupModel(popBal, dict) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::binaryBreakupModels::LehrMilliesMewes:: +addToBinaryBreakupRate +( + volScalarField& binaryBreakupRate, + const label i, + const label j +) +{ + const phaseModel& continuousPhase = popBal_.continuousPhase(); + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + volScalarField L + ( + pow + ( + popBal_.sigmaWithContinuousPhase(fj.phase())/continuousPhase.rho(), + 3.0/5.0 + ) + /pow(popBal_.continuousTurbulence().epsilon(), 2.0/5.0) + ); + + // Reset of dimension to pure length to avoid problems in transcendental + // functions due to small exponents + L.dimensions().reset(dimLength); + + const volScalarField T + ( + pow + ( + popBal_.sigmaWithContinuousPhase(fj.phase())/continuousPhase.rho(), + 2.0/5.0 + ) + /pow(popBal_.continuousTurbulence().epsilon(), 3.0/5.0) + ); + + binaryBreakupRate += + 0.5*pow(fj.d()/L, 5.0/3.0) + *exp(-sqrt(2.0)/pow3(fj.d()/L)) + *6.0/pow(pi, 1.5)/pow3(fi.d()/L) + *exp(-9.0/4.0*sqr(log(pow(2.0, 0.4)*fi.d()/L))) + /max(1.0 + erf(1.5*log(pow(2.0, 1.0/15.0)*fj.d()/L)), SMALL) + /(T*pow3(L)); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.H new file mode 100644 index 0000000000000000000000000000000000000000..2651ff25ae118cf6548d0b9e2a6b250c48fbeaab --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LehrMilliesMewes/LehrMilliesMewes.H @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::diameterModels::binaryBreakupModels::LehrMilliesMewes + +Description + Model of Lehr et al. (2002). The breakup rate is calculated by + + \f[ + 0.5 d_j^{*^{5/3}} \mathrm{exp}\left(-\frac{\sqrt{2}}{d_j^{*^{3}}}\right) + \frac{6}{\pi^{3/2}d_i^{*^{3}}} + \mathrm{exp} + \left( + - \frac{9}{4}\left[\mathrm{ln}\left(2^{2/5} d_i^{*}\right)\right]^{2} + \right) + \left( + 1 + + \mathrm{erf} + \left[ + \frac{3}{2}\mathrm{ln} \left(2^{1/15} d_j^{*}\right) + \right] + \right)^{-1} + \frac{1}{L^{3}T} + \f] + + with the time scale + + \f[ + T = \left(\frac{\sigma}{\rho_c}\right)^{2/5} \frac{1}{\epsilon_c^{3/5}} + \f] + + the dimensionless diameter + + \f[ + d^{*} = \frac{d}{L} + \f] + + and the length scale + + \f[ + L = \left(\frac{\sigma}{\rho_c}\right)^{3/5} \frac{1}{\epsilon_c^{2/5}} + \f] + + \vartable + \rho_c | Density of continuous phase [kg/m3] + \sigma | Surface tension [N/m] + \epsilon_c | Continuous phase turbulent dissipation rate [m2/s3] + d_i | Diameter of daughter bubble i [m] + d_j | Diameter of mother bubble j [m] + \endvartable + + References: + \verbatim + Lehr, F., Millies, M., & Mewes, D. (2002). + Bubbleâ€size distributions and flow fields in bubble columns. + AIChE Journal, 48(11), 2426-2443. + Eq. 12-16, p. 2429-2430. + \endverbatim + +SourceFiles + LehrMilliesMewes.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LehrMilliesMewes_H +#define LehrMilliesMewes_H + +#include "binaryBreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class LehrMilliesMewes Declaration +\*---------------------------------------------------------------------------*/ + +class LehrMilliesMewes +: + public binaryBreakupModel +{ +public: + + //- Runtime type information + TypeName("LehrMilliesMewes"); + + // Constructor + + LehrMilliesMewes + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~LehrMilliesMewes() + {} + + + // Member Functions + + //- Add to binary breakupRate + virtual void addToBinaryBreakupRate + ( + volScalarField& binaryBreakupRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace binaryBreakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.C new file mode 100644 index 0000000000000000000000000000000000000000..c21c718ecab8c4ae37ea6f3c806db0793f124925 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.C @@ -0,0 +1,220 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 "LuoSvendsen.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseCompressibleTurbulenceModel.H" +#include "tableBounds.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + defineTypeNameAndDebug(LuoSvendsen, 0); + addToRunTimeSelectionTable + ( + binaryBreakupModel, + LuoSvendsen, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::binaryBreakupModels::LuoSvendsen::LuoSvendsen +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + binaryBreakupModel(popBal, dict), + gammaUpperReg2by11_(), + gammaUpperReg5by11_(), + gammaUpperReg8by11_(), + C4_(dimensionedScalar::lookupOrDefault("C4", dict, dimless, 0.923)), + beta_(dimensionedScalar::lookupOrDefault("beta", dict, dimless, 2.05)), + minEddyRatio_ + ( + dimensionedScalar::lookupOrDefault("minEddyRatio", dict, dimless, 11.4) + ), + kolmogorovLengthScale_ + ( + IOobject + ( + "kolmogorovLengthScale", + popBal_.time().timeName(), + popBal_.mesh() + ), + popBal_.mesh(), + dimensionedScalar + ( + "kolmogorovLengthScale", + dimLength, + Zero + ) + ) +{ + List<Tuple2<scalar, scalar>> gammaUpperReg2by11Table; + List<Tuple2<scalar, scalar>> gammaUpperReg5by11Table; + List<Tuple2<scalar, scalar>> gammaUpperReg8by11Table; + + gammaUpperReg2by11Table.append(Tuple2<scalar, scalar>(0.0, 1.0)); + gammaUpperReg5by11Table.append(Tuple2<scalar, scalar>(0.0, 1.0)); + gammaUpperReg8by11Table.append(Tuple2<scalar, scalar>(0.0, 1.0)); + + for (scalar z = 1e-2; z <= 10.0; z = z + 1e-2) + { + Tuple2<scalar, scalar> gamma2by11 + ( + z, + incGammaRatio_Q(2.0/11.0, z) + ); + + Tuple2<scalar, scalar> gamma5by11 + ( + z, + incGammaRatio_Q(5.0/11.0, z) + ); + + Tuple2<scalar, scalar> gamma8by11 + ( + z, + incGammaRatio_Q(8.0/11.0, z) + ); + + gammaUpperReg2by11Table.append(gamma2by11); + gammaUpperReg5by11Table.append(gamma5by11); + gammaUpperReg8by11Table.append(gamma8by11); + } + + gammaUpperReg2by11_.reset + ( + new interpolationTable<scalar> + ( + gammaUpperReg2by11Table, + bounds::repeatableBounding::CLAMP, + "gamma2by11" + ) + ); + + gammaUpperReg5by11_.reset + ( + new interpolationTable<scalar> + ( + gammaUpperReg5by11Table, + bounds::repeatableBounding::CLAMP, + "gamma5by11" + ) + ); + + gammaUpperReg8by11_.reset + ( + new interpolationTable<scalar> + ( + gammaUpperReg8by11Table, + bounds::repeatableBounding::CLAMP, + "gamma8by11" + ) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::binaryBreakupModels::LuoSvendsen::correct() +{ + kolmogorovLengthScale_ = + pow025 + ( + pow3 + ( + popBal_.continuousPhase().nu() + ) + /popBal_.continuousTurbulence().epsilon() + ); +} + + +void +Foam::diameterModels::binaryBreakupModels::LuoSvendsen::addToBinaryBreakupRate +( + volScalarField& binaryBreakupRate, + const label i, + const label j +) +{ + const phaseModel& continuousPhase = popBal_.continuousPhase(); + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + const dimensionedScalar cf + ( + pow(fi.x()/fj.x(), 2.0/3.0) + pow((1 - fi.x()/fj.x()), 2.0/3.0) - 1 + ); + + const volScalarField b + ( + 12.0*cf*popBal_.sigmaWithContinuousPhase(fi.phase()) + /( + beta_*continuousPhase.rho()*pow(fj.d(), 5.0/3.0) + *pow(popBal_.continuousTurbulence().epsilon(), 2.0/3.0) + ) + ); + + const volScalarField xiMin(minEddyRatio_*kolmogorovLengthScale_/fj.d()); + + const volScalarField tMin(b/pow(xiMin, 11.0/3.0)); + + volScalarField integral(3.0/(11.0*pow(b, 8.0/11.0))); + + forAll(integral, celli) + { + integral[celli] *= + 2.0*pow(b[celli], 3.0/11.0)*tgamma(5.0/11.0) + *( + gammaUpperReg5by11_()(b[celli]) + - gammaUpperReg5by11_()(tMin[celli]) + ); + } + + binaryBreakupRate += + C4_*(1 - popBal_.alphas())/fj.x() + *cbrt + ( + popBal_.continuousTurbulence().epsilon() + /sqr(fj.d()) + ) + *integral; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.H new file mode 100644 index 0000000000000000000000000000000000000000..05438ca0f6b20c49cd069644e81ca7520f0e8368 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/LuoSvendsen/LuoSvendsen.H @@ -0,0 +1,228 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::diameterModels::binaryBreakupModels::LuoSvendsen + +Description + Model of Luo and Svendsen (1996). The breakup rate is calculated by + + \f[ + C_4 \alpha_c \left(\frac{\epsilon_c}{d_j^2}\right)^{1/3} + \int\limits_{\xi_{min}}^{1} + \frac{\left(1 + \xi\right)^{2}}{\xi^{11/3}} + \mathrm{exp} + \left( + - \frac{12c_f\sigma}{\beta\rho_c\epsilon_c^{2/3}d_j^{5/3}\xi^{11/3}} + \right) + \mathrm{d} \xi + \f] + + where + + \f[ + c_f = \left(\frac{v_i}{v_j}\right)^{2/3} + + \left(1 - \frac{v_i}{v_j}\right)^{2/3} - 1 + \f] + + \f[ + \xi_{min} = \frac{\lambda_{min}}{d_j}\,, + \f] + + and + + \f[ + \lambda_{min} = C_5 \eta\,. + \f] + + The integral in the first expression is solved by means of incomplete Gamma + functions as given by Bannari et al. (2008): + + \f[ + \frac{3}{11 b^{8/11}} + \left( + \left[\Gamma(8/11, b) - \Gamma(8/11, t_{m})\right] + + 2b^{3/11} \left[\Gamma(5/11, b) - \Gamma(5/11, t_{m})\right] + + b^{6/11} \left[\Gamma(2/11, b) - \Gamma(2/11, t_{m})\right] + \right) + \f] + + where + + \f[ + b = \frac{12c_f\sigma}{\beta\rho_c\epsilon_c^{2/3}d_j^{5/3}} + \f] + + and + + \f[ + t_{min} = b \xi_{min}^{-11/3}\,. + \f] + + Note that in the code, the upper incomplete gamma function is expressed as + + \f[ + \Gamma(a,z) = Q(a,z) \Gamma(a) + \f] + + \vartable + \alpha_c | Void fraction of continuous phase [-] + \epsilon_c | Turbulent dissipation rate of continuous phase [m2/s3] + d_j | Diameter of mother bubble j [m3] + v_i | Volume of daughter bubble i [m3] + v_j | Volume of mother bubble j [m3] + \xi | Integration variable [-] + \xi_{min} | Lower bound of integral [-] + c_f | Increase coefficient of surface area [-] + \sigma | Surface tension [N/m] + \rho_c | Density of continous phase [kg/m3] + \eta | Kolmogorov length scale [m] + \Gamma(a,z) | Upper incomplete gamma function + Q(a,z) | Regularized upper incomplete gamma function + \Gamma(a) | Gamma function + \endvartable + + References: + \verbatim + Luo, H., & Svendsen, H. F. (1996). + Theoretical model for drop and bubble breakup in turbulent dispersions. + AIChE Journal, 42(5), 1225-1233. + Eq. 27, p. 1229. + \endverbatim + + \verbatim + Bannari, R., Kerdouss, F., Selma, B., Bannari, A., & Proulx, P. (2008). + Three-dimensional mathematical modeling of dispersed two-phase flow + using class method of population balance in bubble columns. + Computers & chemical engineering, 32(12), 3224-3237. + Eq. 49, p. 3230. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + C4 | Coefficient C4 | no | 0.923 + beta | Coefficient beta | no | 2.05 + C5 | Minimum eddy ratio | no | 11.4 + \endtable + +SourceFiles + LuoSvendsen.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LuoSvendsen_H +#define LuoSvendsen_H + +#include "binaryBreakupModel.H" +#include "interpolationTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class LuoSvendsen Declaration +\*---------------------------------------------------------------------------*/ + +class LuoSvendsen +: + public binaryBreakupModel +{ +private: + + // Private data + + //- Interpolation table of Q(a,z) for a=2/11 + autoPtr<interpolationTable<scalar>> gammaUpperReg2by11_; + + //- Interpolation table of Q(a,z) for a=5/11 + autoPtr<interpolationTable<scalar>> gammaUpperReg5by11_; + + //- Interpolation table of Q(a,z) for a=8/11 + autoPtr<interpolationTable<scalar>> gammaUpperReg8by11_; + + //- Empirical constant, defaults to 0.923 + dimensionedScalar C4_; + + //- Empirical constant, defaults to 2.05 + dimensionedScalar beta_; + + //- Ratio between minimum size of eddies in the inertial subrange + // and Kolmogorov length scale, defaults to 11.4 + dimensionedScalar minEddyRatio_; + + //- Kolmogorov length scale + volScalarField kolmogorovLengthScale_; + + +public: + + //- Runtime type information + TypeName("LuoSvendsen"); + + // Constructor + + LuoSvendsen + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~LuoSvendsen() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to binary breakupRate + virtual void addToBinaryBreakupRate + ( + volScalarField& binaryBreakupRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace binaryBreakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C new file mode 100644 index 0000000000000000000000000000000000000000..8e7c06bda396f4bc6b19e32de3b3265a0c963ff9 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.C @@ -0,0 +1,85 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "binaryBreakupModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(binaryBreakupModel, 0); + defineRunTimeSelectionTable(binaryBreakupModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::binaryBreakupModel> +Foam::diameterModels::binaryBreakupModel::New +( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict +) +{ + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown binary breakup model type " + << type << nl << nl + << "Valid binary breakup model types : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<binaryBreakupModel>(cstrIter()(popBal, dict)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::binaryBreakupModel::binaryBreakupModel +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + popBal_(popBal) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::binaryBreakupModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.H new file mode 100644 index 0000000000000000000000000000000000000000..2c1ead740ca668cc602d1c321e8d7228cdf58597 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/binaryBreakupModel/binaryBreakupModel.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::binaryBreakupModel + +Description + Base class for binary breakup models which give the breakup rate between a + sizeGroup pair directly, without an explicit expression for the daughter + size distribution. + +SourceFiles + binaryBreakupModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef binaryBreakupModel_H +#define binaryBreakupModel_H + +#include "populationBalanceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class binaryBreakupModel Declaration +\*---------------------------------------------------------------------------*/ + +class binaryBreakupModel +{ +protected: + + // Protected data + + //- Reference to the populationBalanceModel + const populationBalanceModel& popBal_; + + +public: + + //- Runtime type information + TypeName("binaryBreakupModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + binaryBreakupModel, + dictionary, + ( + const populationBalanceModel& popBal, + const dictionary& dict + ), + (popBal, dict) + ); + + + //- Class used for the read-construction of + // PtrLists of binary breakup models + class iNew + { + const populationBalanceModel& popBal_; + + public: + + iNew(const populationBalanceModel& popBal) + : + popBal_(popBal) + {} + + autoPtr<binaryBreakupModel> operator()(Istream& is) const + { + word type(is); + dictionary dict(is); + return binaryBreakupModel::New(type, popBal_, dict); + } + }; + + + // Constructor + + binaryBreakupModel + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + autoPtr<binaryBreakupModel> clone() const + { + NotImplemented; + return autoPtr<binaryBreakupModel>(nullptr); + } + + + // Selector + + static autoPtr<binaryBreakupModel> New + ( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~binaryBreakupModel() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to binary breakupRate + virtual void addToBinaryBreakupRate + ( + volScalarField& binaryBreakupRate, + const label i, + const label j + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.C new file mode 100644 index 0000000000000000000000000000000000000000..345475cc6e343fec1c6b187f8cb9964b0f9cb9ab --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "powerLawUniformBinary.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + defineTypeNameAndDebug(powerLawUniformBinary, 0); + addToRunTimeSelectionTable + ( + binaryBreakupModel, + powerLawUniformBinary, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::binaryBreakupModels::powerLawUniformBinary:: +powerLawUniformBinary +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + binaryBreakupModel(popBal, dict), + power_(readScalar(dict.lookup("power"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void +Foam::diameterModels::binaryBreakupModels::powerLawUniformBinary:: +addToBinaryBreakupRate +( + volScalarField& binaryBreakupRate, + const label i, + const label j +) +{ + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + binaryBreakupRate.primitiveFieldRef() += + pow(fj.x().value(), power_)*2.0/fj.x().value(); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.H new file mode 100644 index 0000000000000000000000000000000000000000..a16c34935b3719e466ce36f825f82cd9bd823dc8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/binaryBreakupModels/powerLawUniformBinary/powerLawUniformBinary.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::binaryBreakupModels::powerLawUniformBinary + +Description + Powerlaw kernel with a uniform daughter size distribution. Used for + verification and validation of the binary breakup formulation implemented + in the populationBalanceModel class. + +SourceFiles + powerLawUniformBinary.C + +\*---------------------------------------------------------------------------*/ + +#ifndef powerLawUniformBinary_H +#define powerLawUniformBinary_H + +#include "binaryBreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace binaryBreakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class powerLawUniformBinary Declaration +\*---------------------------------------------------------------------------*/ + +class powerLawUniformBinary +: + public binaryBreakupModel +{ + // Private data + + //- Power + scalar power_; + + +public: + + //- Runtime type information + TypeName("powerLawUniformBinary"); + + // Constructor + + powerLawUniformBinary + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~powerLawUniformBinary() + {} + + + // Member Functions + + //- Add to binary breakupRate + virtual void addToBinaryBreakupRate + ( + volScalarField& binaryBreakupRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace binaryBreakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.C new file mode 100644 index 0000000000000000000000000000000000000000..d6805da3237e1f301e727412fb146ad098dc6c5f --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "LaakkonenAlopaeusAittamaa.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + defineTypeNameAndDebug(LaakkonenAlopaeusAittamaa, 0); + addToRunTimeSelectionTable + ( + breakupModel, + LaakkonenAlopaeusAittamaa, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::breakupModels::LaakkonenAlopaeusAittamaa:: +LaakkonenAlopaeusAittamaa +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + breakupModel(popBal, dict), + C1_ + ( + dimensionedScalar::lookupOrDefault + ( + "C1", + dict, + dimensionSet(0, -2.0/3.0, 0, 0, 0), + 6.0 + ) + ), + C2_(dimensionedScalar::lookupOrDefault("C2", dict, dimless, 0.04)), + C3_(dimensionedScalar::lookupOrDefault("C3", dict, dimless, 0.01)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void +Foam::diameterModels::breakupModels::LaakkonenAlopaeusAittamaa::setBreakupRate +( + volScalarField& breakupRate, + const label i +) +{ + const phaseModel& continuousPhase = popBal_.continuousPhase(); + const sizeGroup& fi = popBal_.sizeGroups()[i]; + + breakupRate = + C1_*cbrt(popBal_.continuousTurbulence().epsilon()) + *erfc + ( + sqrt + ( + C2_*popBal_.sigmaWithContinuousPhase(fi.phase()) + /( + continuousPhase.rho()*pow(fi.d(), 5.0/3.0) + *pow(popBal_.continuousTurbulence().epsilon(), 2.0/3.0) + ) + + C3_*continuousPhase.mu() + /( + sqrt(continuousPhase.rho()*fi.phase().rho()) + *cbrt(popBal_.continuousTurbulence().epsilon()) + *pow(fi.d(), 4.0/3.0) + ) + ) + ); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.H new file mode 100644 index 0000000000000000000000000000000000000000..5e09b0aaab9aaf5248d8b7742b348916eceaf0f6 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/LaakkonenAlopaeusAittamaa/LaakkonenAlopaeusAittamaa.H @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::breakupModels::LaakkonenAlopaeusAittamaa + +Description + Model of Laakkonen et al. (2006). The total breakup rate is calculated by + + \f[ + C_1 \epsilon_c^{1/3} + \mathrm{erfc} + \left( + \sqrt + { + C_2 \frac{\sigma}{\rho_c \epsilon_c^{2/3} (6v_i/\pi)^{5/9}} + + C_3 \frac{\mu_c}{\sqrt{\rho_c \rho_d} + \epsilon_c^{1/3} (6v_i/\pi)^{4/9}} + } + \right) + \f] + + where + + \vartable + \sigma | Surface tension [N/m] + v_i | Volume of mother bubble i [m] + \epsilon_c | Turbulent dissipation rate of continuous phase [m2/s3] + \mu_c | Molecular dynamic viscosity of liquid phase [Pa s] + \rho_c | Density of continuous phase [kg/m3] + \rho_d | Density of disperse phase [kg/m3] + \endvartable + + References: + \verbatim + Laakkonen, M., Alopaeus, V., & Aittamaa, J. (2006). + Validation of bubble breakage, coalescence and mass transfer models for + gas-liquid dispersion in agitated vessel. + Chemical engineering science, 61(1), 218-228. + Eq. 2-3, p. 220. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + C1 | coefficient C1 | no | 6.0 + C2 | coefficient C2 | no | 0.04 + C3 | coefficient C3 | no | 0.01 + daughterSizeDistributionModel | inh. from breakupModel | inherited | + \endtable + +SourceFiles + LaakkonenAlopaeusAittamaa.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LaakkonenAlopaeusAittamaa_H +#define LaakkonenAlopaeusAittamaa_H + +#include "breakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaakkonenAlopaeusAittamaa Declaration +\*---------------------------------------------------------------------------*/ + +class LaakkonenAlopaeusAittamaa +: + public breakupModel +{ + // Private data + + //- Optional coefficient C1, defaults to 6.0 + dimensionedScalar C1_; + + //- Optional coefficient C2, defaults to 0.04 + dimensionedScalar C2_; + + //- Optional coefficient C3, defaults to 0.01 + dimensionedScalar C3_; + + +public: + + //- Runtime type information + TypeName("LaakkonenAlopaeusAittamaa"); + + // Constructor + + LaakkonenAlopaeusAittamaa + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~LaakkonenAlopaeusAittamaa() + {} + + + // Member Functions + + //- Set total breakupRate + virtual void setBreakupRate + ( + volScalarField& breakupRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace breakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C new file mode 100644 index 0000000000000000000000000000000000000000..62f01950605a6a5f4095823aa56e45a018cd0f30 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.C @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "breakupModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(breakupModel, 0); + defineRunTimeSelectionTable(breakupModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::breakupModel> +Foam::diameterModels::breakupModel::New +( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict +) +{ + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown breakup model type " + << type << nl << nl + << "Valid breakup model types : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<breakupModel>(cstrIter()(popBal, dict)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::breakupModel::breakupModel +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + popBal_(popBal), + dict_(dict) +{ + dsd_ = daughterSizeDistributionModel::New(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::breakupModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H new file mode 100644 index 0000000000000000000000000000000000000000..ce6a47c5daede55f369abead47b5d326ae7d91f4 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/breakupModel/breakupModel.H @@ -0,0 +1,183 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::breakupModel + +Description + Base class for breakup models which give a total breakup rate and a separate + daughter size distribution function. + +SourceFiles + breakupModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef breakupModel_H +#define breakupModel_H + +#include "populationBalanceModel.H" +#include "daughterSizeDistributionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class breakupModel Declaration +\*---------------------------------------------------------------------------*/ + +class breakupModel +{ +protected: + + // Protected data + + //- Reference to the populationBalanceModel + const populationBalanceModel& popBal_; + + //- Dictionary + dictionary dict_; + + //- Daughter size distribution model + autoPtr<daughterSizeDistributionModel> dsd_; + + +public: + + //- Runtime type information + TypeName("breakupModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + breakupModel, + dictionary, + ( + const populationBalanceModel& popBal, + const dictionary& dict + ), + (popBal, dict) + ); + + + //- Class used for the read-construction of + // PtrLists of breakup models + class iNew + { + const populationBalanceModel& popBal_; + + public: + + iNew(const populationBalanceModel& popBal) + : + popBal_(popBal) + {} + + autoPtr<breakupModel> operator()(Istream& is) const + { + word type(is); + dictionary dict(is); + return breakupModel::New(type, popBal_, dict); + } + }; + + + // Constructor + + breakupModel + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + autoPtr<breakupModel> clone() const + { + NotImplemented; + return autoPtr<breakupModel>(nullptr); + } + + + // Selector + + static autoPtr<breakupModel> New + ( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~breakupModel() + {} + + + // Member Functions + + //- Return reference to the populationBalanceModel + const populationBalanceModel& popBal() const + { + return popBal_; + } + + //- Return const-reference to daughter size distribution pointer + const autoPtr<daughterSizeDistributionModel>& dsdPtr() const + { + return dsd_; + } + + //- Return reference to daughter size distribution pointer + autoPtr<daughterSizeDistributionModel>& dsdPtr() + { + return dsd_; + } + + //- Correct diameter independent expressions + virtual void correct(); + + //- Set total breakupRate + virtual void setBreakupRate + ( + volScalarField& breakupRate, + const label i + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.C new file mode 100644 index 0000000000000000000000000000000000000000..ccc4de6cf37b2993e70f153869114b64b2831e48 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "exponential.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + defineTypeNameAndDebug(exponential, 0); + addToRunTimeSelectionTable(breakupModel, exponential, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::breakupModels::exponential::exponential +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + breakupModel(popBal, dict), + exponent_(readScalar(dict.lookup("exponent"))), + C_(readScalar(dict.lookup("C"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::breakupModels::exponential::setBreakupRate +( + volScalarField& breakupRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + + breakupRate.primitiveFieldRef() = + C_*exp(exponent_*fi.x().value()); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.H new file mode 100644 index 0000000000000000000000000000000000000000..1493a212fa2e643cbd83e087a8abcc29604e99cf --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/exponential/exponential.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::breakupModels::exponential + +Description + Exponential kernel. Used for verification and validation of the breakup + formulation implemented in the populationBalanceModel class. + +SourceFiles + exponential.C + +\*---------------------------------------------------------------------------*/ + +#ifndef exponential_H +#define exponential_H + +#include "breakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class exponential Declaration +\*---------------------------------------------------------------------------*/ + +class exponential +: + public breakupModel +{ + // Private data + + //- Exponent + scalar exponent_; + + //- Coefficient + scalar C_; + + +public: + + //- Runtime type information + TypeName("exponential"); + + // Constructor + + exponential + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~exponential() + {} + + + // Member Functions + + //- Set total breakupRate + virtual void setBreakupRate + ( + volScalarField& breakupRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace breakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.C new file mode 100644 index 0000000000000000000000000000000000000000..4a1786fb50206e231f4deaf005cc417febe3b256 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "powerLaw.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + defineTypeNameAndDebug(powerLaw, 0); + addToRunTimeSelectionTable(breakupModel, powerLaw, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::breakupModels::powerLaw::powerLaw +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + breakupModel(popBal, dict), + power_(readScalar(dict.lookup("power"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::breakupModels::powerLaw::setBreakupRate +( + volScalarField& breakupRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + + breakupRate.primitiveFieldRef() = pow(fi.x().value(), power_); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.H new file mode 100644 index 0000000000000000000000000000000000000000..dee9fffe6527f16abd30592fa1a6e8387951e046 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/breakupModels/powerLaw/powerLaw.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::breakupModels::powerLaw + +Description + Powerlaw kernel. Used for verification and validation of the breakup + formulation implemented in the populationBalanceModel class. + +SourceFiles + powerLaw.C + +\*---------------------------------------------------------------------------*/ + +#ifndef powerLaw_H +#define powerLaw_H + +#include "breakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace breakupModels +{ + +/*---------------------------------------------------------------------------*\ + Class powerLaw Declaration +\*---------------------------------------------------------------------------*/ + +class powerLaw +: + public breakupModel +{ + // Private data + + //- Power + scalar power_; + + +public: + + //- Runtime type information + TypeName("powerLaw"); + + // Constructor + + powerLaw + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~powerLaw() + {} + + + // Member Functions + + //- Set total breakupRate + virtual void setBreakupRate + ( + volScalarField& breakupRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace breakupModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.C new file mode 100644 index 0000000000000000000000000000000000000000..705aa95fc619362f2936b7317b71178a635afc0c --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.C @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "CoulaloglouTavlaridesCoalescence.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(CoulaloglouTavlaridesCoalescence, 0); + addToRunTimeSelectionTable + ( + coalescenceModel, + CoulaloglouTavlaridesCoalescence, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::CoulaloglouTavlaridesCoalescence:: +CoulaloglouTavlaridesCoalescence +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict), + C1_(dimensionedScalar::lookupOrDefault("C1", dict, dimless, 2.8)), + C2_(dimensionedScalar::lookupOrDefault("C2", dict, inv(dimArea), 1.83e9)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void +Foam::diameterModels::coalescenceModels::CoulaloglouTavlaridesCoalescence:: +addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + const phaseModel& continuousPhase = popBal_.continuousPhase(); + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + coalescenceRate += + C1_*(pow(fi.x(), 2.0/3.0) + pow(fj.x(), 2.0/3.0)) + *sqrt(pow(fi.x(), 2.0/9.0) + pow(fj.x(), 2.0/9.0)) + *cbrt(popBal_.continuousTurbulence().epsilon())/(1 + popBal_.alphas()) + *exp + ( + - C2_*continuousPhase.mu()*continuousPhase.rho() + *popBal_.continuousTurbulence().epsilon() + /sqr(popBal_.sigmaWithContinuousPhase(fi.phase())) + /pow3(1 + popBal_.alphas()) + *pow4(cbrt(fi.x())*cbrt(fj.x())/(cbrt(fi.x()) + cbrt(fj.x()))) + ); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.H new file mode 100644 index 0000000000000000000000000000000000000000..8815bfcb58e16bfd100c2670907296bf614d9c1e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/CoulaloglouTavlaridesCoalescence/CoulaloglouTavlaridesCoalescence.H @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::coalescenceModels::CoulaloglouTavlaridesCoalescence + +Description + Model of Coulaloglou and Tavlarides (1977). The coalescence rate is + calculated by + + \f[ + C_1 (v_i^{2/3} + v_j^{2/3}) (v_i^{2/9} + v_j^{2/9})^{1/2} + \frac{\epsilon_c^{1/3}}{1 + \alpha_d} + \text{exp} + \left[ + - C_2 \frac{\mu_c \rho_c}{\sigma^2} + \frac{\epsilon_c}{(1 + \alpha_d)^{3}} + \left( + \frac{v_i^{1/3} v_j^{1/3}}{v_i^{1/3} + v_j^{1/3}} + \right)^{4} + \right] + \f] + + where + + \vartable + \sigma | Surface tension [N/m] + v_i | Volume of droplet i [m3] + v_j | Volume of droplet j [m3] + \epsilon_c | Turbulent dissipation rate of continuous phase [m2/s3] + \alpha_d | Total void fraction of disperse phase [-] + \mu_c | Molecular dynamic viscosity of liquid phase [Pa s] + \rho_c | Density of continuous phase [kg/m3] + \endvartable + + References: + \verbatim + Coulaloglou, C. A., & Tavlarides, L. L. (1977). + Description of interaction processes in agitated liquid-liquid + dispersions. + Chemical Engineering Science, 32(11), 1289-1297. + Eq. 37, p. 1294. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + C1 | Coefficient C1 | no | 2.8 + C2 | Coefficient C2 | no | 1.83e9 + \endtable + +SourceFiles + CoulaloglouTavlaridesCoalescence.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CoulaloglouTavlaridesCoalescence_H +#define CoulaloglouTavlaridesCoalescence_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class CoulaloglouTavlaridesCoalescence Declaration +\*---------------------------------------------------------------------------*/ + +class CoulaloglouTavlaridesCoalescence +: + public coalescenceModel +{ + // Private data + + //- Optional coefficient C1, defaults to 2.8 + dimensionedScalar C1_; + + //- Optional coefficient C2, defaults to 1.83e9 + dimensionedScalar C2_; + + +public: + + //- Runtime type information + TypeName("CoulaloglouTavlarides"); + + // Constructor + + CoulaloglouTavlaridesCoalescence + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~CoulaloglouTavlaridesCoalescence() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.C new file mode 100644 index 0000000000000000000000000000000000000000..49cd5a4b7c089d644212fbc3625211502425aeda --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 "LehrMilliesMewesCoalescence.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(LehrMilliesMewesCoalescence, 0); + addToRunTimeSelectionTable + ( + coalescenceModel, + LehrMilliesMewesCoalescence, + dictionary + ); +} +} +} + +using Foam::constant::mathematical::pi; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::LehrMilliesMewesCoalescence:: +LehrMilliesMewesCoalescence +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict), + uCrit_ + ( + dimensionedScalar::lookupOrDefault("uCrit", dict, dimVelocity, 0.08) + ), + alphaMax_ + ( + dimensionedScalar::lookupOrDefault("alphaMax", dict, dimless, 0.6) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void +Foam::diameterModels::coalescenceModels::LehrMilliesMewesCoalescence:: +addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + const volScalarField uChar + ( + max + ( + sqrt(2.0)*cbrt(popBal_.continuousTurbulence().epsilon()) + *sqrt(cbrt(sqr(fi.d())) + cbrt(sqr(fj.d()))), + mag(fi.phase().U() - fj.phase().U()) + ) + ); + + coalescenceRate += + pi/4.0*sqr(fi.d() + fj.d())*min(uChar, uCrit_) + *exp + ( + - sqr(cbrt(alphaMax_) + /cbrt(max(popBal_.alphas(), fi.phase().residualAlpha())) - 1.0) + ); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.H new file mode 100644 index 0000000000000000000000000000000000000000..89382aaa80dfc84715f933d6a85880935157d86e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/LehrMilliesMewesCoalescence/LehrMilliesMewesCoalescence.H @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::diameterModels::coalescenceModels::LehrMilliesMewesCoalescence + +Description + Model of Lehr et al. (2002). The coalescence rate is calculated by + + \f[ + \frac{\pi}{4} (d_i + d_j)^2 \mathrm{min}(u^{\prime}, u_{\mathrm{crit}}) + \mathrm{exp} + \left[ + - \left(\frac{\alpha_{\mathrm{max}}^{1/3}}{\alpha^{1/3}} - 1\right)^2 + \right]\,, + \f] + + where + + \f[ + u^{\prime} + = + \mathrm{max} + \left( + \sqrt{2} \epsilon_c^{1/3} \sqrt{d_i^{2/3} + d_j^{2/3}}, + |\vec{u}_i - \vec{u}_j| + \right) + \f] + + is the characteristic velocity for coalescence. Note that a velocity + difference between bubble i and j is only present if the corresponding + size groups are assigned to different velocity groups. + + \vartable + d_i | Diameter of bubble i [m] + d_j | Diameter of bubble j [m] + \epsilon_c | Turbulent dissipation rate of continuous phase [m2/s3] + \alpha | Total void fraction of the bubbles [-] + \alpha_{max} | Maximum packing density of the bubbles [-] + u_{crit} | Critical velocity for coalescence [m/s] + \vec{u}_i | Velocity vector of bubble i [m/s] + \vec{u}_j | Velocity vector of bubble j [m/s] + \endvartable + + Reference: + \verbatim + Lehr, F., Millies, M., & Mewes, D. (2002). + Bubbleâ€size distributions and flow fields in bubble columns. + AIChE Journal, 48(11), 2426-2443. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + uCrit | Crit. coalescence velocity | no | 0.08 + alphaMax | Maximum packing density | no | 0.6 + \endtable + +SourceFiles + LehrMilliesMewesCoalescence.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LehrMilliesMewesCoalescence_H +#define LehrMilliesMewesCoalescence_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class LehrMilliesMewesCoalescence Declaration +\*---------------------------------------------------------------------------*/ + +class LehrMilliesMewesCoalescence +: + public coalescenceModel +{ + // Private data + + //- Critical velocity for coalescence, defaults to 0.08 m/s + dimensionedScalar uCrit_; + + //- Maximum packing density of the bubbles, defaults to 0.6 + dimensionedScalar alphaMax_; + + +public: + + //- Runtime type information + TypeName("LehrMilliesMewes"); + + // Constructor + + LehrMilliesMewesCoalescence + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~LehrMilliesMewesCoalescence() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.C new file mode 100644 index 0000000000000000000000000000000000000000..7657e14c05839509700dc7a2473b2d0855d1f220 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.C @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 "Luo.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" +#include "phaseCompressibleTurbulenceModel.H" +#include "virtualMassModel.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(Luo, 0); + addToRunTimeSelectionTable + ( + coalescenceModel, + Luo, + dictionary + ); +} +} +} + +using Foam::constant::mathematical::pi; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::Luo:: +Luo +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict), + beta_(dimensionedScalar::lookupOrDefault("beta", dict, dimless, 2.05)), + C1_(dimensionedScalar::lookupOrDefault("C1", dict, dimless, 1.0)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::coalescenceModels::Luo:: +addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + const phaseModel& continuousPhase = popBal_.continuousPhase(); + + if + ( + popBal_.fluid().foundSubModel<virtualMassModel> + ( + fi.phase(), + popBal_.continuousPhase() + ) + ) + { + const virtualMassModel& vm = + popBal_.fluid().lookupSubModel<virtualMassModel> + ( + fi.phase(), + popBal_.continuousPhase() + ); + + const dimensionedScalar xi = fi.d()/fj.d(); + + const volScalarField uij + ( + sqrt(beta_) + *cbrt(popBal_.continuousTurbulence().epsilon()*fi.d()) + *sqrt(1.0 + pow(xi, -2.0/3.0)) + ); + + coalescenceRate += + pi/4.0*sqr(fi.d() + fj.d())*uij + *exp + ( + - C1_ + *sqrt(0.75*(1.0 + sqr(xi))*(1.0 + pow3(xi))) + /( + sqrt(fi.phase().rho()/continuousPhase.rho() + + vm.Cvm())*pow3(1.0 + xi) + ) + *sqrt + ( + continuousPhase.rho()*fi.d()*sqr(uij) + /popBal_.sigmaWithContinuousPhase(fi.phase()) + ) + ); + } + else + { + FatalErrorInFunction + << "A virtual mass model for " << fi.phase().name() << " in " + << popBal_.continuousPhase().name() << " is not specified. This is " + << "required by the Luo coalescence model." << exit(FatalError); + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.H new file mode 100644 index 0000000000000000000000000000000000000000..eafc7db02c8ef8fa793b3cf9c3230d71fbfcae50 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/Luo/Luo.H @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::diameterModels::coalescenceModels::Luo + +Description + Model of Luo (1993). The coalescence rate is calculated by + + \f[ + &\frac{\pi}{4} (d_i + d_j)^2 u_{ij} + \mathrm{exp} + \left[ + - C_1 + \frac + {[0.75(1 + \xi_{ij}^2)(1 + \xi_{ij}^3)]^{1/2}} + {(\rho_d/\rho_c + C_{vm})^{1/2} (1 + \xi_{ij})^3} + \left(\frac{\rho_c d_i u_{ij}^2}{\sigma}\right)^{1/2} + \right]\,, + \f] + + where + + \f[ + u_{ij} = \sqrt{\beta} (\epsilon_c d_i)^{1/3} \sqrt{1 + \xi_{ij}^{-2/3}} + \f] + + is the mean approach velocity of the bubbles and + + \f[ + \xi_{ij} = d_i/d_j + \f] + + their size ratio. + + \vartable + d_i | Diameter of bubble i [m] + d_j | Diameter of bubble j [m] + u_{ij} | Mean approach velocity [m/s] + \xi_{ij} | Bubble size ratio [-] + \rho_d | Density of dispersed phase [kg/m3] + \rho_c | Density of continuous phase [kg/m3] + \sigma | Surface tension [N/m] + C_{vm} | Virtual mass coefficient [-] + C_1 | Coefficient [-] + \beta | Coefficient [-] + \epsilon_c | Continuous phase turbulent dissipation rate [m2/s3] + \endvartable + + Reference: + \verbatim + Luo, H. (1993). + Coalescence, breakup and liquid circulation in bubble column reactors. + Dr. Ing (Doctoral dissertation, Thesis, Department of Chemical + Engineering, The Norwegian Institute of Technology, Trondheim, Norway). + \endverbatim + +Usage + \table + Property | Description | Required | Default value + beta | Coefficient beta | no | 2.0 + C1 | Coefficient C1 | no | 1.0 + \endtable + +SourceFiles + Luo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Luo_H +#define Luo_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class Luo Declaration +\*---------------------------------------------------------------------------*/ + +class Luo +: + public coalescenceModel +{ + // Private data + + //- Coefficient beta, defaults to 2.0 + dimensionedScalar beta_; + + //- Optional coefficient C1, defaults to 1.0 + dimensionedScalar C1_; + + +public: + + //- Runtime type information + TypeName("Luo"); + + // Constructor + + Luo + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~Luo() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.C new file mode 100644 index 0000000000000000000000000000000000000000..d9f858da710d08b55d56f91899db76f5e459195c --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.C @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "PrinceBlanch.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(PrinceBlanch, 0); + addToRunTimeSelectionTable + ( + coalescenceModel, + PrinceBlanch, + dictionary + ); +} +} +} + +using Foam::constant::mathematical::pi; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::PrinceBlanch:: +PrinceBlanch +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict), + C1_(dimensionedScalar::lookupOrDefault("C1", dict, dimless, 0.356)), + h0_ + ( + dimensionedScalar::lookupOrDefault + ( + "h0", + dict, + dimLength, + 1e-4 + ) + ), + hf_ + ( + dimensionedScalar::lookupOrDefault + ( + "hf", + dict, + dimLength, + 1e-8 + ) + ), + turbulence_(dict.lookup("turbulence")), + buoyancy_(dict.lookup("buoyancy")), + laminarShear_(dict.lookup("laminarShear")) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::coalescenceModels::PrinceBlanch:: +addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + const phaseModel& continuousPhase = popBal_.continuousPhase(); + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + const uniformDimensionedVectorField& g = + popBal_.mesh().time().lookupObject<uniformDimensionedVectorField>("g"); + + const dimensionedScalar rij(1.0/(1.0/fi.d() + 1.0/fj.d())); + + const volScalarField collisionEfficiency + ( + exp + ( + - sqrt + ( + pow3(rij)*continuousPhase.rho() + /(16.0*popBal_.sigmaWithContinuousPhase(fi.phase())) + ) + *log(h0_/hf_) + *cbrt(popBal_.continuousTurbulence().epsilon())/pow(rij, 2.0/3.0) + ) + ); + + if (turbulence_) + { + coalescenceRate += + ( + C1_*pi*sqr(fi.d() + fj.d()) + *cbrt(popBal_.continuousTurbulence().epsilon()) + *sqrt(pow(fi.d(), 2.0/3.0) + pow(fj.d(), 2.0/3.0)) + ) + *collisionEfficiency; + } + + if (buoyancy_) + { + const dimensionedScalar Sij(pi/4.0*sqr(fi.d() + fj.d())); + + coalescenceRate += + ( + Sij + *mag + ( + sqrt + ( + 2.14*popBal_.sigmaWithContinuousPhase(fi.phase()) + /(continuousPhase.rho()*fi.d()) + 0.505*mag(g)*fi.d() + ) + - sqrt + ( + 2.14*popBal_.sigmaWithContinuousPhase(fi.phase()) + /(continuousPhase.rho()*fj.d()) + 0.505*mag(g)*fj.d() + ) + ) + ) + *collisionEfficiency; + } + + if (laminarShear_) + { + FatalErrorInFunction + << "Laminar shear collision contribution not implemented for " + << this->type() << " coalescence model." + << exit(FatalError); + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.H new file mode 100644 index 0000000000000000000000000000000000000000..4f9a4e41da4f7f5aa680bbd22277e99cfa400281 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/PrinceBlanch/PrinceBlanch.H @@ -0,0 +1,210 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::diameterModels::coalescenceModels::PrinceBlanch + +Description + Model of Prince and Blanch (1990). The coalescence rate is calculated by + + \f[ + \left( \theta_{ij}^{T} + \theta_{ij}^{B} + \theta_{ij}^{LS} \right) + \lambda_{ij} + \f] + + with the coalescence efficiency + + \f[ + \lambda_{ij} = + \mathrm{exp} + \left( + - \sqrt{\frac{r_{ij}^3 \rho_c}{16 \sigma}} + \mathrm{ln} \left(\frac{h_0}{h_f}\right) + \epsilon_c^{1/3}/r_{ij}^{2/3} + \right)\;, + \f] + + the turbulent collision rate + + \f[ + \theta_{ij}^{T} = + C_1 \pi (d_i + d_j)^{2} \epsilon_c^{1/3} + \sqrt{d_{i}^{2/3} + d_{j}^{2/3}}\;, + \f] + + and the buoyancy-driven collision rate + + \f[ + \theta_{ij}^{B} = S_{ij} \left| u_{ri} - u_{rj} \right|\;, + \f] + + where the rise velocity of bubble i is calculated by + + \f[ + u_{ri} = \sqrt{2.14 \sigma / \left(\rho_c d_i \right) + 0.505 g d_i}\;, + \f] + + the equivalent radius by + + \f[ + r_{ij} = \left( \frac{1}{d_i} + \frac{1}{d_j} \right)^{-1} + \f] + + and the collision cross sectional area by + + \f[ + S_{ij} = \frac{\pi}{4} \left(d_i + d_j\right)^{2}\;. + \f] + + Note that in equation 2, the bubble radius has been substituted by the + bubble diameter. Also the expression for the equivalent radius r_ij + (equation 19 in the paper of Prince and Blanch (1990)) was corrected. + The collision rate contribution due to laminar shear in the continuous phase + is currently neglected. + + \vartable + \theta_{ij}^{T} | Turbulent collision rate [m3/s] + \theta_{ij}^{B} | Buoyancy-driven collision rate [m3/s] + \theta_{ij}^{LS} | Laminar shear collision rate [m3/s] + \lambda_{ij} | Coalescence efficiency [-] + r_{ij} | Equivalent radius [m] + \rho_c | Density of continuous phase [kg/m3] + \sigma | Surface tension [N/m] + h_0 | Initial film thickness [m] + h_f | Critical film thickness [m] + \epsilon_c | Continuous phase turbulent dissipation rate [m2/s3] + d_i | Diameter of bubble i [m] + d_j | Diameter of bubble j [m] + u_{ri} | Rise velocity of bubble i [m/s] + S_{ij} | Collision cross sectional area [m2] + g | Gravitational constant [m/s2] + \endvartable + + Reference: + \verbatim + Prince, M. J., & Blanch, H. W. (1990). + Bubble coalescence and breakâ€up in airâ€sparged bubble columns. + AIChE journal, 36(10), 1485-1499. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + C1 | coefficient C1 | no | 0.089 + h0 | initial film thickness | no | 1e-4m + hf | critical film thickness | no | 1e-8m + turbulence | Switch for collisions due to turbulence | yes | none + buoyancy | Switch for collisions due to buoyancy | yes | none + laminarShear | Switch for collisions due to laminar shear | yes | none + \endtable + +SourceFiles + PrinceBlanch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PrinceBlanch_H +#define PrinceBlanch_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class PrinceBlanch Declaration +\*---------------------------------------------------------------------------*/ + +class PrinceBlanch +: + public coalescenceModel +{ + // Private data + + //- Optional coefficient C1, defaults to 0.089 + dimensionedScalar C1_; + + //- Initial film thickness, defaults to 1e-4m + dimensionedScalar h0_; + + //- Critical film thickness, defaults to 1e-8m + dimensionedScalar hf_; + + //- Switch for considering turbulent collisions + Switch turbulence_; + + //- Switch for considering buoyancy-induced collisions + Switch buoyancy_; + + //- Switch for considering buoyancy-induced collisions + Switch laminarShear_; + + +public: + + //- Runtime type information + TypeName("PrinceBlanch"); + + // Constructor + + PrinceBlanch + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~PrinceBlanch() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..76b61001f45005da5aacc1cb3b5c7d5faef45884 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.C @@ -0,0 +1,85 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(coalescenceModel, 0); + defineRunTimeSelectionTable(coalescenceModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::coalescenceModel> +Foam::diameterModels::coalescenceModel::New +( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict +) +{ + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown coalescence model type " + << type << nl << nl + << "Valid coalescence model types : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<coalescenceModel>(cstrIter()(popBal, dict)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModel::coalescenceModel +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + popBal_(popBal) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::coalescenceModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e7b320253b8ddbcc85000e70149fdc91466b717e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/coalescenceModel/coalescenceModel.H @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::coalescenceModel + +Description + Base class for coalescence models. + +SourceFiles + coalescenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef coalescenceModel_H +#define coalescenceModel_H + +#include "populationBalanceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class coalescenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class coalescenceModel +{ +protected: + + // Protected data + + //- Reference to the populationBalanceModel + const populationBalanceModel& popBal_; + + +public: + + //- Runtime type information + TypeName("coalescenceModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + coalescenceModel, + dictionary, + ( + const populationBalanceModel& popBal, + const dictionary& dict + ), + (popBal, dict) + ); + + + //- Class used for the read-construction of + // PtrLists of coalescence models + class iNew + { + const populationBalanceModel& popBal_; + + public: + + iNew(const populationBalanceModel& popBal) + : + popBal_(popBal) + {} + + autoPtr<coalescenceModel> operator()(Istream& is) const + { + word type(is); + dictionary dict(is); + return coalescenceModel::New(type, popBal_, dict); + } + }; + + + // Constructor + + coalescenceModel + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + autoPtr<coalescenceModel> clone() const + { + NotImplemented; + return autoPtr<coalescenceModel>(nullptr); + } + + + // Selector + + static autoPtr<coalescenceModel> New + ( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~coalescenceModel() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.C new file mode 100644 index 0000000000000000000000000000000000000000..b391c69e6f142f74e8761c00e0a51fe927a7b40b --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.C @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "constantCoalescence.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(constantCoalescence, 0); + addToRunTimeSelectionTable + ( + coalescenceModel, + constantCoalescence, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::constantCoalescence:: +constantCoalescence +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict), + rate_("rate", dimVolume/dimTime, dict) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void +Foam::diameterModels::coalescenceModels::constantCoalescence:: +addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + coalescenceRate += rate_; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.H new file mode 100644 index 0000000000000000000000000000000000000000..a32deba392ed7b222a85ca56e05595c301cb5b64 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/constantCoalescence/constantCoalescence.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::coalescenceModels::constantCoalescence + +Description + Constant coalescence kernel. Used for verification and validation of the + coalescence formulation implemented in the populationBalanceModel class. + +SourceFiles + constantCoalescence.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantCoalescence_H +#define constantCoalescence_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantCoalescence Declaration +\*---------------------------------------------------------------------------*/ + +class constantCoalescence +: + public coalescenceModel +{ + // Private data + + //- constant coalescenceRate + const dimensionedScalar rate_; + + +public: + + //- Runtime type information + TypeName("constant"); + + // Constructor + + constantCoalescence + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~constantCoalescence() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.C new file mode 100644 index 0000000000000000000000000000000000000000..0b95d027eac0d47e36c06faa95161cf647d888a0 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "hydrodynamic.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + defineTypeNameAndDebug(hydrodynamic, 0); + addToRunTimeSelectionTable(coalescenceModel, hydrodynamic, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::coalescenceModels::hydrodynamic::hydrodynamic +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + coalescenceModel(popBal, dict) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::coalescenceModels::hydrodynamic::addToCoalescenceRate +( + volScalarField& coalescenceRate, + const label i, + const label j +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const sizeGroup& fj = popBal_.sizeGroups()[j]; + + coalescenceRate.primitiveFieldRef() += + pow3((fi.d().value() + fj.d().value())); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.H new file mode 100644 index 0000000000000000000000000000000000000000..f7d16ca87aaaeb070fc4c8286c50fef17e4bccc6 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/coalescenceModels/hydrodynamic/hydrodynamic.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::coalescenceModels::hydrodynamic + +Description + Hydrodynamic kernel. Used for verification and validation of the coalescence + formulation implemented in the populationBalanceModel class. + +SourceFiles + hydrodynamic.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hydrodynamic_H +#define hydrodynamic_H + +#include "coalescenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace coalescenceModels +{ + +/*---------------------------------------------------------------------------*\ + Class hydrodynamic Declaration +\*---------------------------------------------------------------------------*/ + +class hydrodynamic +: + public coalescenceModel +{ +public: + + //- Runtime type information + TypeName("hydrodynamic"); + + // Constructor + + hydrodynamic + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~hydrodynamic() + {} + + + // Member Functions + + //- Add to coalescenceRate + virtual void addToCoalescenceRate + ( + volScalarField& coalescenceRate, + const label i, + const label j + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace coalescenceModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.C new file mode 100644 index 0000000000000000000000000000000000000000..effb6e6275458d8414ea89c143e1e90c2a10895f --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.C @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "LaakkonenAlopaeusAittamaaDsd.H" +#include "addToRunTimeSelectionTable.H" +#include "breakupModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace daughterSizeDistributionModels +{ + defineTypeNameAndDebug(LaakkonenAlopaeusAittamaaDsd, 0); + addToRunTimeSelectionTable + ( + daughterSizeDistributionModel, + LaakkonenAlopaeusAittamaaDsd, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::daughterSizeDistributionModels:: +LaakkonenAlopaeusAittamaaDsd::LaakkonenAlopaeusAittamaaDsd +( + const breakupModel& breakup, + const dictionary& dict +) +: + daughterSizeDistributionModel(breakup, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::daughterSizeDistributionModels:: +LaakkonenAlopaeusAittamaaDsd::~LaakkonenAlopaeusAittamaaDsd() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::dimensionedScalar +Foam::diameterModels::daughterSizeDistributionModels:: +LaakkonenAlopaeusAittamaaDsd::calcNik +( + const label i, + const label k +) const +{ + const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i].x(); + const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k].x(); + const UPtrList<sizeGroup>& sizeGroups = breakup_.popBal().sizeGroups(); + + if (i == 0) + { + const dimensionedScalar& xii = sizeGroups[i+1].x(); + + return + ( + 5.0*pow4(xii)*sqr(xk) - 12.0*pow5(xi)*xii + 10.0*pow6(xi) + - (20.0*pow3(xi)*xii - 15.0*pow4(xi))*sqr(xk) - 6.0*pow5(xii)*xk + - (24*pow5(xi) - 30*pow4(xi)*xii)*xk + 2*pow6(xii) + ) + /((xii - xi)*pow5(xk)); + } + else if (i == k) + { + const dimensionedScalar& x = sizeGroups[i-1].x(); + + return + ( + (15.0*pow4(xi) - 20.0*x*pow3(xi))*sqr(xk) + + 5.0*pow4(x)*sqr(xk) + (30.0*x*pow4(xi) - 24.0*pow5(xi))*xk + - 6.0*pow5(x)*xk + 10.0*pow6(xi) - 12.0*x*pow5(xi) + 2.0*pow6(x) + ) + /((xi - x)*pow5(xk)); + } + else + { + const dimensionedScalar& x = sizeGroups[i-1].x(); + const dimensionedScalar& xii = sizeGroups[i+1].x(); + + return + ( + 5.0*pow4(xii)*sqr(xk) - 12.0*pow5(xi)*xii + 10.0*pow6(xi) + - (20.0*pow3(xi)*xii - 15.0*pow4(xi))*sqr(xk) - 6.0*pow5(xii)*xk + - (24*pow5(xi) - 30*pow4(xi)*xii)*xk + 2*pow6(xii) + ) + /((xii - xi)*pow5(xk)) + + ( + (15.0*pow4(xi) - 20.0*x*pow3(xi))*sqr(xk) + + 5.0*pow4(x)*sqr(xk) + (30.0*x*pow4(xi) - 24.0*pow5(xi))*xk + - 6.0*pow5(x)*xk + 10.0*pow6(xi) - 12.0*x*pow5(xi) + 2.0*pow6(x) + ) + /((xi - x)*pow5(xk)); + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.H new file mode 100644 index 0000000000000000000000000000000000000000..6c86e6401971c1d9c2a8ec51c4e419c1491d23cb --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/LaakkonenAlopaeusAittamaaDsd/LaakkonenAlopaeusAittamaaDsd.H @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::daughterSizeDistributionModels:: + LaakkonenAlopaeusAittamaaDsd + +Description + Daughter size distribution model used by Laakkonen et al. (2006). Note that + it must be multiplied by the number of daughter particles (2). Also, the + coefficient C4 needs to be set to the value of 2 as to ensure number and + mass conservation following Kumar and Ramkrishna (1996). Also the internal + coordinate was changed to particle volume, which gives + + \f[ + \frac{60}{v_j} \left(\frac{v_i}{v_j}\right)^{2} + \left(1 - \frac{v_i}{v_j}\right)^{2} + \f] + + where + + \vartable + v_i | Volume of daughter bubble i [m] + v_j | Volume of mother bubble j [m] + \endvartable + + References: + \verbatim + Laakkonen, M., Alopaeus, V., & Aittamaa, J. (2006). + Validation of bubble breakage, coalescence and mass transfer models for + gas-liquid dispersion in agitated vessel. + Chemical engineering science, 61(1), 218-228. + Eq. 3, p. 220. + \endverbatim + + \verbatim + Kumar, S., & Ramkrishna, D. (1996). + On the solution of population balance equations by discretization-I. + A fixed pivot technique. + Chemical Engineering Science, 51(8), 1311-1332. + Eq. 33, p. 1318. + \endverbatim + +Usage + \table + Property | Description | Required | Default value + C1 | Coefficient C1 | no | 6.0 + C2 | Coefficient C2 | no | 0.04 + C3 | Coefficient C3 | no | 0.01 + \endtable + +SourceFiles + LaakkonenAlopaeusAittamaaBinaryBreakup.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LaakkonenAlopaeusAittamaaDsd_H +#define LaakkonenAlopaeusAittamaaDsd_H + +#include "daughterSizeDistributionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace daughterSizeDistributionModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaakkonenAlopaeusAittamaaDsd Declaration +\*---------------------------------------------------------------------------*/ + +class LaakkonenAlopaeusAittamaaDsd +: + public daughterSizeDistributionModel +{ +public: + + //- Runtime type information + TypeName("LaakkonenAlopaeusAittamaa"); + + + // Constructor + + LaakkonenAlopaeusAittamaaDsd + ( + const breakupModel& breakup, + const dictionary& dict + ); + + + //- Destructor + virtual ~LaakkonenAlopaeusAittamaaDsd(); + + + // Member Functions + + //- Return total number of particles assigned to class i when a particle + // of class k breaks + virtual dimensionedScalar calcNik(const label i, const label k) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace daughterSizeDistributionModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C new file mode 100644 index 0000000000000000000000000000000000000000..085d7cf542a6241c9f374e5f06967ec9a3b623a8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "daughterSizeDistributionModel.H" +#include "breakupModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(daughterSizeDistributionModel, 0); + defineRunTimeSelectionTable(daughterSizeDistributionModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::daughterSizeDistributionModel> +Foam::diameterModels::daughterSizeDistributionModel::New +( + const breakupModel& breakup, + const dictionary& dict +) +{ + word daughterSizeDistributionModelType + ( + dict.lookup("daughterSizeDistributionModel") + ); + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(daughterSizeDistributionModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown daughter size distribution model type " + << daughterSizeDistributionModelType << endl << endl + << "Valid daughter size distribution model types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(breakup, dict); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + + +Foam::diameterModels::daughterSizeDistributionModel:: +daughterSizeDistributionModel +( + const breakupModel& breakup, + const dictionary& dict +) +: + breakup_(breakup) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::daughterSizeDistributionModel:: +~daughterSizeDistributionModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::dimensionedScalar& +Foam::diameterModels::daughterSizeDistributionModel:: +nik +( + const label i, + const label k +) const +{ + return nik_[k][i]; +} + + +void Foam::diameterModels::daughterSizeDistributionModel::correct() +{ + if (nik_.size() == 0) + { + forAll(breakup_.popBal().sizeGroups(), k) + { + nik_.append(new PtrList<dimensionedScalar>()); + + for (label i = 0; i <= k; i++) + { + nik_[k].append(new dimensionedScalar (this->calcNik(i, k))); + } + } + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.H new file mode 100644 index 0000000000000000000000000000000000000000..f229d77a9e4799bdf471bac92dbd8eb11e8ec628 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/daughterSizeDistributionModel/daughterSizeDistributionModel.H @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::daughterSizeDistributionModel + +Description + Base class for daughter size distribution models. + +SourceFiles + daughterSizeDistributionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef daughterSizeDistributionModel_H +#define daughterSizeDistributionModel_H + +#include "dictionary.H" +#include "dimensionedScalar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +class breakupModel; + +/*---------------------------------------------------------------------------*\ + Class daughterSizeDistributionModel Declaration +\*---------------------------------------------------------------------------*/ + +class daughterSizeDistributionModel +{ +protected: + + // Protected data + + //- Reference to the breakupModel + const breakupModel& breakup_; + + //- nik + PtrList<PtrList<dimensionedScalar>> nik_; + + +public: + + //- Runtime type information + TypeName("daughterSizeDistributionModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + daughterSizeDistributionModel, + dictionary, + ( + const breakupModel& breakup, + const dictionary& dict + ), + (breakup, dict) + ); + + + // Constructor + + daughterSizeDistributionModel + ( + const breakupModel& breakup, + const dictionary& dict + ); + + + //- Destructor + virtual ~daughterSizeDistributionModel(); + + + // Selectors + + static autoPtr<daughterSizeDistributionModel> New + ( + const breakupModel& breakup, + const dictionary& dict + ); + + + // Member Functions + + //- Return total number of particles assigned to class i when a particle + // of class k breaks + const dimensionedScalar& nik(const label i, const label k) const; + + //- Correct field independent expressions + void correct(); + + //- Calculate and return total number of particles assigned to class i + // when a particle of class k breaks + virtual dimensionedScalar calcNik + ( + const label i, + const label k + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.C new file mode 100644 index 0000000000000000000000000000000000000000..10d39a87e0aa2171e5d83f133cbe7351b5dd6836 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "uniformBinary.H" +#include "addToRunTimeSelectionTable.H" +#include "breakupModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace daughterSizeDistributionModels +{ + defineTypeNameAndDebug(uniformBinary, 0); + addToRunTimeSelectionTable + ( + daughterSizeDistributionModel, + uniformBinary, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::daughterSizeDistributionModels::uniformBinary:: +uniformBinary +( + const breakupModel& breakup, + const dictionary& dict +) +: + daughterSizeDistributionModel(breakup, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::daughterSizeDistributionModels::uniformBinary:: +~uniformBinary() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::dimensionedScalar +Foam::diameterModels::daughterSizeDistributionModels::uniformBinary::calcNik +( + const label i, + const label k +) const +{ + const dimensionedScalar& xi = breakup_.popBal().sizeGroups()[i].x(); + const dimensionedScalar& xk = breakup_.popBal().sizeGroups()[k].x(); + const UPtrList<sizeGroup>& sizeGroups = breakup_.popBal().sizeGroups(); + + if (i == 0) + { + return (sizeGroups[i+1].x() - xi)/xk; + } + else if (i == k) + { + return (xi - sizeGroups[i-1].x())/xk; + } + else + { + return (sizeGroups[i+1].x() - xi)/xk + (xi - sizeGroups[i-1].x())/xk; + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.H new file mode 100644 index 0000000000000000000000000000000000000000..6b79c1f791281ea47278f14c5ad9f8992b08d55b --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/daughterSizeDistributionModels/uniformBinary/uniformBinary.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::daughterSizeDistributionModels::uniformBinary + +Description + Uniform binary daughter size distribution. Used for verification and + validation of the breakup formulation implemented in the + populationBalanceModel class. + +SourceFiles + uniformBinary.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformBinary_H +#define uniformBinary_H + +#include "daughterSizeDistributionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace daughterSizeDistributionModels +{ + +/*---------------------------------------------------------------------------*\ + Class uniformBinary Declaration +\*---------------------------------------------------------------------------*/ + +class uniformBinary +: + public daughterSizeDistributionModel +{ +public: + + //- Runtime type information + TypeName("uniformBinary"); + + + // Constructor + + uniformBinary + ( + const breakupModel& breakup, + const dictionary& dict + ); + + + //- Destructor + virtual ~uniformBinary(); + + + // Member Functions + + //- Return total number of particles assigned to class i when a particle + // of class k breaks + virtual dimensionedScalar calcNik(const label i, const label k) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace daughterSizeDistributionModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.C new file mode 100644 index 0000000000000000000000000000000000000000..be8e062d95d72591707e14dbb319058a28b28351 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "constantDrift.H" +#include "phaseSystem.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + defineTypeNameAndDebug(constantDrift, 0); + addToRunTimeSelectionTable(driftModel, constantDrift, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::driftModels::constantDrift::constantDrift +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + driftModel(popBal, dict), + N_ + ( + IOobject + ( + "N", + popBal.mesh().time().timeName(), + popBal.mesh() + ), + popBal.mesh(), + dimensionedScalar("zero", inv(dimVolume), Zero) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::driftModels::constantDrift::correct() +{ + N_ *= 0.0; + + forAll(popBal_.sizeGroups(), i) + { + const sizeGroup& fi = popBal_.sizeGroups()[i]; + + N_ += fi*fi.phase()/fi.x(); + } +} + + +void Foam::diameterModels::driftModels::constantDrift::addToDriftRate +( + volScalarField& driftRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + phaseModel& phase = const_cast<phaseModel&>(fi.phase()); + volScalarField& rho = phase.thermoRef().rho(); + + driftRate += (popBal_.fluid().fvOptions()(phase, rho)&rho)/(N_*rho); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.H new file mode 100644 index 0000000000000000000000000000000000000000..689ecce0d25118beb697685db9cad6e9f0975c87 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/constantDrift/constantDrift.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::driftModels::constantDrift + +Description + Constant drift rate within all classes. Used for verification and + validation of the drift formulation implemented in the + populationBalanceModel class. Rate is calculated from fvOptions mass source. + + +SourceFiles + constant.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantDrift_H +#define constantDrift_H + +#include "driftModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantDrift Declaration +\*---------------------------------------------------------------------------*/ + +class constantDrift +: + public driftModel +{ + // Private data + + //- Total number concentration + volScalarField N_; + + +public: + + //- Runtime type information + TypeName("constant"); + + // Constructor + + constantDrift + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~constantDrift() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to driftRate + virtual void addToDriftRate + ( + volScalarField& driftRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace driftModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.C new file mode 100644 index 0000000000000000000000000000000000000000..04df55dfe94c18ea08327913715b6905bd80ed01 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "densityChange.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseSystem.H" +#include "fvcDdt.H" +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + defineTypeNameAndDebug(densityChangeDrift, 0); + addToRunTimeSelectionTable(driftModel, densityChangeDrift, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::driftModels::densityChangeDrift::densityChangeDrift +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + driftModel(popBal, dict) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +void Foam::diameterModels::driftModels::densityChangeDrift::addToDriftRate +( + volScalarField& driftRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + volScalarField& rho = const_cast<volScalarField&>(fi.phase().rho()()); + + driftRate -= (fvc::ddt(rho) + (fvc::grad(rho)&popBal_.U())) + *popBal_.sizeGroups()[i].x()/rho; +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.H new file mode 100644 index 0000000000000000000000000000000000000000..aba0f661e8e1505e1eaf64f2c13beefb51f48dc2 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/densityChange/densityChange.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::driftModels::densityChangeDrift + +Description + Drift rate induced by changes in density. + +SourceFiles + densityChange.C + +\*---------------------------------------------------------------------------*/ + +#ifndef densityChange_H +#define densityChange_H + +#include "driftModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + +/*---------------------------------------------------------------------------*\ + Class densityChangeDrift Declaration +\*---------------------------------------------------------------------------*/ + +class densityChangeDrift +: + public driftModel +{ +public: + + //- Runtime type information + TypeName("densityChange"); + + // Constructor + + densityChangeDrift + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~densityChangeDrift() + {} + + + // Member Functions + + //- Add to driftRate + virtual void addToDriftRate + ( + volScalarField& driftRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace driftModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C new file mode 100644 index 0000000000000000000000000000000000000000..e75e49da58d38f0c54195f5c8e49cf707b0b74c8 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +#include "driftModel.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(driftModel, 0); + defineRunTimeSelectionTable(driftModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::driftModel> +Foam::diameterModels::driftModel::New +( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict +) +{ + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown drift model type " + << type << nl << nl + << "Valid drift model types : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<driftModel>(cstrIter()(popBal, dict)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::driftModel::driftModel +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + popBal_(popBal) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::driftModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.H new file mode 100644 index 0000000000000000000000000000000000000000..145ebffb380ea93ed5979352bc0e37e5f014bbee --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/driftModel/driftModel.H @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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::diameterModels::driftModel + +Description + Base class for drift models. + +SourceFiles + driftModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef driftModel_H +#define driftModel_H + +#include "populationBalanceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class driftModel Declaration +\*---------------------------------------------------------------------------*/ + +class driftModel +{ +protected: + + // Protected data + + //- Reference to the populationBalanceModel + const populationBalanceModel& popBal_; + + +public: + + //- Runtime type information + TypeName("driftModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + driftModel, + dictionary, + ( + const populationBalanceModel& popBal, + const dictionary& dict + ), + (popBal, dict) + ); + + + //- Class used for the read-construction of + // PtrLists of drift models + class iNew + { + const populationBalanceModel& popBal_; + + public: + + iNew(const populationBalanceModel& popBal) + : + popBal_(popBal) + {} + + autoPtr<driftModel> operator()(Istream& is) const + { + word type(is); + dictionary dict(is); + return driftModel::New(type, popBal_, dict); + } + }; + + + // Constructor + + driftModel + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + autoPtr<driftModel> clone() const + { + NotImplemented; + return autoPtr<driftModel>(nullptr); + } + + + // Selector + + static autoPtr<driftModel> New + ( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~driftModel() + {} + + + // Member Functions + + //- Return reference to the populationBalanceModel + const populationBalanceModel& popBal() const + { + return popBal_; + } + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to driftRate + virtual void addToDriftRate + ( + volScalarField& driftRate, + const label i + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.C new file mode 100644 index 0000000000000000000000000000000000000000..c22f81136984951691eb4015fe17f5c67936b33d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.C @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "phaseChange.H" +#include "addToRunTimeSelectionTable.H" +#include "phaseSystem.H" +#include "phasePairKey.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + defineTypeNameAndDebug(phaseChange, 0); + addToRunTimeSelectionTable(driftModel, phaseChange, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::driftModels::phaseChange::phaseChange +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + driftModel(popBal, dict), + pairKeys_(dict.lookup("pairs")), + numberWeighted_(dict.lookupOrDefault<Switch>("numberWeighted", false)), + W_(pairKeys_.size()) +{ + const phaseSystem& fluid = popBal_.fluid(); + + forAll(pairKeys_, i) + { + const phasePair& pair = fluid.phasePairs()[pairKeys_[i]]; + + W_.set + ( + i, + new volScalarField + ( + IOobject + ( + IOobject::groupName(type() + ":W", pair.name()), + popBal_.mesh().time().timeName(), + popBal_.mesh() + ), + popBal_.mesh(), + dimensionedScalar + ( + inv(numberWeighted_ ? dimVolume : dimLength), + Zero + ) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::driftModels::phaseChange::correct() +{ + const phaseSystem& fluid = popBal_.fluid(); + + forAll(pairKeys_, i) + { + W_[i] *= 0.0; + } + + forAll(pairKeys_, k) + { + if (fluid.phasePairs().found(pairKeys_[k])) + { + const phasePair& pair = fluid.phasePairs()[pairKeys_[k]]; + + forAll(popBal_.velocityGroups(), j) + { + const velocityGroup& vgj = popBal_.velocityGroups()[j]; + if (pair.contains(vgj.phase())) + { + forAll(vgj.sizeGroups(), i) + { + const sizeGroup& fi = vgj.sizeGroups()[i]; + + W_[k] += + fi*max(fi.phase(), SMALL) + /(numberWeighted_ ? fi.x() : fi.d()); + } + } + } + } + } +} + + +void Foam::diameterModels::driftModels::phaseChange::addToDriftRate +( + volScalarField& driftRate, + const label i +) +{ + const velocityGroup& vg = popBal_.sizeGroups()[i].VelocityGroup(); + + forAll(pairKeys_, k) + { + const phasePair& pair = + popBal_.fluid().phasePairs()[pairKeys_[k]]; + + if (pair.contains(vg.phase())) + { + const volScalarField& iDmdt = + popBal_.mesh().lookupObject<volScalarField> + ( + IOobject::groupName("iDmdt", pair.name()) + ); + + const scalar iDmdtSign = + vg.phase().name() == pair.first() ? +1 : -1; + + const sizeGroup& fi = popBal_.sizeGroups()[i]; + + tmp<volScalarField> dDriftRate + ( + iDmdtSign*iDmdt/(fi.phase().rho()*W_[k]) + ); + + if (!numberWeighted_) + { + dDriftRate.ref() *= fi.x()/fi.d(); + } + + driftRate += dDriftRate; + } + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.H new file mode 100644 index 0000000000000000000000000000000000000000..4831099c131913b350b2cc14c518cd4cf813c8bd --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/driftModels/phaseChange/phaseChange.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +Class + Foam::diameterModels::driftModels::phaseChange + +Description + Drift induced by interfacial phase change. By default phase change mass + flux is distributed between sizeGroups of each velocityGroup with phase + change based on interfacial area of each size group. + +SourceFiles + phaseChange.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseChange_H +#define phaseChange_H + +#include "driftModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace driftModels +{ + +/*---------------------------------------------------------------------------*\ + Class phaseChange Declaration +\*---------------------------------------------------------------------------*/ + +class phaseChange +: + public driftModel +{ + // Private data + + //- PhasePairs between which phaseChange occurs, e.g., + // "((gasI and liquid) (gasII and liquid))" + List<phasePairKey> pairKeys_; + + //- Distribute phase change mass flux between sizeGroups based on the + // number concentration, rather than the interfacial area + Switch numberWeighted_; + + //- Weighting with which the phase change mass flux is distributed + PtrList<volScalarField> W_; + + +public: + + //- Runtime type information + TypeName("phaseChange"); + + // Constructor + + //- Construct from a population balance model and a dictionary + phaseChange + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~phaseChange() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to driftRate + virtual void addToDriftRate + ( + volScalarField& driftRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace driftModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.C new file mode 100644 index 0000000000000000000000000000000000000000..5c2c0559d460596f9687fadffa3cbbb16760984e --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "constantNucleation.H" +#include "phaseSystem.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace nucleationModels +{ + defineTypeNameAndDebug(constantNucleation, 0); + addToRunTimeSelectionTable + ( + nucleationModel, + constantNucleation, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::nucleationModels::constantNucleation:: +constantNucleation +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + nucleationModel(popBal, dict), + d_("departureDiameter", dimLength, dict), + velGroup_ + ( + refCast<const velocityGroup> + ( + popBal.mesh().lookupObject<phaseModel> + ( + IOobject::groupName + ( + "alpha", + dict.get<word>("velocityGroup") + ) + ).dPtr()() + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::nucleationModels::constantNucleation::correct() +{ + if + ( + d_.value() < velGroup_.sizeGroups().first().d().value() + || d_.value() > velGroup_.sizeGroups().last().d().value() + ) + { + WarningInFunction + << "Departure diameter " << d_.value() << " m outside of range [" + << velGroup_.sizeGroups().first().d().value() << ", " + << velGroup_.sizeGroups().last().d().value() << "] m" << endl + << " The nucleation rate is set to zero." << endl + << " Adjust discretization over property space to suppress this" + << " warning." + << endl; + } +} + + +void +Foam::diameterModels::nucleationModels::constantNucleation::addToNucleationRate +( + volScalarField& nucleationRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + phaseModel& phase = const_cast<phaseModel&>(fi.phase()); + volScalarField& rho = phase.thermoRef().rho(); + + nucleationRate += + popBal_.gamma(i, velGroup_.formFactor()*pow3(d_)) + *(popBal_.fluid().fvOptions()(phase, rho)&rho)/rho/fi.x(); +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.H new file mode 100644 index 0000000000000000000000000000000000000000..3b1d69cf86ee83a8903df2778869e5af93af3894 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/constantNucleation/constantNucleation.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::nucleationModels::constantNucleation + +Description + Constant nucleation rate within all classes. Used for verification and + validation of the nucleation formulation implemented in the + populationBalanceModel class. Rate is calculated from fvOptions mass source. + +SourceFiles + constant.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantNucleation_H +#define constantNucleation_H + +#include "nucleationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace nucleationModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantNucleation Declaration +\*---------------------------------------------------------------------------*/ + +class constantNucleation +: + public nucleationModel +{ + // Private data + + //- Departure diameter + dimensionedScalar d_; + + //- Velocity group in which the nucleation occurs + const velocityGroup& velGroup_; + + +public: + + //- Runtime type information + TypeName("constant"); + + // Constructor + + constantNucleation + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~constantNucleation() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to nucleationRate + virtual void addToNucleationRate + ( + volScalarField& nucleationRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace nucleationModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C new file mode 100644 index 0000000000000000000000000000000000000000..bac76d8a508d4f3afce9c053d4527fe4d95af60d --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "nucleationModel.H" +#include "phaseSystem.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(nucleationModel, 0); + defineRunTimeSelectionTable(nucleationModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::nucleationModel> +Foam::diameterModels::nucleationModel::New +( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict +) +{ + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown nucleation model type " + << type << nl << nl + << "Valid nucleation model types : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<nucleationModel>(cstrIter()(popBal, dict)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::nucleationModel::nucleationModel +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + popBal_(popBal) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::nucleationModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.H new file mode 100644 index 0000000000000000000000000000000000000000..7d8768d1175041cbdf83865cf2504505baa14858 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/nucleationModel/nucleationModel.H @@ -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::diameterModels::nucleationModel + +Description + Base class for nucleation models. + +SourceFiles + nucleationModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nucleationModel_H +#define nucleationModel_H + +#include "populationBalanceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class nucleationModel Declaration +\*---------------------------------------------------------------------------*/ + +class nucleationModel +{ +protected: + + // Protected data + + //- Reference to the populationBalanceModel + const populationBalanceModel& popBal_; + + +public: + + //- Runtime type information + TypeName("nucleationModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + nucleationModel, + dictionary, + ( + const populationBalanceModel& popBal, + const dictionary& dict + ), + (popBal, dict) + ); + + + //- Class used for the read-construction of + // PtrLists of nucleation models + class iNew + { + const populationBalanceModel& popBal_; + + public: + + iNew(const populationBalanceModel& popBal) + : + popBal_(popBal) + {} + + autoPtr<nucleationModel> operator()(Istream& is) const + { + word type(is); + dictionary dict(is); + return nucleationModel::New(type, popBal_, dict); + } + }; + + + // Constructor + + nucleationModel + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + autoPtr<nucleationModel> clone() const + { + NotImplemented; + return autoPtr<nucleationModel>(nullptr); + } + + + // Selector + + static autoPtr<nucleationModel> New + ( + const word& type, + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~nucleationModel() + {} + + + // Member Functions + + //- Return reference to the populationBalanceModel + const populationBalanceModel& popBal() const + { + return popBal_; + } + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to nucleationRate + virtual void addToNucleationRate + ( + volScalarField& nucleationRate, + const label i + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C new file mode 100644 index 0000000000000000000000000000000000000000..c51783e7537b06dbe51f3f3497ebcb9179183282 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "wallBoiling.H" +#include "alphatWallBoilingWallFunctionFvPatchScalarField.H" +#include "phaseSystem.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace nucleationModels +{ + defineTypeNameAndDebug(wallBoiling, 0); + addToRunTimeSelectionTable + ( + nucleationModel, + wallBoiling, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::nucleationModels::wallBoiling:: +wallBoiling +( + const populationBalanceModel& popBal, + const dictionary& dict +) +: + nucleationModel(popBal, dict), + velGroup_ + ( + refCast<const velocityGroup> + ( + popBal.mesh().lookupObject<phaseModel> + ( + IOobject::groupName + ( + "alpha", + dict.get<word>("velocityGroup") + ) + ).dPtr()() + ) + ), + turbulence_ + ( + popBal_.mesh().lookupObjectRef<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + popBal_.continuousPhase().name() + ) + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::diameterModels::nucleationModels::wallBoiling::correct() +{ + const tmp<volScalarField> talphat(turbulence_.alphat()); + const volScalarField::Boundary& alphatBf = talphat().boundaryField(); + + typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField + alphatWallBoilingWallFunction; + + forAll(alphatBf, patchi) + { + if + ( + isA<alphatWallBoilingWallFunction>(alphatBf[patchi]) + ) + { + const alphatWallBoilingWallFunction& alphatw = + refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]); + + const scalarField& dDep = alphatw.dDeparture(); + + if (min(dDep) < velGroup_.sizeGroups().first().d().value()) + { + Warning + << "Minimum departure diameter " << min(dDep) + << " m outside of range [" + << velGroup_.sizeGroups().first().d().value() << ", " + << velGroup_.sizeGroups().last().d().value() << "] m" + << " at patch " << alphatw.patch().name() + << endl + << " The nucleation rate in populationBalance " + << popBal_.name() << " is set to zero." << endl + << " Adjust discretization over property space to" + << " suppress this warning." + << endl; + } + else if (max(dDep) > velGroup_.sizeGroups().last().d().value()) + { + Warning + << "Maximum departure diameter " << max(dDep) + << " m outside of range [" + << velGroup_.sizeGroups().first().d().value() << ", " + << velGroup_.sizeGroups().last().d().value() << "] m" + << " at patch " << alphatw.patch().name() + << endl + << " The nucleation rate in populationBalance " + << popBal_.name() << " is set to zero." << endl + << " Adjust discretization over property space to" + << " suppress this warning." + << endl; + } + } + } +} + + +void +Foam::diameterModels::nucleationModels::wallBoiling::addToNucleationRate +( + volScalarField& nucleationRate, + const label i +) +{ + const sizeGroup& fi = popBal_.sizeGroups()[i]; + const phaseModel& phase = fi.phase(); + const volScalarField& rho = phase.rho(); + const tmp<volScalarField> talphat(turbulence_.alphat()); + const volScalarField::Boundary& alphatBf = talphat().boundaryField(); + + typedef compressible::alphatWallBoilingWallFunctionFvPatchScalarField + alphatWallBoilingWallFunction; + + forAll(alphatBf, patchi) + { + if + ( + isA<alphatWallBoilingWallFunction>(alphatBf[patchi]) + ) + { + const alphatWallBoilingWallFunction& alphatw = + refCast<const alphatWallBoilingWallFunction>(alphatBf[patchi]); + + const scalarField& dmdt = alphatw.dmdt(); + const scalarField& dDep = alphatw.dDeparture(); + + const labelList& faceCells = alphatw.patch().faceCells(); + + dimensionedScalar unitLength("unitLength", dimLength, 1.0); + + forAll(alphatw, facei) + { + if (dmdt[facei] > SMALL) + { + const label faceCelli = faceCells[facei]; + + nucleationRate[faceCelli] += + popBal_.gamma + ( + i, + velGroup_.formFactor()*pow3(dDep[facei]*unitLength) + ).value() + *dmdt[facei]/rho[faceCelli]/fi.x().value(); + } + } + } + } +} + + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H new file mode 100644 index 0000000000000000000000000000000000000000..c0d4b1cad208c5736ca13aa619b9d465a16b65f9 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.H @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::nucleationModels::wallBoiling + +Description + Wall-boiling model which requires a velocityGroup (i.e. phase) to be + specified in which the nucleation occurs. This setting must be consistent + with the specifications in the alphatWallBoilingWallFunction. If the + departure-diameter lies outside the diameter-range given by the sizeGroups + of the corresponding velocityGroup, the solver will give a warning and the + nucleation rate will be set to zero. + +SourceFiles + wallBoiling.C + +\*---------------------------------------------------------------------------*/ + +#ifndef wallBoiling_H +#define wallBoiling_H + +#include "nucleationModel.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ +namespace nucleationModels +{ + +/*---------------------------------------------------------------------------*\ + Class wallBoiling Declaration +\*---------------------------------------------------------------------------*/ + +class wallBoiling +: + public nucleationModel +{ + // Private data + + //- Velocity group in which the nucleation occurs + const velocityGroup& velGroup_; + + //- Pointer to turbulence model + const phaseCompressibleTurbulenceModel& turbulence_; + + +public: + + //- Runtime type information + TypeName("wallBoiling"); + + // Constructor + + wallBoiling + ( + const populationBalanceModel& popBal, + const dictionary& dict + ); + + + //- Destructor + virtual ~wallBoiling() + {} + + + // Member Functions + + //- Correct diameter independent expressions + virtual void correct(); + + //- Add to nucleationRate + virtual void addToNucleationRate + ( + volScalarField& nucleationRate, + const label i + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace nucleationModels +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..9c8e8dba275410403dcd5ba07ef5f7890fea1d19 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -0,0 +1,1338 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "populationBalanceModel.H" +#include "coalescenceModel.H" +#include "breakupModel.H" +#include "binaryBreakupModel.H" +#include "driftModel.H" +#include "nucleationModel.H" +#include "phaseSystem.H" +#include "surfaceTensionModel.H" +#include "fvmDdt.H" +#include "fvcDdt.H" +#include "fvmSup.H" +#include "fvcSup.H" +#include "fvcDiv.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +void Foam::diameterModels::populationBalanceModel::registerVelocityGroups() +{ + forAll(fluid_.phases(), phasei) + { + if (isA<velocityGroup>(fluid_.phases()[phasei].dPtr()())) + { + const velocityGroup& velGroup = + refCast<const velocityGroup>(fluid_.phases()[phasei].dPtr()()); + + if (velGroup.popBalName() == this->name()) + { + velocityGroups_.resize(velocityGroups_.size() + 1); + + velocityGroups_.set + ( + velocityGroups_.size() - 1, + &const_cast<velocityGroup&>(velGroup) + ); + + forAll(velGroup.sizeGroups(), i) + { + this->registerSizeGroups + ( + const_cast<sizeGroup&>(velGroup.sizeGroups()[i]) + ); + } + } + } + } +} + + +void Foam::diameterModels::populationBalanceModel::registerSizeGroups +( + sizeGroup& group +) +{ + if + ( + sizeGroups_.size() != 0 + && + group.x().value() <= sizeGroups_.last().x().value() + ) + { + FatalErrorInFunction + << "Size groups must be entered according to their representative" + << " size" + << exit(FatalError); + } + + sizeGroups_.resize(sizeGroups_.size() + 1); + sizeGroups_.set(sizeGroups_.size() - 1, &group); + + // Grid generation over property space + if (sizeGroups_.size() == 1) + { + // Set the first sizeGroup boundary to the representative value of + // the first sizeGroup + v_.append + ( + new dimensionedScalar + ( + "v", + sizeGroups_.last().x() + ) + ); + + // Set the last sizeGroup boundary to the representative size of the + // last sizeGroup + v_.append + ( + new dimensionedScalar + ( + "v", + sizeGroups_.last().x() + ) + ); + } + else + { + // Overwrite the next-to-last sizeGroup boundary to lie halfway between + // the last two sizeGroups + v_.last() = + 0.5 + *( + sizeGroups_[sizeGroups_.size()-2].x() + + sizeGroups_.last().x() + ); + + // Set the last sizeGroup boundary to the representative size of the + // last sizeGroup + v_.append + ( + new dimensionedScalar + ( + "v", + sizeGroups_.last().x() + ) + ); + } + + delta_.append(new PtrList<dimensionedScalar>()); + + Su_.append + ( + new volScalarField + ( + IOobject + ( + "Su", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", inv(dimTime), 0) + ) + ); + + SuSp_.append + ( + new volScalarField + ( + IOobject + ( + "SuSp", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", inv(dimTime), 0) + ) + ); +} + + +void Foam::diameterModels::populationBalanceModel::createPhasePairs() +{ + forAll(velocityGroups_, i) + { + const phaseModel& phasei = velocityGroups_[i].phase(); + + forAll(velocityGroups_, j) + { + const phaseModel& phasej = velocityGroups_[j].phase(); + + if (&phasei != &phasej) + { + const phasePairKey key + ( + phasei.name(), + phasej.name(), + false + ); + + if (!phasePairs_.found(key)) + { + phasePairs_.insert + ( + key, + autoPtr<phasePair> + ( + new phasePair + ( + phasei, + phasej + ) + ) + ); + } + } + } + } +} + + +void Foam::diameterModels::populationBalanceModel::correct() +{ + calcDeltas(); + + forAll(velocityGroups_, v) + { + velocityGroups_[v].preSolve(); + } + + forAll(coalescence_, model) + { + coalescence_[model].correct(); + } + + forAll(breakup_, model) + { + breakup_[model].correct(); + + breakup_[model].dsdPtr()().correct(); + } + + forAll(binaryBreakup_, model) + { + binaryBreakup_[model].correct(); + } + + forAll(drift_, model) + { + drift_[model].correct(); + } + + forAll(nucleation_, model) + { + nucleation_[model].correct(); + } +} + + +void Foam::diameterModels::populationBalanceModel:: +birthByCoalescence +( + const label j, + const label k +) +{ + const sizeGroup& fj = sizeGroups_[j]; + const sizeGroup& fk = sizeGroups_[k]; + + dimensionedScalar Gamma; + dimensionedScalar v = fj.x() + fk.x(); + + for (label i = j; i < sizeGroups_.size(); i++) + { + // Calculate fraction for intra-interval events + Gamma = gamma(i, v); + + if (Gamma.value() == 0) continue; + + const sizeGroup& fi = sizeGroups_[i]; + + // Avoid double counting of events + if (j == k) + { + Sui_ = + 0.5*fi.x()*coalescenceRate_()*Gamma + *fj*fj.phase()/fj.x() + *fk*fk.phase()/fk.x(); + } + else + { + Sui_ = + fi.x()*coalescenceRate_()*Gamma + *fj*fj.phase()/fj.x() + *fk*fk.phase()/fk.x(); + } + + Su_[i] += Sui_; + + const phasePairKey pairij + ( + fi.phase().name(), + fj.phase().name() + ); + + if (pDmdt_.found(pairij)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pairij).key(), pairij) + ); + + pDmdt_[pairij]->ref() += dmdtSign*fj.x()/v*Sui_*fi.phase().rho(); + } + + const phasePairKey pairik + ( + fi.phase().name(), + fk.phase().name() + ); + + if (pDmdt_.found(pairik)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pairik).key(), pairik) + ); + + pDmdt_[pairik]->ref() += dmdtSign*fk.x()/v*Sui_*fi.phase().rho(); + } + } +} + + +void Foam::diameterModels::populationBalanceModel:: +deathByCoalescence +( + const label i, + const label j +) +{ + const sizeGroup& fi = sizeGroups_[i]; + const sizeGroup& fj = sizeGroups_[j]; + + SuSp_[i] += coalescenceRate_()*fi.phase()*fj*fj.phase()/fj.x(); + + if (i != j) + { + SuSp_[j] += coalescenceRate_()*fj.phase()*fi*fi.phase()/fi.x(); + } +} + + +void Foam::diameterModels::populationBalanceModel:: +birthByBreakup +( + const label k, + const label model +) +{ + const sizeGroup& fk = sizeGroups_[k]; + + for (label i = 0; i <= k; i++) + { + const sizeGroup& fi = sizeGroups_[i]; + + Sui_ = + fi.x()*breakupRate_()*breakup_[model].dsdPtr()().nik(i, k) + *fk*fk.phase()/fk.x(); + + Su_[i] += Sui_; + + const phasePairKey pair + ( + fi.phase().name(), + fk.phase().name() + ); + + if (pDmdt_.found(pair)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pair).key(), pair) + ); + + pDmdt_[pair]->ref() += dmdtSign*Sui_*fi.phase().rho(); + } + } +} + + +void Foam::diameterModels::populationBalanceModel::deathByBreakup(const label i) +{ + const sizeGroup& fi = sizeGroups_[i]; + + SuSp_[i] += breakupRate_()*fi.phase(); +} + + +void Foam::diameterModels::populationBalanceModel::calcDeltas() +{ + forAll(sizeGroups_, i) + { + if (delta_[i].empty()) + { + for (label j = 0; j <= sizeGroups_.size() - 1; j++) + { + delta_[i].append + ( + new dimensionedScalar + ( + "delta", + dimVolume, + v_[i+1].value() - v_[i].value() + ) + ); + + if + ( + v_[i].value() < 0.5*sizeGroups_[j].x().value() + && + 0.5*sizeGroups_[j].x().value() < v_[i+1].value() + ) + { + delta_[i][j] = mag(0.5*sizeGroups_[j].x() - v_[i]); + } + else if (0.5*sizeGroups_[j].x().value() <= v_[i].value()) + { + delta_[i][j].value() = 0; + } + } + } + } +} + + +void Foam::diameterModels::populationBalanceModel:: +birthByBinaryBreakup +( + const label i, + const label j +) +{ + const sizeGroup& fj = sizeGroups_[j]; + const sizeGroup& fi = sizeGroups_[i]; + + Sui_ = fi.x()*binaryBreakupRate_()*delta_[i][j]*fj*fj.phase()/fj.x(); + + Su_[i] += Sui_; + + const phasePairKey pairij + ( + fi.phase().name(), + fj.phase().name() + ); + + if (pDmdt_.found(pairij)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pairij).key(), pairij) + ); + + pDmdt_[pairij]->ref() += dmdtSign*Sui_*fi.phase().rho(); + } + + dimensionedScalar Gamma; + dimensionedScalar v = fj.x() - fi.x(); + + for (label k = 0; k <= j; k++) + { + // Calculate fraction for intra-interval events + Gamma = gamma(k, v); + + if (Gamma.value() == 0) continue; + + const sizeGroup& fk = sizeGroups_[k]; + + volScalarField& Suk = Sui_; + + Suk = + sizeGroups_[k].x()*binaryBreakupRate_()*delta_[i][j]*Gamma + *fj*fj.phase()/fj.x(); + + Su_[k] += Suk; + + const phasePairKey pairkj + ( + fk.phase().name(), + fj.phase().name() + ); + + if (pDmdt_.found(pairkj)) + { + const scalar dmdtSign + ( + Pair<word>::compare + ( + pDmdt_.find(pairkj).key(), + pairkj + ) + ); + + pDmdt_[pairkj]->ref() += dmdtSign*Suk*fi.phase().rho(); + } + } +} + + +void Foam::diameterModels::populationBalanceModel:: +deathByBinaryBreakup +( + const label j, + const label i +) +{ + const volScalarField& alphai = sizeGroups_[i].phase(); + + SuSp_[i] += alphai*binaryBreakupRate_()*delta_[j][i]; +} + + +void Foam::diameterModels::populationBalanceModel::drift(const label i) +{ + const sizeGroup& fp = sizeGroups_[i]; + + if (i == 0) + { + rx_() = pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x(); + } + else if (i == sizeGroups_.size() - 1) + { + rx_() = neg(driftRate_())*sizeGroups_[i-1].x()/sizeGroups_[i].x(); + } + else + { + rx_() = + pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x() + + neg(driftRate_())*sizeGroups_[i-1].x()/sizeGroups_[i].x(); + } + + SuSp_[i] += + (neg(1 - rx_()) + neg(rx_() - rx_()/(1 - rx_())))*driftRate_() + *fp.phase()/((rx_() - 1)*fp.x()); + + rx_() *= 0.0; + rdx_() *= 0.0; + + if (i == sizeGroups_.size() - 2) + { + rx_() = pos(driftRate_())*sizeGroups_[i+1].x()/sizeGroups_[i].x(); + + rdx_() = + pos(driftRate_()) + *(sizeGroups_[i+1].x() - sizeGroups_[i].x()) + /(sizeGroups_[i].x() - sizeGroups_[i-1].x()); + } + else if (i < sizeGroups_.size() - 2) + { + rx_() = pos(driftRate_())*sizeGroups_[i+2].x()/sizeGroups_[i+1].x(); + + rdx_() = + pos(driftRate_()) + *(sizeGroups_[i+2].x() - sizeGroups_[i+1].x()) + /(sizeGroups_[i+1].x() - sizeGroups_[i].x()); + } + + if (i == 1) + { + rx_() += neg(driftRate_())*sizeGroups_[i-1].x()/sizeGroups_[i].x(); + + rdx_() += + neg(driftRate_()) + *(sizeGroups_[i].x() - sizeGroups_[i-1].x()) + /(sizeGroups_[i+1].x() - sizeGroups_[i].x()); + } + else if (i > 1) + { + rx_() += neg(driftRate_())*sizeGroups_[i-2].x()/sizeGroups_[i-1].x(); + + rdx_() += + neg(driftRate_()) + *(sizeGroups_[i-1].x() - sizeGroups_[i-2].x()) + /(sizeGroups_[i].x() - sizeGroups_[i-1].x()); + } + + if (i != sizeGroups_.size() - 1) + { + const sizeGroup& fe = sizeGroups_[i+1]; + volScalarField& Sue = Sui_; + + Sue = + pos(driftRate_())*driftRate_()*rdx_() + *fp*fp.phase()/fp.x() + /(rx_() - 1); + + Su_[i+1] += Sue; + + const phasePairKey pairij + ( + fp.phase().name(), + fe.phase().name() + ); + + if (pDmdt_.found(pairij)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pairij).key(), pairij) + ); + + pDmdt_[pairij]->ref() -= dmdtSign*Sue*fp.phase().rho(); + } + } + + if (i != 0) + { + const sizeGroup& fw = sizeGroups_[i-1]; + volScalarField& Suw = Sui_; + + Suw = + neg(driftRate_())*driftRate_()*rdx_() + *fp*fp.phase()/fp.x() + /(rx_() - 1); + + Su_[i-1] += Suw; + + const phasePairKey pairih + ( + fp.phase().name(), + fw.phase().name() + ); + + if (pDmdt_.found(pairih)) + { + const scalar dmdtSign + ( + Pair<word>::compare(pDmdt_.find(pairih).key(), pairih) + ); + + pDmdt_[pairih]->ref() -= dmdtSign*Suw*fp.phase().rho(); + } + } +} + + +void Foam::diameterModels::populationBalanceModel::nucleation(const label i) +{ + Su_[i] += sizeGroups_[i].x()*nucleationRate_(); +} + + +void Foam::diameterModels::populationBalanceModel::sources() +{ + forAll(sizeGroups_, i) + { + Su_[i] *= 0.0; + SuSp_[i] *= 0.0; + } + + forAllConstIter + ( + phasePairTable, + phasePairs(), + phasePairIter + ) + { + pDmdt_(phasePairIter())->ref() *= 0.0; + } + + // Since the calculation of the rates is computationally expensive, + // they are calculated once for each sizeGroup pair and inserted into source + // terms as required + forAll(sizeGroups_, i) + { + const sizeGroup& fi = sizeGroups_[i]; + + if (coalescence_.size() != 0) + { + for (label j = 0; j <= i; j++) + { + const sizeGroup& fj = sizeGroups_[j]; + + if (fi.x() + fj.x() > sizeGroups_.last().x()) break; + + coalescenceRate_() *= 0.0; + + forAll(coalescence_, model) + { + coalescence_[model].addToCoalescenceRate + ( + coalescenceRate_(), + i, + j + ); + } + + birthByCoalescence(i, j); + + deathByCoalescence(i, j); + } + } + + if (breakup_.size() != 0) + { + forAll(breakup_, model) + { + breakup_[model].setBreakupRate(breakupRate_(), i); + + birthByBreakup(i, model); + + deathByBreakup(i); + } + } + + if (binaryBreakup_.size() != 0) + { + label j = 0; + + while (delta_[j][i].value() != 0) + { + binaryBreakupRate_() *= 0.0; + + forAll(binaryBreakup_, model) + { + binaryBreakup_[model].addToBinaryBreakupRate + ( + binaryBreakupRate_(), + j, + i + ); + } + + birthByBinaryBreakup(j, i); + + deathByBinaryBreakup(j, i); + + j++; + } + } + + if (drift_.size() != 0) + { + driftRate_() *= 0.0; + + forAll(drift_, model) + { + drift_[model].addToDriftRate(driftRate_(), i); + } + + drift(i); + } + + if (nucleation_.size() != 0) + { + nucleationRate_() *= 0.0; + + forAll(nucleation_, model) + { + nucleation_[model].addToNucleationRate(nucleationRate_(), i); + } + + nucleation(i); + } + } +} + + +void Foam::diameterModels::populationBalanceModel::dmdt() +{ + forAll(velocityGroups_, v) + { + velocityGroup& velGroup = velocityGroups_[v]; + + velGroup.dmdtRef() *= 0.0; + + forAll(sizeGroups_, i) + { + if (&sizeGroups_[i].phase() == &velGroup.phase()) + { + sizeGroup& fi = sizeGroups_[i]; + + velGroup.dmdtRef() += fi.phase().rho()*(Su_[i] - SuSp_[i]*fi); + } + } + } +} + + +void Foam::diameterModels::populationBalanceModel::calcAlphas() +{ + alphas_() *= 0.0; + + forAll(velocityGroups_, v) + { + const phaseModel& phase = velocityGroups_[v].phase(); + + alphas_() += max(phase, phase.residualAlpha()); + } +} + + +Foam::tmp<Foam::volScalarField> +Foam::diameterModels::populationBalanceModel::calcDsm() +{ + tmp<volScalarField> tInvDsm + ( + volScalarField::New + ( + "invDsm", + mesh_, + dimensionedScalar("zero", inv(dimLength), Zero) + ) + ); + + volScalarField& invDsm = tInvDsm.ref(); + + forAll(velocityGroups_, v) + { + const phaseModel& phase = velocityGroups_[v].phase(); + + invDsm += max(phase, phase.residualAlpha())/(phase.d()*alphas_()); + } + + return 1.0/tInvDsm; +} + + +void Foam::diameterModels::populationBalanceModel::calcVelocity() +{ + U_() *= 0.0; + + forAll(velocityGroups_, v) + { + const phaseModel& phase = velocityGroups_[v].phase(); + + U_() += max(phase, phase.residualAlpha())*phase.U()/alphas_(); + } +} + +bool Foam::diameterModels::populationBalanceModel::updateSources() +{ + const bool result = sourceUpdateCounter_ % sourceUpdateInterval() == 0; + + ++ sourceUpdateCounter_; + + return result; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::populationBalanceModel::populationBalanceModel +( + const phaseSystem& fluid, + const word& name, + HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>& pDmdt +) +: + regIOobject + ( + IOobject + ( + name, + fluid.time().constant(), + fluid.mesh() + ) + ), + fluid_(fluid), + pDmdt_(pDmdt), + mesh_(fluid_.mesh()), + name_(name), + dict_ + ( + fluid_.subDict("populationBalanceCoeffs").subDict(name_) + ), + pimple_(mesh_.lookupObject<pimpleControl>("solutionControl")), + continuousPhase_ + ( + mesh_.lookupObject<phaseModel> + ( + IOobject::groupName("alpha", dict_.get<word>("continuousPhase")) + ) + ), + velocityGroups_(), + sizeGroups_(), + v_(), + delta_(), + Su_(), + SuSp_(), + Sui_ + ( + IOobject + ( + "Sui", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", inv(dimTime), Zero) + ), + coalescence_ + ( + dict_.lookup("coalescenceModels"), + coalescenceModel::iNew(*this) + ), + coalescenceRate_(), + breakup_ + ( + dict_.lookup("breakupModels"), + breakupModel::iNew(*this) + ), + breakupRate_(), + binaryBreakup_ + ( + dict_.lookup("binaryBreakupModels"), + binaryBreakupModel::iNew(*this) + ), + binaryBreakupRate_(), + drift_ + ( + dict_.lookup("driftModels"), + driftModel::iNew(*this) + ), + driftRate_(), + rx_(), + rdx_(), + nucleation_ + ( + dict_.lookup("nucleationModels"), + nucleationModel::iNew(*this) + ), + nucleationRate_(), + alphas_(), + dsm_(), + U_(), + sourceUpdateCounter_ + ( + (mesh_.time().timeIndex()*nCorr())%sourceUpdateInterval() + ) +{ + this->registerVelocityGroups(); + + this->createPhasePairs(); + + if (sizeGroups_.size() < 3) + { + FatalErrorInFunction + << "The populationBalance " << name_ + << " requires a minimum number of three sizeGroups to be specified." + << exit(FatalError); + } + + + if (coalescence_.size() != 0) + { + coalescenceRate_.set + ( + new volScalarField + ( + IOobject + ( + "coalescenceRate", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", dimVolume/dimTime, Zero) + ) + ); + } + + if (breakup_.size() != 0) + { + breakupRate_.set + ( + new volScalarField + ( + IOobject + ( + "breakupRate", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", inv(dimTime), Zero) + ) + ); + } + + if (binaryBreakup_.size() != 0) + { + binaryBreakupRate_.set + ( + new volScalarField + ( + IOobject + ( + "binaryBreakupRate", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "binaryBreakupRate", + inv(dimVolume*dimTime), + Zero + ) + ) + ); + } + + if (drift_.size() != 0) + { + driftRate_.set + ( + new volScalarField + ( + IOobject + ( + "driftRate", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", dimVolume/dimTime, Zero) + ) + ); + + rx_.set + ( + new volScalarField + ( + IOobject + ( + "r", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", dimless, Zero) + ) + ); + + rdx_.set + ( + new volScalarField + ( + IOobject + ( + "r", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("zero", dimless, Zero) + ) + ); + } + + if (nucleation_.size() != 0) + { + nucleationRate_.set + ( + new volScalarField + ( + IOobject + ( + "nucleationRate", + fluid_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "nucleationRate", + inv(dimTime*dimVolume), + Zero + ) + ) + ); + } + + if (velocityGroups_.size() > 1) + { + alphas_.set + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("alpha", this->name()), + fluid_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimless, Zero) + ) + ); + + dsm_.set + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("d", this->name()), + fluid_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimLength, Zero) + ) + ); + + U_.set + ( + new volVectorField + ( + IOobject + ( + IOobject::groupName("U", this->name()), + fluid_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedVector(dimVelocity, Zero) + ) + ); + } +} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::populationBalanceModel::~populationBalanceModel() +{} + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::diameterModels::populationBalanceModel> +Foam::diameterModels::populationBalanceModel::clone() const +{ + notImplemented("populationBalance::clone() const"); + return autoPtr<populationBalanceModel>(nullptr); +} + + +bool Foam::diameterModels::populationBalanceModel::writeData(Ostream& os) const +{ + return os.good(); +} + + +const Foam::dimensionedScalar +Foam::diameterModels::populationBalanceModel::gamma +( + const label i, + const dimensionedScalar& v +) const +{ + dimensionedScalar lowerBoundary(v); + dimensionedScalar upperBoundary(v); + const dimensionedScalar& xi = sizeGroups_[i].x(); + + if (i == 0) + { + lowerBoundary = xi; + } + else + { + lowerBoundary = sizeGroups_[i-1].x(); + } + + if (i == sizeGroups_.size() - 1) + { + upperBoundary = xi; + } + else + { + upperBoundary = sizeGroups_[i+1].x(); + } + + if (v < lowerBoundary || v > upperBoundary) + { + return 0; + } + else if (v.value() <= xi.value()) + { + return (v - lowerBoundary)/(xi - lowerBoundary); + } + else + { + return (upperBoundary - v)/(upperBoundary - xi); + } +} + + +const Foam::tmp<Foam::volScalarField> +Foam::diameterModels::populationBalanceModel::sigmaWithContinuousPhase +( + const phaseModel& dispersedPhase +) const +{ + return + fluid_.lookupSubModel<surfaceTensionModel> + ( + phasePair(dispersedPhase, continuousPhase_) + ).sigma(); +} + + +const Foam::phaseCompressibleTurbulenceModel& +Foam::diameterModels::populationBalanceModel::continuousTurbulence() const +{ + return + mesh_.lookupObject<phaseCompressibleTurbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + continuousPhase_.name() + ) + ); +} + + +void Foam::diameterModels::populationBalanceModel::solve() +{ + const dictionary& solutionControls = mesh_.solverDict(name_); + bool solveOnFinalIterOnly = + solutionControls.lookupOrDefault<bool>("solveOnFinalIterOnly", false); + + if (!solveOnFinalIterOnly || pimple_.finalIter()) + { + const label nCorr = this->nCorr(); + const scalar tolerance = + readScalar(solutionControls.lookup("tolerance")); + + if (nCorr > 0) + { + correct(); + } + + int iCorr = 0; + scalar maxInitialResidual = 1; + + while (++iCorr <= nCorr && maxInitialResidual > tolerance) + { + Info<< "populationBalance " + << this->name() + << ": Iteration " + << iCorr + << endl; + + if (updateSources()) + { + sources(); + } + + dmdt(); + + maxInitialResidual = 0; + + forAll(sizeGroups_, i) + { + sizeGroup& fi = sizeGroups_[i]; + const phaseModel& phase = fi.phase(); + const volScalarField& alpha = phase; + const dimensionedScalar& residualAlpha = phase.residualAlpha(); + const volScalarField& rho = phase.thermo().rho(); + + fvScalarMatrix sizeGroupEqn + ( + fvm::ddt(alpha, rho, fi) + + fi.VelocityGroup().mvConvection()->fvmDiv + ( + phase.alphaRhoPhi(), + fi + ) + - fvm::Sp + ( + fvc::ddt(alpha, rho) + fvc::div(phase.alphaRhoPhi()) + - fi.VelocityGroup().dmdt(), + fi + ) + == + fvc::Su(Su_[i]*rho, fi) + - fvm::SuSp(SuSp_[i]*rho, fi) + + fvc::ddt(residualAlpha*rho, fi) + - fvm::ddt(residualAlpha*rho, fi) + ); + + sizeGroupEqn.relax(); + + maxInitialResidual = max + ( + sizeGroupEqn.solve().initialResidual(), + maxInitialResidual + ); + } + } + + if (nCorr > 0) + { + forAll(velocityGroups_, i) + { + velocityGroups_[i].postSolve(); + } + } + + if (velocityGroups_.size() > 1) + { + calcAlphas(); + dsm_() = calcDsm(); + calcVelocity(); + } + + volScalarField fAlpha0 + ( + sizeGroups_.first()*sizeGroups_.first().phase() + ); + + volScalarField fAlphaN + ( + sizeGroups_.last()*sizeGroups_.last().phase() + ); + + Info<< this->name() << " sizeGroup phase fraction first, last = " + << fAlpha0.weightedAverage(this->mesh().V()).value() + << ' ' << fAlphaN.weightedAverage(this->mesh().V()).value() + << endl; + } +} + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e30c9f36e0f96737b0159767937cb8893b578a72 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.H @@ -0,0 +1,458 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::diameterModels::populationBalanceModel + +Description + Class that solves the univariate population balance equation by means of + a class method (also called sectional or discrete method). The internal + coordinate is set to the particle volume, so the equation is based on + a transport equation of the volume-based number density function. The + discretization is done using the fixed pivot technique of Kumar and + Ramkrishna (1996). The source terms are written in a way that particle + number and mass are preserved. Coalescence (aggregation), breakup, drift + (growth and surface loss) as well as nucleation are supported. + For the discrete breakup term two recipes are available, depending on the + model choice. For models which state a total breakup rate and a separate + daughter size distribution function, the formulation of Kumar and Ramkrishna + (1996) is applied which is applicable for binary and multiple breakup + events. The second formulation is given by Liao et al. (2018). It is useful + for binary breakup models which give the breakup rate between a sizeGroup + pair directly, without an explicit expression for the daughter size + distribution. The drift term is implemented using a finite difference upwind + scheme. Although it is diffusive, it ensures a stable and + number-conservative solution. + + The implementation allows to split the population balance over multiple + velocity fields using the capability of reactingMultiphaseEulerFoam to solve + for n momentum equations. It is also possible to define multiple population + balances, e.g. bubbles and droplets simultaneously. + + References: + \verbatim + Coalescence and breakup term formulation: + Kumar, S., & Ramkrishna, D. (1996). + On the solution of population balance equations by discretization-I. A + fixed pivot technique. + Chemical Engineering Science, 51(8), 1311-1332. + \endverbatim + + \verbatim + Binary breakup term formulation: + Liao, Y., Oertel, R., Kriebitzsch, S., Schlegel, F., & Lucas, D. (2018). + A discrete population balance equation for binary breakage. + International Journal for Numerical Methods in Fluids, 87(4), 202-215. + \endverbatim + +Usage + Example excerpt from a phaseProperties dictionary. + \verbatim + type populationBalanceTwoPhaseSystem; + + phases (air water); + + populationBalances (bubbles); + + air + { + type purePhaseModel; + diameterModel velocityGroup; + velocityGroupCoeffs + { + populationBalance bubbles; + + formFactor 0.5235987756; + + sizeGroups + ( + f0{d 1.00e-3; value 0;} + f1{d 1.08e-3; value 0;} + f2{d 1.16e-3; value 0.25;} + f3{d 1.25e-3; value 0.5;} + f4{d 1.36e-3; value 0.25;} + f5{d 1.46e-3; value 0;} + ... + ); + } + + residualAlpha 1e-6; + } + + populationBalanceCoeffs + { + bubbles + { + continuousPhase water; + + coalescenceModels + ( + hydrodynamic + { + C 0.25; + } + ); + + binaryBreakupModels + (); + + breakupModels + ( + exponential + { + C 0.5; + exponent 0.01; + daughterSizeDistributionModel uniformBinary; + } + ); + + driftModels + ( + densityChange{} + ); + + nucleationModels + (); + } + } + \endverbatim + +See also + Foam::diameterModels::sizeGroup + Foam::diameterModels::velocityGroup + +SourceFiles + populationBalanceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef populationBalanceModel_H +#define populationBalanceModel_H + +#include "sizeGroup.H" +#include "phasePair.H" +#include "pimpleControl.H" +#include "phaseCompressibleTurbulenceModelFwd.H" +#include "HashPtrTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phaseSystem; + +namespace diameterModels +{ + +class coalescenceModel; +class breakupModel; +class binaryBreakupModel; +class driftModel; +class nucleationModel; + +/*---------------------------------------------------------------------------*\ + Class populationBalanceModel Declaration +\*---------------------------------------------------------------------------*/ + +class populationBalanceModel +: + public regIOobject +{ + // Private typedefs + + typedef + HashTable<autoPtr<phasePair>, phasePairKey, phasePairKey::hash> + phasePairTable; + + + // Private data + + //- Reference to the phaseSystem + const phaseSystem& fluid_; + + //- Interfacial Mass transfer rate between velocityGroups + HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>& pDmdt_; + + //- Reference to the mesh + const fvMesh& mesh_; + + //- Name of the populationBalance + word name_; + + //- Dictionary + dictionary dict_; + + //- Reference to pimpleControl + const pimpleControl& pimple_; + + //- Continuous phase + const phaseModel& continuousPhase_; + + //- velocityGroups belonging to this populationBalance + UPtrList<velocityGroup> velocityGroups_; + + //- sizeGroups belonging to this populationBalance + UPtrList<sizeGroup> sizeGroups_; + + //- List of unordered phasePairs in this populationBalance + phasePairTable phasePairs_; + + //- sizeGroup boundaries + PtrList<dimensionedScalar> v_; + + //- Section width required for binary breakup formulation + PtrList<PtrList<dimensionedScalar>> delta_; + + //- Explicitly treated sources + PtrList<volScalarField> Su_; + + //- Sources treated implicitly or explicitly depending on sign + PtrList<volScalarField> SuSp_; + + //- Field for caching sources + volScalarField Sui_; + + //- Coalescence models + PtrList<coalescenceModel> coalescence_; + + //- Coalescence rate + autoPtr<volScalarField> coalescenceRate_; + + //- BreakupModels + PtrList<breakupModel> breakup_; + + //- Breakup rate + autoPtr<volScalarField> breakupRate_; + + //- Binary breakup models + PtrList<binaryBreakupModel> binaryBreakup_; + + //- Binary breakup rate + autoPtr<volScalarField> binaryBreakupRate_; + + //- Drift models + PtrList<driftModel> drift_; + + //- Drift rate + autoPtr<volScalarField> driftRate_; + + //- Ratio between successive representative volumes + autoPtr<volScalarField> rx_; + + //- Ratio between successive class widths + autoPtr<volScalarField> rdx_; + + //- Zeroeth order models + PtrList<nucleationModel> nucleation_; + + //- Zeroeth order rate + autoPtr<volScalarField> nucleationRate_; + + //- Total void fraction + autoPtr<volScalarField> alphas_; + + //- Mean Sauter diameter + autoPtr<volScalarField> dsm_; + + //- Average velocity + autoPtr<volVectorField> U_; + + //- Counter for interval between source term updates + label sourceUpdateCounter_; + + + // Private member functions + + void registerVelocityGroups(); + + void registerSizeGroups(sizeGroup& group); + + void createPhasePairs(); + + void correct(); + + void birthByCoalescence(const label j, const label k); + + void deathByCoalescence(const label i, const label j); + + void birthByBreakup(const label k, const label model); + + void deathByBreakup(const label i); + + void calcDeltas(); + + void birthByBinaryBreakup(const label i, const label j); + + void deathByBinaryBreakup(const label j, const label i); + + void drift(const label i); + + void nucleation(const label i); + + void sources(); + + void dmdt(); + + void calcAlphas(); + + tmp<volScalarField> calcDsm(); + + void calcVelocity(); + + //- Return whether the sources should be updated on this iteration + bool updateSources(); + + //- Return the number of corrections + inline label nCorr() const; + + //- Return the interval at which the sources are updated + inline label sourceUpdateInterval() const; + +public: + + friend class sizeGroup; + friend class velocityGroup; + + // Constructor + + populationBalanceModel + ( + const phaseSystem& fluid, + const word& name, + HashPtrTable + < + volScalarField, + phasePairKey, + phasePairKey::hash + >& pDmdt + ); + + //- Return clone + autoPtr<populationBalanceModel> clone() const; + + //- Return a pointer to a new populationBalanceModel object created on + // freestore from Istream + class iNew + { + const phaseSystem& fluid_; + + HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>& + pDmdt_; + + public: + + iNew + ( + const phaseSystem& fluid, + HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>& + pDmdt + ) + : + fluid_(fluid), + pDmdt_(pDmdt) + {} + + autoPtr<populationBalanceModel> operator()(Istream& is) const + { + return autoPtr<populationBalanceModel> + ( + new populationBalanceModel(fluid_, word(is), pDmdt_) + ); + } + }; + + + //- Destructor + virtual ~populationBalanceModel(); + + // Member Functions + + //- Dummy write for regIOobject + bool writeData(Ostream&) const; + + //- Return reference to the phaseSystem + inline const phaseSystem& fluid() const; + + //- Return reference to the mesh + inline const fvMesh& mesh() const; + + //- Return populationBalanceCoeffs dictionary + inline const dictionary& dict() const; + + //- Return continuous phase + inline const phaseModel& continuousPhase() const; + + //- Return the velocityGroups belonging to this populationBalance + inline const UPtrList<velocityGroup>& velocityGroups() const; + + //- Return the sizeGroups belonging to this populationBalance + inline const UPtrList<sizeGroup>& sizeGroups() const; + + //- Return list of unordered phasePairs in this populationBalance + inline const phasePairTable& phasePairs() const; + + //- Return the sizeGroup boundaries + inline const PtrList<dimensionedScalar>& v() const; + + //- Return total void of phases belonging to this populationBalance + inline const volScalarField& alphas() const; + + //- Return average velocity + inline const volVectorField& U() const; + + //- Return allocation coefficient + const dimensionedScalar gamma + ( + const label i, + const dimensionedScalar& v + ) const; + + //- Return the surface tension coefficient between a given dispersed + // and the continuous phase + const tmp<volScalarField> sigmaWithContinuousPhase + ( + const phaseModel& dispersedPhase + ) const; + + //- Return reference to turbulence model of the continuous phase + const phaseCompressibleTurbulenceModel& continuousTurbulence() const; + + //- Solve the population balance equation + void solve(); +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "populationBalanceModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModelI.H b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModelI.H new file mode 100644 index 0000000000000000000000000000000000000000..1de910ecf4c4033d00e7baa66bb0554fe7b78e29 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModelI.H @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-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/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +inline Foam::label Foam::diameterModels::populationBalanceModel::nCorr() const +{ + return mesh_.solverDict(name_).lookupType<label>("nCorr"); +} + + +inline Foam::label +Foam::diameterModels::populationBalanceModel::sourceUpdateInterval() const +{ + return + mesh_.solverDict(name_) + .lookupOrDefault<label>("sourceUpdateInterval", 1); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::phaseSystem& +Foam::diameterModels::populationBalanceModel::fluid() const +{ + return fluid_; +} + + +inline const Foam::fvMesh& +Foam::diameterModels::populationBalanceModel::mesh() const +{ + return mesh_; +} + + +inline const Foam::dictionary& +Foam::diameterModels::populationBalanceModel::dict() const +{ + return dict_; +} + + +inline const Foam::phaseModel& +Foam::diameterModels::populationBalanceModel::continuousPhase() const +{ + return continuousPhase_; +} + + +inline const Foam::UPtrList<Foam::diameterModels::velocityGroup>& +Foam::diameterModels::populationBalanceModel::velocityGroups() const +{ + return velocityGroups_; +} + + +inline const Foam::UPtrList<Foam::diameterModels::sizeGroup>& +Foam::diameterModels::populationBalanceModel::sizeGroups() const +{ + return sizeGroups_; +} + + +inline const Foam::diameterModels::populationBalanceModel::phasePairTable& +Foam::diameterModels::populationBalanceModel::phasePairs() const +{ + return phasePairs_; +} + + +inline const Foam::PtrList<Foam::dimensionedScalar>& +Foam::diameterModels::populationBalanceModel::v() const +{ + return v_; +} + + +inline const Foam::volScalarField& +Foam::diameterModels::populationBalanceModel::alphas() const +{ + if (velocityGroups_.size() > 1) + { + return alphas_(); + } + else + { + return velocityGroups_.first().phase(); + } +} + + +inline const Foam::volVectorField& +Foam::diameterModels::populationBalanceModel::U() const +{ + if (velocityGroups_.size() > 1) + { + return U_(); + } + else + { + return velocityGroups_.first().phase().U(); + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C rename to src/phaseSystemModels/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C index 793c55973b433350e5834d2f1dd7b8a0720ea5de..d6be07a8b7ad68e767693b2dbbc9adb8906afc53 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015-2017 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,6 +39,7 @@ License #include "sensibleEnthalpy.H" #include "hRefConstThermo.H" +#include "eRefConstThermo.H" #include "constTransport.H" @@ -88,7 +89,7 @@ constTransport < species::thermo < - hRefConstThermo + eRefConstThermo < perfectGas<specie> >, @@ -101,7 +102,7 @@ constTransport < species::thermo < - hRefConstThermo + eRefConstThermo < perfectFluid<specie> >, @@ -114,7 +115,7 @@ constTransport < species::thermo < - hRefConstThermo + eRefConstThermo < rhoConst<specie> >, @@ -184,7 +185,7 @@ makeThermos pureMixture, constTransport, sensibleInternalEnergy, - hRefConstThermo, + eRefConstThermo, perfectGas, specie ); @@ -196,7 +197,7 @@ makeThermos pureMixture, constTransport, sensibleInternalEnergy, - hRefConstThermo, + eRefConstThermo, perfectFluid, specie ); @@ -208,7 +209,7 @@ makeThermos pureMixture, constTransport, sensibleInternalEnergy, - hRefConstThermo, + eRefConstThermo, rhoConst, specie ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/files b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/files similarity index 100% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/files rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/files diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..bff40b7c90d2b34338e93b821e378720feea2183 --- /dev/null +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options @@ -0,0 +1,26 @@ +EXE_INC = \ + -I../multiphaseSystem/lnInclude \ + -I../../phaseSystems/lnInclude \ + -I../../interfacialModels/lnInclude\ + -I../../interfacialCompositionModels/lnInclude \ + -I../../derivedFvPatchFields/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lreactingPhaseSystem \ + -lreactingMultiphaseSystem \ + -lreactingEulerianInterfacialModels \ + -lreactingEulerianInterfacialCompositionModels \ + -lreactingEulerianFvPatchFields \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C index 2a86b6fa402a5605a8356d7618da1df11c050ba9..708a0f0a8bdf21cdaefbf5a454111e976743e042 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/files b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/files similarity index 100% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/files rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/files diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options index 2ba7197d42d49e09cb0c86b4818fa4b796d0fefa..e5d6829d5659ef87d9f25f5801ce253e2074b973 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options @@ -2,6 +2,8 @@ EXE_INC = \ -I../../interfacialModels/lnInclude \ -I../../interfacialCompositionModels/lnInclude \ -I../../phaseSystems/lnInclude \ + -I../multiphaseCompressibleTurbulenceModels/lnInclude \ + -I../../derivedFvPatchFields/lnInclude \ -IalphaContactAngle \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 31e9320a0eae0ae83e66c62d7aa1d0762a2b4f74..b7007758eefa32ea158751227d0ff5cf94c3c482 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index 091b1632c24103b7d14ffb5cedfe826905afda31..8d2f8c17c233cee04685aea7eaf5d59cb857ba6a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,7 @@ Class Description Contact-angle boundary condition for multi-phase interface-capturing - simulations. Used in conjuction with multiphaseSystem. + simulations. Used in conjunction with multiphaseSystem. SourceFiles alphaContactAngleFvPatchScalarField.C @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class alphaContactAngleFvPatch Declaration + Class alphaContactAngleFvPatch Declaration \*---------------------------------------------------------------------------*/ class alphaContactAngleFvPatchScalarField diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C similarity index 76% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 9cefda2dfae903932eae82dba98f7e5447d4d8a9..797ac8f6ce97a6123bddfb9a59ad2caf470e21d9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2017 OpenFOAM Foundation + | Copyright (C) 2013-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,7 @@ License #include "MULES.H" #include "subCycle.H" +#include "UniformField.H" #include "fvcDdt.H" #include "fvcDiv.H" @@ -42,8 +43,6 @@ License #include "fvmLaplacian.H" #include "fvmSup.H" -#include "unitConversion.H" - // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // namespace Foam @@ -52,6 +51,9 @@ namespace Foam defineRunTimeSelectionTable(multiphaseSystem, dictionary); } +const Foam::scalar Foam::multiphaseSystem::convertToRad = + Foam::constant::mathematical::pi/180.0; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -70,36 +72,73 @@ void Foam::multiphaseSystem::calcAlphas() void Foam::multiphaseSystem::solveAlphas() { - bool LTS = fv::localEulerDdt::enabled(mesh_); - for (phaseModel& phase : phases()) { phase.correctBoundaryConditions(); } - PtrList<surfaceScalarField> alphaPhiCorrs(phases().size()); + // Calculate the void fraction + volScalarField alphaVoid + ( + IOobject + ( + "alphaVoid", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("one", dimless, 1) + ); + for (const phaseModel& phase : stationaryPhases()) + { + alphaVoid -= phase; + } - label phasei = 0; - for (phaseModel& phase : phases()) + // Generate face-alphas + PtrList<surfaceScalarField> alphafs(phases().size()); + forAll(phases(), phasei) { - volScalarField& alpha1 = phase; + phaseModel& phase = phases()[phasei]; + alphafs.set + ( + phasei, + new surfaceScalarField + ( + IOobject::groupName("alphaf", phase.name()), + upwind<scalar>(mesh_, phi_).interpolate(phase) + ) + ); + } + // Create correction fluxes + PtrList<surfaceScalarField> alphaPhiCorrs(phases().size()); + for (const phaseModel& phase : stationaryPhases()) + { alphaPhiCorrs.set ( - phasei, + phase.index(), new surfaceScalarField ( - "phi" + alpha1.name() + "Corr", - fvc::flux - ( - phi_, - phase, - "div(phi," + alpha1.name() + ')' - ) + IOobject::groupName("alphaPhiCorr", phase.name()), + - upwind<scalar>(mesh_, phi_).flux(phase) + ) + ); + } + for (const phaseModel& phase : movingPhases()) + { + const volScalarField& alpha = phase; + + alphaPhiCorrs.set + ( + phase.index(), + new surfaceScalarField + ( + IOobject::groupName("alphaPhiCorr", phase.name()), + fvc::flux(phi_, phase, "div(phi," + alpha.name() + ')') ) ); - surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei]; + surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phase.index()]; for (const phaseModel& phase2 : phases()) { @@ -124,7 +163,7 @@ void Foam::multiphaseSystem::solveAlphas() const word phirScheme ( - "div(phir," + alpha2.name() + ',' + alpha1.name() + ')' + "div(phir," + alpha2.name() + ',' + alpha.name() + ')' ); alphaPhiCorr += fvc::flux @@ -137,67 +176,34 @@ void Foam::multiphaseSystem::solveAlphas() phase.correctInflowOutflow(alphaPhiCorr); - if (LTS) - { - MULES::limit - ( - fv::localEulerDdt::localRDeltaT(mesh_), - geometricOneField(), - phase, - phi_, - alphaPhiCorr, - zeroField(), - zeroField(), - phase.alphaMax(), - 0, - true - ); - } - else - { - const scalar rDeltaT = 1.0/mesh_.time().deltaTValue(); - - MULES::limit - ( - rDeltaT, - geometricOneField(), - phase, - phi_, - alphaPhiCorr, - zeroField(), - zeroField(), - phase.alphaMax(), - 0, - true - ); - } - - ++phasei; - } - - MULES::limitSum(alphaPhiCorrs); - - volScalarField sumAlpha - ( - IOobject + MULES::limit ( - "sumAlpha", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar(dimless, Zero) - ); - + geometricOneField(), + phase, + phi_, + alphaPhiCorr, + zeroField(), + zeroField(), + min(alphaVoid.primitiveField(), phase.alphaMax())(), + zeroField(), + true + ); + } - volScalarField divU(fvc::div(fvc::absolute(phi_, phases().first().U()))); + // Limit the flux sums, fixing those of the stationary phases + labelHashSet fixedAlphaPhiCorrs; + for (const phaseModel& phase : stationaryPhases()) + { + fixedAlphaPhiCorrs.insert(phase.index()); + } + MULES::limitSum(alphafs, alphaPhiCorrs, fixedAlphaPhiCorrs); - forAll(phases(), phasei) + // Solve for the moving phase alphas + for (phaseModel& phase : movingPhases()) { - phaseModel& phase = phases()[phasei]; volScalarField& alpha = phase; - surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei]; + surfaceScalarField& alphaPhi = alphaPhiCorrs[phase.index()]; alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase); phase.correctInflowOutflow(alphaPhi); @@ -210,20 +216,13 @@ void Foam::multiphaseSystem::solveAlphas() mesh_ ), mesh_, - dimensionedScalar(divU.dimensions(), Zero) + dimensionedScalar(dimless/dimTime) ); volScalarField::Internal Su ( - IOobject - ( - "Su", - mesh_.time().timeName(), - mesh_ - ), - // Divergence term is handled explicitly to be - // consistent with the explicit transport solution - divU*min(alpha, scalar(1)) + "Su", + min(alpha, scalar(1))*fvc::div(fvc::absolute(phi_, phase.U())) ); if (phase.divU().valid()) @@ -241,7 +240,7 @@ void Foam::multiphaseSystem::solveAlphas() { Sp[celli] += dgdt[celli] - *(1.0 - alpha[celli])/max(alpha[celli], 1e-4); + *(1 - alpha[celli])/max(alpha[celli], 1e-4); } } } @@ -262,7 +261,7 @@ void Foam::multiphaseSystem::solveAlphas() { Sp[celli] += dgdt2[celli] - *(1.0 - alpha2[celli])/max(alpha2[celli], 1e-4); + *(1 - alpha2[celli])/max(alpha2[celli], 1e-4); Su[celli] -= dgdt2[celli] @@ -285,29 +284,45 @@ void Foam::multiphaseSystem::solveAlphas() Su ); - phase.alphaPhi() = alphaPhi; + phase.alphaPhiRef() = alphaPhi; + } - Info<< phase.name() << " volume fraction, min, max = " + // Report the phase fractions and the phase fraction sum + for (phaseModel& phase : phases()) + { + Info<< phase.name() << " fraction, min, max = " << phase.weightedAverage(mesh_.V()).value() << ' ' << min(phase).value() << ' ' << max(phase).value() << endl; + } - sumAlpha += phase; + volScalarField sumAlphaMoving + ( + IOobject + ( + "sumAlphaMoving", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar(dimless) + ); + for (const phaseModel& phase : movingPhases()) + { + sumAlphaMoving += phase; } Info<< "Phase-sum volume fraction, min, max = " - << sumAlpha.weightedAverage(mesh_.V()).value() - << ' ' << min(sumAlpha).value() - << ' ' << max(sumAlpha).value() + << (sumAlphaMoving + 1 - alphaVoid)().weightedAverage(mesh_.V()).value() + << ' ' << min(sumAlphaMoving + 1 - alphaVoid).value() + << ' ' << max(sumAlphaMoving + 1 - alphaVoid).value() << endl; - // Correct the sum of the phase-fractions to avoid 'drift' - volScalarField sumCorr(1.0 - sumAlpha); - for (phaseModel& phase : phases()) + // Correct the sum of the phase fractions to avoid drift + for (phaseModel& phase : movingPhases()) { - volScalarField& alpha = phase; - alpha += alpha*sumCorr; + phase *= alphaVoid/sumAlphaMoving; } } @@ -398,7 +413,7 @@ void Foam::multiphaseSystem::correctContactAngle const 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(); @@ -406,8 +421,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 @@ -447,7 +462,7 @@ void Foam::multiphaseSystem::correctContactAngle b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det(1.0 - a12*a12); + scalarField det(1 - a12*a12); scalarField a((b1 - a12*b2)/det); scalarField b((b2 - a12*b1)/det); @@ -495,7 +510,7 @@ Foam::multiphaseSystem::multiphaseSystem IOobject::AUTO_WRITE ), mesh, - dimensionedScalar(dimless, Zero) + dimensionedScalar(dimless) ), cAlphas_(lookup("interfaceCompression")), @@ -523,16 +538,11 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension { tmp<surfaceScalarField> tSurfaceTension ( - new surfaceScalarField + surfaceScalarField::New ( - IOobject - ( - "surfaceTension", - mesh_.time().timeName(), - mesh_ - ), + "surfaceTension", mesh_, - dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero) + dimensionedScalar(dimensionSet(1, -2, -2, 0, 0)) ) ); @@ -557,6 +567,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension } } } + tSurfaceTension->setOriented(); return tSurfaceTension; } @@ -567,16 +578,11 @@ Foam::multiphaseSystem::nearInterface() const { tmp<volScalarField> tnearInt ( - new volScalarField + volScalarField::New ( - IOobject - ( - "nearInterface", - mesh_.time().timeName(), - mesh_ - ), + "nearInterface", mesh_, - dimensionedScalar(dimless, Zero) + dimensionedScalar(dimless) ) ); @@ -598,7 +604,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"))); bool LTS = fv::localEulerDdt::enabled(mesh_); @@ -612,7 +618,7 @@ void Foam::multiphaseSystem::solve() fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles); } - PtrList<volScalarField> alpha0s(phases().size()); + List<volScalarField*> alphaPtrs(phases().size()); PtrList<surfaceScalarField> alphaPhiSums(phases().size()); label phasei = 0; @@ -620,11 +626,7 @@ void Foam::multiphaseSystem::solve() { volScalarField& alpha = phase; - alpha0s.set - ( - phasei, - new volScalarField(alpha.oldTime()) - ); + alphaPtrs[phasei] = α alphaPhiSums.set ( @@ -638,7 +640,7 @@ void Foam::multiphaseSystem::solve() mesh_ ), mesh_, - dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero) + dimensionedScalar(dimensionSet(0, 3, -1, 0, 0)) ) ); @@ -669,19 +671,9 @@ void Foam::multiphaseSystem::solve() phasei = 0; for (phaseModel& phase : phases()) { - volScalarField& alpha = phase; - - phase.alphaPhi() = alphaPhiSums[phasei]/nAlphaSubCycles; - - // Correct the time index of the field - // to correspond to the global time - alpha.timeIndex() = runTime.timeIndex(); + if (phase.stationary()) continue; - // Reset the old-time field value - alpha.oldTime() = alpha0s[phasei]; - alpha.oldTime().timeIndex() = runTime.timeIndex(); - - ++phasei; + phase.alphaPhiRef() = alphaPhiSums[phasei]/nAlphaSubCycles; } } else @@ -691,7 +683,10 @@ void Foam::multiphaseSystem::solve() for (phaseModel& phase : phases()) { - phase.alphaRhoPhi() = fvc::interpolate(phase.rho())*phase.alphaPhi(); + if (phase.stationary()) continue; + + phase.alphaRhoPhiRef() = + fvc::interpolate(phase.rho())*phase.alphaPhi(); // Ensure the phase-fractions are bounded phase.clip(0, 1); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H similarity index 69% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index 9b04d1c01c3ee17cadda9f920a7d97f571fb3c97..45156b47bd1b286756b08bf0fd174cf34ace5dc4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,18 +55,29 @@ class multiphaseSystem : public phaseSystem { - // Private data +private: - volScalarField alphas_; + // Private typedefs typedef HashTable<scalar, phasePairKey, phasePairKey::hash> cAlphaTable; + + // Private data + + //- The indexed phase-fraction field; e.g., 1 for water, 2 for air, 3 + // for oil, etc... + volScalarField alphas_; + + //- cAlphaTable cAlphas_; //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; + //- Conversion factor for degrees into radians + static const scalar convertToRad; + // Private member functions @@ -99,25 +110,21 @@ class multiphaseSystem const phaseModel& alpha2 ) const; - //- Return the drag coefficient for phase pair virtual tmp<volScalarField> Kd(const phasePairKey& key) const = 0; - //- Return the face drag coefficient for phase pair - virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const = 0; - //- Return the virtual mass coefficient for phase pair virtual tmp<volScalarField> Vm(const phasePairKey& key) const = 0; - //- Return the face virtual mass coefficient for phase pair - virtual tmp<surfaceScalarField> Vmf(const phasePairKey& key) const = 0; - //- Return the turbulent diffusivity for phase pair - // Multiplies the phase-fraction gradient - virtual tmp<volScalarField> D(const phasePairKey& key) const = 0; +protected: - //- Return the interfacial mass flow rate for phase pair - virtual tmp<volScalarField> dmdt(const phasePairKey& key) const = 0; + // Protected data + + //- Flag to indicate that returned lists of fields are "complete"; i.e., + // that an absence of force is returned as a constructed list of zeros, + // rather than a null pointer + static const bool fillFields_ = false; public: @@ -159,36 +166,10 @@ public: // Member Functions - //- Return the drag coefficient for all phase-pairs - virtual const phaseSystem::KdTable& Kds() const = 0; - - //- Return the drag coefficient for phase - virtual tmp<volScalarField> Kd(const phaseModel& phase) const = 0; - - //- Return the combined force (lift + wall-lubrication) for phase pair - virtual autoPtr<PtrList<Foam::volVectorField>> Fs() const = 0; - - //- Return the turbulent dispersion force on faces for phase pair - virtual autoPtr<PtrList<Foam::surfaceScalarField>> phiDs - ( - const PtrList<volScalarField>& rAUs - ) const = 0; - - //- Return true if there is mass transfer for phase - virtual bool transfersMass(const phaseModel& phase) const = 0; - - //- Return the total interfacial mass transfer rate for phase - virtual tmp<volScalarField> dmdt(const phaseModel& phase) const = 0; - - //- Return the momentum transfer matrices - virtual autoPtr<momentumTransferTable> momentumTransfer() const = 0; - - //- Return the heat transfer matrices - virtual autoPtr<heatTransferTable> heatTransfer() const = 0; - - //- Return the mass transfer matrices - virtual autoPtr<massTransferTable> massTransfer() const = 0; + using phaseSystem::sigma; + using phaseSystem::dmdts; + //- Return the surface tension force tmp<surfaceScalarField> surfaceTension(const phaseModel& phase) const; //- Indicator of the proximity of the interface diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C similarity index 52% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C index 259fc905bc51a28311b2c5eccd87cbe5d69cac36..23161e16fa887323b1abfe90ca73e73a9367eb1d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystems.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,7 +30,10 @@ License #include "phaseSystem.H" #include "multiphaseSystem.H" #include "MomentumTransferPhaseSystem.H" -#include "HeatTransferPhaseSystem.H" +#include "OneResistanceHeatTransferPhaseSystem.H" +#include "TwoResistanceHeatTransferPhaseSystem.H" +#include "PhaseTransferPhaseSystem.H" +#include "PopulationBalancePhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H" @@ -39,24 +42,33 @@ License namespace Foam { typedef - HeatTransferPhaseSystem + PhaseTransferPhaseSystem < - MomentumTransferPhaseSystem<multiphaseSystem> + OneResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<multiphaseSystem> + > > - heatAndMomentumTransferMultiphaseSystem; + basicMultiphaseSystem; addNamedToRunTimeSelectionTable ( multiphaseSystem, - heatAndMomentumTransferMultiphaseSystem, + basicMultiphaseSystem, dictionary, - heatAndMomentumTransferMultiphaseSystem + basicMultiphaseSystem ); typedef InterfaceCompositionPhaseChangePhaseSystem < - MomentumTransferPhaseSystem<multiphaseSystem> + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<multiphaseSystem> + > + > > interfaceCompositionPhaseChangeMultiphaseSystem; @@ -71,7 +83,13 @@ namespace Foam typedef ThermalPhaseChangePhaseSystem < - MomentumTransferPhaseSystem<multiphaseSystem> + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<multiphaseSystem> + > + > > thermalPhaseChangeMultiphaseSystem; @@ -82,6 +100,51 @@ namespace Foam dictionary, thermalPhaseChangeMultiphaseSystem ); + + typedef + PopulationBalancePhaseSystem + < + PhaseTransferPhaseSystem + < + OneResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<multiphaseSystem> + > + > + > + populationBalanceMultiphaseSystem; + + addNamedToRunTimeSelectionTable + ( + multiphaseSystem, + populationBalanceMultiphaseSystem, + dictionary, + populationBalanceMultiphaseSystem + ); + + typedef + ThermalPhaseChangePhaseSystem + < + PopulationBalancePhaseSystem + < + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<multiphaseSystem> + > + > + > + > + thermalPhaseChangePopulationBalanceMultiphaseSystem; + + addNamedToRunTimeSelectionTable + ( + multiphaseSystem, + thermalPhaseChangePopulationBalanceMultiphaseSystem, + dictionary, + thermalPhaseChangePopulationBalanceMultiphaseSystem + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C rename to src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C index 5be990aaba8af6f585018f8a67de13c5ba8caf3a..078e37b25da3f1400ece777adf0d05fffd7bcc4f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/newMultiphaseSystem.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,7 +34,7 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New const fvMesh& mesh ) { - const word systemType + const word multiphaseSystemType ( IOdictionary ( @@ -47,19 +47,21 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New IOobject::NO_WRITE, false ) - ).get<word>("type") + ).lookup("type") ); - Info<< "Selecting multiphaseSystem " << systemType << endl; + Info<< "Selecting multiphaseSystem " + << multiphaseSystemType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(multiphaseSystemType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown multiphaseSystem type " - << systemType << nl << nl - << "Valid multiphaseSystem types :" << endl + << "Unknown multiphaseSystemType type " + << multiphaseSystemType << endl << endl + << "Valid multiphaseSystem types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files similarity index 51% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files index 4b0a2cd0af0731203d8e0e932173adecf1388e35..9b7775fb0d8719ac37b3b8685683e96835dd5b42 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files @@ -36,33 +36,5 @@ kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJackson kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/partitioningModel.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/partitioningModel/newPartitioningModel.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/phaseFraction/phaseFraction.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C -derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C - -derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.C -derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/newNucleationSiteModel.C -derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C - -derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.C -derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/newDepartureDiameterModel.C -derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C -derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C - -derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/departureFrequencyModel.C -derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/departureFrequencyModel/newDepartureFrequencyModel.C -derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/Cole/Cole.C - -derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.C - -derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C -derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C -derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C -derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C -derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C - LIB = $(FOAM_LIBBIN)/libtwoPhaseReactingTurbulenceModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options similarity index 85% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options index 37c92b4a70b9ab48c41ef635fb8739f5ab31dc25..25b42cbee04572a0d1d656a976371a5905317069 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options @@ -1,10 +1,11 @@ EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I../twoPhaseSystem/lnInclude \ -I../../phaseSystems/lnInclude \ -I../../interfacialModels/lnInclude\ -I../../interfacialCompositionModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ + -I../../derivedFvPatchFields/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ @@ -16,8 +17,8 @@ LIB_LIBS = \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ - -lcompressibleTurbulenceModels \ -lreactingPhaseSystem \ -lreactingTwoPhaseSystem \ -lreactingEulerianInterfacialModels \ - -lreactingEulerianInterfacialCompositionModels + -lreactingEulerianInterfacialCompositionModels \ + -lreactingEulerianFvPatchFields diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C index 6a3cc03f69324206ce76b6e48961993433fa1a7d..92bdd59afdc972f22dc14f90f35c19039d72cd5a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -84,10 +84,10 @@ Foam::kineticTheoryModels::conductivityModels::Gidaspow::kappa return rho1*da*sqrt(Theta)* ( - 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (9.0/8.0)*sqrtPi*g0*0.5*(1.0 + e)*sqr(alpha1) + 2*sqr(alpha1)*g0*(1 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*g0*0.5*(1 + e)*sqr(alpha1) + (15.0/16.0)*sqrtPi*alpha1 - + (25.0/64.0)*sqrtPi/((1.0 + e)*g0) + + (25.0/64.0)*sqrtPi/((1 + e)*g0) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H index 3b4fbef9b17e1d6e5206e13c7562df0d6adfc8bf..02a053e09c71fc6dca26d359c23f73fab9e1c2d8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Gidaspow_H -#define Gidaspow_H +#ifndef GidaspowConductivity_H +#define GidaspowConductivity_H #include "conductivityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 9c3eb4459cbd2fd41b7803d6e25eb4d895700553..e9956751806c3b3486bc28ee742adc492af8a3fd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -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. @@ -87,18 +87,18 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa volScalarField lamda ( - scalar(1) + da/(6.0*sqrt(2.0)*(alpha1 + scalar(1.0e-5)))/L_ + scalar(1) + da/(6*sqrt(2.0)*(alpha1 + 1e-5))/L_ ); return rho1*da*sqrt(Theta)* ( - 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) - /(49.0/16.0 - 33.0*e/16.0) + 2*sqr(alpha1)*g0*(1 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1 + e)*(2*e - 1)*sqr(alpha1) + /(49.0/16.0 - 33*e/16.0) + (15.0/16.0)*sqrtPi*alpha1*(0.5*sqr(e) + 0.25*e - 0.75 + lamda) - /((49.0/16.0 - 33.0*e/16.0)*lamda) + /((49.0/16.0 - 33*e/16.0)*lamda) + (25.0/64.0)*sqrtPi - /((1.0 + e)*(49.0/16.0 - 33.0*e/16.0)*lamda*g0) + /((1 + e)*(49.0/16.0 - 33*e/16.0)*lamda*g0) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H index 58c7aa4ba35f2fe06bcda13610875ce9cf78bb2a..dd8149d1a587c1a01c38eddc7e4ba4e85ea34a2c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef HrenyaSinclair_H -#define HrenyaSinclair_H +#ifndef HrenyaSinclairConductivity_H +#define HrenyaSinclairConductivity_H #include "conductivityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C index 50afdbc890a97a83882a73aa9206aa3828d0f8b6..e93b549f89a1b5175419c1ce7031049659d8e9a8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -84,10 +84,10 @@ Foam::kineticTheoryModels::conductivityModels::Syamlal::kappa return rho1*da*sqrt(Theta)* ( - 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) - /(49.0/16.0 - 33.0*e/16.0) - + (15.0/32.0)*sqrtPi*alpha1/(49.0/16.0 - 33.0*e/16.0) + 2*sqr(alpha1)*g0*(1 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1 + e)*(2*e - 1)*sqr(alpha1) + /(49.0/16.0 - 33*e/16.0) + + (15.0/32.0)*sqrtPi*alpha1/(49.0/16.0 - 33*e/16.0) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H index a7dc05ff38032ccf9e70ac9ca56c3868764f7ee6..4dfa83a4a758707a643719eef53d61c6890abc6f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Syamlal_H -#define Syamlal_H +#ifndef SyamlalConductivity_H +#define SyamlalConductivity_H #include "conductivityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C index 0db5c7524d139c847a364a192c3a3dd07473c471..36182aa8ad1d375618e76d37ac318884f0b92417 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H index 7e3a3c250691080b78e9b12c62929d008d334a58..0095be8f38d907d4aa571c0ebf9c1299ba9f5d56 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,11 +54,11 @@ class conductivityModel { // Private member functions - //- No copy construct - conductivityModel(const conductivityModel&) = delete; + //- Disallow default bitwise copy construct + conductivityModel(const conductivityModel&); - //- No copy assignment - void operator=(const conductivityModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const conductivityModel&); protected: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C similarity index 67% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index 43ae3eb16c692395622759723b3930509da1a296..fdc7adb282b961ff036417e18d0c87845ce02b1e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,20 +35,23 @@ Foam::kineticTheoryModels::conductivityModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("conductivityModel")); + word conductivityModelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " << modelType << endl; + Info<< "Selecting conductivityModel " + << conductivityModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(conductivityModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorInFunction - << "Unknown conductivityModel type " - << modelType << nl << nl - << "Valid conductivityModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalError + << "conductivityModel::New(const dictionary&) : " << endl + << " unknown conductivityModelType type " + << conductivityModelType + << ", constructor not in hash table" << endl << endl + << " Valid conductivityModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr<conductivityModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index cbe4ee9e0309b5811e79b05fe4b56b3477617551..f8702f34a4c9a80f457703d2b33916ec2052493e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -225,8 +225,8 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() *alpha *gs0 *specularityCoefficient_.value() - *sqrt(3.0*Theta) - /max(6.0*(nu - nuFric)*alphaMax.value(), SMALL) + *sqrt(3*Theta) + /max(6*(nu - nuFric)*alphaMax.value(), SMALL) ); this->valueFraction() = c/(c + patch().deltaCoeffs()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H index 988615cc3d699a20e4ed4fcfcaa93166c696ab00..a63b1db0004ede97c9d3f60d3e9a4a5a8d7a7f17 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,19 +31,18 @@ Description References: \verbatim - "Multifluid Eulerian modeling of dense gas–solids fluidized bed - hydrodynamics: Influence of the dissipation parameters" - Reuge, N., - Chemical Engineering Science - Volume 63, Issue 22, November 2008, pp. 5540-5551 + Reuge, N., Cadoret, L., Coufort-Saudejaud, C., Pannala, S., Syamlal, M., + & Caussat, B. (2008). + Multifluid Eulerian modeling of dense gas–solids fluidized bed + hydrodynamics: influence of the dissipation parameters. + Chemical Engineering Science, 63(22), 5540-5551. \endverbatim \verbatim - "Frictional-collisional constitutive relations for granular materials, - with application to plane shearing" - Johnson, P.C., and Jackson, R., - Journal of Fluid Mechanics - Volume 176, March 1987, pp. 67-93 + Johnson, P. C., & Jackson, R. (1987). + Frictional–collisional constitutive relations for granular materials, + with application to plane shearing. + Journal of fluid Mechanics, 176, 67-93. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index 8c6bca99d61bad03d3a5f5cd39d0298131f4ce47..cc943a5fea456eaf19287930d66b0a28af674045 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2017 OpenFOAM Foundation + | Copyright (C) 2014-2019 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -244,8 +244,8 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() *alpha *gs0 *(scalar(1) - sqr(restitutionCoefficient_.value())) - *sqrt(3.0*Theta) - /max(4.0*kappa*alphaMax.value(), SMALL) + *sqrt(3*Theta) + /max(4*kappa*alphaMax.value(), SMALL) ); this->valueFraction() = c/(c + patch().deltaCoeffs()); @@ -263,11 +263,11 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() *specularityCoefficient_.value() *alpha *gs0 - *sqrt(3.0*Theta) + *sqrt(3*Theta) *magSqr(U) - /max(6.0*kappa*alphaMax.value(), SMALL); + /max(6*kappa*alphaMax.value(), SMALL); - this->valueFraction() = 0.0; + this->valueFraction() = 0; } mixedFvPatchScalarField::updateCoeffs(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H index 5a916d53e496b498203adc3761b6413fde296864..08a809796e372aa7cf4853a4c81bda33b0537723 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,19 +31,18 @@ Description References: \verbatim - "Multifluid Eulerian modeling of dense gas–solids fluidized bed - hydrodynamics: Influence of the dissipation parameters" - Reuge, N., - Chemical Engineering Science - Volume 63, Issue 22, November 2008, pp. 5540-5551 + Reuge, N., Cadoret, L., Coufort-Saudejaud, C., Pannala, S., Syamlal, M., + & Caussat, B. (2008). + Multifluid Eulerian modeling of dense gas–solids fluidized bed + hydrodynamics: influence of the dissipation parameters. + Chemical Engineering Science, 63(22), 5540-5551. \endverbatim \verbatim - "Frictional-collisional constitutive relations for granular materials, - with application to plane shearing" - Johnson, P.C., and Jackson, R., - Journal of Fluid Mechanics - Volume 176, March 1987, pp. 67-93 + Johnson, P. C., & Jackson, R. (1987). + Frictional–collisional constitutive relations for granular materials, + with application to plane shearing. + Journal of fluid Mechanics, 176, 67-93. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index 344c606f23395ba82c69d21ff48972fec8c542a3..dbef3c89154fcf6c018a9fb6a191b4206232c42e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2017 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -109,10 +109,10 @@ frictionalPressurePrime return Fr_* ( - eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0) - *(alphaMax-alpha) + eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1) + *(alphaMax - alpha) + p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) - )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0); + )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1); } @@ -126,7 +126,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu const volSymmTensorField& D ) const { - return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi_); + return dimensionedScalar("1/2",dimTime, 0.5)*pf*sin(phi_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H index bf586baa0b98a5fd13b1a4bc5a74d1b617d2b8c0..7b7bbda1f140b21c905ad57cb72e9d57178f15bc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef JohnsonJackson_H -#define JohnsonJackson_H +#ifndef JohnsonJacksonFrictionalStress_H +#define JohnsonJacksonFrictionalStress_H #include "frictionalStressModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 7ea51b8a2195d2885d812183ded995d79979654f..7a40308b17c5182990898e7ad58c658e2b357754 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016-2017 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -109,10 +109,10 @@ JohnsonJacksonSchaeffer::frictionalPressurePrime return Fr_* ( - eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0) - *(alphaMax-alpha) + eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1) + *(alphaMax - alpha) + p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) - )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0); + )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1); } @@ -131,19 +131,11 @@ JohnsonJacksonSchaeffer::nu tmp<volScalarField> tnu ( - new volScalarField + volScalarField::New ( - IOobject - ( - "JohnsonJacksonSchaeffer:nu", - phase.mesh().time().timeName(), - phase.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "JohnsonJacksonSchaeffer:nu", phase.mesh(), - dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) + dimensionedScalar(dimensionSet(0, 2, -1, 0, 0)) ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H index 564fa6490282aa354c7864be3fc3b37903770dac..67d281e343c383c302367863a7442b5d65fd4b9d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef JohnsonJacksonSchaeffer_H -#define JohnsonJacksonSchaeffer_H +#ifndef JohnsonJacksonSchaefferFrictionalStress_H +#define JohnsonJacksonSchaefferFrictionalStress_H #include "frictionalStressModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 996af183fcf490ef444a4c320bcaadc860a73bd6..365fa6785dff55a8dde6b7e5834f156cd25396ed 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2017 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,7 +85,7 @@ frictionalPressure const volScalarField& alpha = phase; return - dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24) + dimensionedScalar("", dimensionSet(1, -1, -2, 0, 0), 1e24) *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0); } @@ -102,7 +102,7 @@ frictionalPressurePrime const volScalarField& alpha = phase; return - dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25) + dimensionedScalar("", dimensionSet(1, -1, -2, 0, 0), 1e25) *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0); } @@ -133,7 +133,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu false ), phase.mesh(), - dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) + dimensionedScalar(dimensionSet(0, 2, -1, 0, 0)) ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H index c82b4623c3b4ecf05b997f68249cdd69f592f7af..47642c322fb482a42a59b2616eaa76e56c3492df 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Schaeffer_H -#define Schaeffer_H +#ifndef SchaefferFrictionalStress_H +#define SchaefferFrictionalStress_H #include "frictionalStressModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C index 0aa88d72b3f87ed2251516252bbeea980b29f949..0c0a1584958227c15c5e637d78501b843693a339 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H index d703c7136d5021bbb7f7feaf357b5f45bdc8c743..4238a1a14de00859fcab2dc10edf9c5729af7e15 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,11 +55,11 @@ class frictionalStressModel { // Private member functions - //- No copy construct - frictionalStressModel(const frictionalStressModel&) = delete; + //- Disallow default bitwise copy construct + frictionalStressModel(const frictionalStressModel&); - //- No copy assignment - void operator=(const frictionalStressModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const frictionalStressModel&); protected: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C similarity index 66% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index 2b641e6f2136efdc440ae683aab8861bef9d6e23..4574606b937ba5a4a1ba32aa8e05ef9be50284ca 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,20 +35,24 @@ Foam::kineticTheoryModels::frictionalStressModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("frictionalStressModel")); + word frictionalStressModelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " << modelType << endl; + Info<< "Selecting frictionalStressModel " + << frictionalStressModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(frictionalStressModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorInFunction - << "Unknown frictionalStressModel type " - << modelType << nl << nl - << "Valid frictionalStressModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalError + << "frictionalStressModel::New(const dictionary&) : " << endl + << " unknown frictionalStressModelType type " + << frictionalStressModelType + << ", constructor not in hash table" << endl << endl + << " Valid frictionalStressModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr<frictionalStressModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C index 9f4566aaac5ed524f5ca6004d973dba9d49e8e7a..da54ff7de351964588de633814535e716ad04c6c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,7 +78,7 @@ Foam::kineticTheoryModels::granularPressureModels::Lun::granularPressureCoeff ) const { - return rho1*alpha1*(1.0 + 2.0*(1.0 + e)*alpha1*g0); + return rho1*alpha1*(1 + 2*(1 + e)*alpha1*g0); } @@ -93,7 +93,7 @@ granularPressureCoeffPrime const dimensionedScalar& e ) const { - return rho1*(1.0 + alpha1*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha1)); + return rho1*(1 + alpha1*(1 + e)*(4*g0 + 2*g0prime*alpha1)); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H index 84825bc5e38be7df4d47644923329cb0abf474f5..b56e570d0aee8943183a1159baea6c39f961c503 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::Lun + Foam::kineticTheoryModels::granularPressureModels::Lun Description @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Lun_H -#define Lun_H +#ifndef LunPressure_H +#define LunPressure_H #include "granularPressureModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C index 918cc049dd36c126ae7d0fb5ec34f92ca640fb38..51806105586f4ca11b34ccfbaae47c9cfcec889f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,7 @@ granularPressureCoeff ) const { - return 2.0*rho1*(1.0 + e)*sqr(alpha1)*g0; + return 2*rho1*(1 + e)*sqr(alpha1)*g0; } @@ -96,7 +96,7 @@ granularPressureCoeffPrime const dimensionedScalar& e ) const { - return rho1*alpha1*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha1); + return rho1*alpha1*(1 + e)*(4*g0 + 2*g0prime*alpha1); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H index 00f02131a12086e0706c21d8da0ab88c83f0116c..c9b29a8fa1c3b14c295cccc6f1e28793bc5d12dd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::SyamlalRogersOBrien + Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien Description @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef SyamlalRogersOBrien_H -#define SyamlalRogersOBrien_H +#ifndef SyamlalRogersOBrienPressure_H +#define SyamlalRogersOBrienPressure_H #include "granularPressureModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C index 5bd7a5b3406c3f1613fbb92c5e0ca87580279e1c..63a5aa12e341ec06fb213de9a80dc7b816bb069a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H index a5db14274b92d3252ed287a0e9f56af2763e7a35..87e391e30bae4e26f99d5695422b6cb5cede9f1f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,11 +54,11 @@ class granularPressureModel { // Private member functions - //- No copy construct - granularPressureModel(const granularPressureModel&) = delete; + //- Disallow default bitwise copy construct + granularPressureModel(const granularPressureModel&); - //- No copy assignment - void operator=(const granularPressureModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const granularPressureModel&); protected: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C similarity index 66% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index 497303471665b9ca56c17cc6fbec748959d16763..e791ec01bf77ff07087dc64549e1727c4bfcc677 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,20 +35,24 @@ Foam::kineticTheoryModels::granularPressureModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("granularPressureModel")); + word granularPressureModelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " << modelType << endl; + Info<< "Selecting granularPressureModel " + << granularPressureModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(granularPressureModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorInFunction - << "Unknown granularPressureModel type " - << modelType << nl << nl - << "Valid granularPressureModel types : " << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalError + << "granularPressureModel::New(const dictionary&) : " << endl + << " unknown granularPressureModelType type " + << granularPressureModelType + << ", constructor not in hash table" << endl << endl + << " Valid granularPressureModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr<granularPressureModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 0128c8f2ed4c868f992b0672e3337586c36edb0b..da96c80a9b5daae15a52171be67e2f79dae94f56 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -198,7 +198,7 @@ bool Foam::RASModels::kineticTheoryModel::read() >::read() ) { - coeffDict().readEntry("equilibrium", equilibrium_); + coeffDict().lookup("equilibrium") >> equilibrium_; e_.readIfPresent(coeffDict()); alphaMax_.readIfPresent(coeffDict()); alphaMinFriction_.readIfPresent(coeffDict()); @@ -353,7 +353,7 @@ void Foam::RASModels::kineticTheoryModel::correct() refCast<const twoPhaseSystem>(phase_.fluid()).otherPhase(phase_).U(); const scalar sqrtPi = sqrt(constant::mathematical::pi); - dimensionedScalar ThetaSmall("ThetaSmall", Theta_.dimensions(), 1.0e-6); + dimensionedScalar ThetaSmall("ThetaSmall", Theta_.dimensions(), 1e-6); dimensionedScalar ThetaSmallSqrt(sqrt(ThetaSmall)); tmp<volScalarField> tda(phase_.d()); @@ -374,19 +374,19 @@ void Foam::RASModels::kineticTheoryModel::correct() volScalarField ThetaSqrt("sqrtTheta", sqrt(Theta_)); // Bulk viscosity p. 45 (Lun et al. 1984). - lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi; + lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1 + e_)*ThetaSqrt/sqrtPi; // Stress tensor, Definitions, Table 3.1, p. 43 volSymmTensorField tau ( - rho*(2.0*nut_*D + (lambda_ - (2.0/3.0)*nut_)*tr(D)*I) + rho*(2*nut_*D + (lambda_ - (2.0/3.0)*nut_)*tr(D)*I) ); // Dissipation (Eq. 3.24, p.50) volScalarField gammaCoeff ( "gammaCoeff", - 12.0*(1.0 - sqr(e_)) + 12*(1 - sqr(e_)) *max(sqr(alpha), residualAlpha_) *rho*gs0_*(1.0/da)*ThetaSqrt/sqrtPi ); @@ -394,11 +394,11 @@ void Foam::RASModels::kineticTheoryModel::correct() // Drag volScalarField beta ( - refCast<const twoPhaseSystem>(phase_.fluid()).drag(phase_).K() + refCast<const twoPhaseSystem>(phase_.fluid()).Kd() ); // Eq. 3.25, p. 50 Js = J1 - J2 - volScalarField J1("J1", 3.0*beta); + volScalarField J1("J1", 3*beta); volScalarField J2 ( "J2", @@ -457,25 +457,25 @@ void Foam::RASModels::kineticTheoryModel::correct() { // Equilibrium => dissipation == production // Eq. 4.14, p.82 - volScalarField K1("K1", 2.0*(1.0 + e_)*rho*gs0_); + volScalarField K1("K1", 2*(1 + e_)*rho*gs0_); volScalarField K3 ( "K3", 0.5*da*rho* ( - (sqrtPi/(3.0*(3.0 - e_))) - *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha*gs0_) - +1.6*alpha*gs0_*(1.0 + e_)/sqrtPi + (sqrtPi/(3*(3.0 - e_))) + *(1 + 0.4*(1 + e_)*(3*e_ - 1)*alpha*gs0_) + +1.6*alpha*gs0_*(1 + e_)/sqrtPi ) ); volScalarField K2 ( "K2", - 4.0*da*rho*(1.0 + e_)*alpha*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0 + 4*da*rho*(1 + e_)*alpha*gs0_/(3*sqrtPi) - 2*K3/3.0 ); - volScalarField K4("K4", 12.0*(1.0 - sqr(e_))*rho*gs0_/(da*sqrtPi)); + volScalarField K4("K4", 12*(1 - sqr(e_))*rho*gs0_/(da*sqrtPi)); volScalarField trD ( @@ -495,13 +495,13 @@ void Foam::RASModels::kineticTheoryModel::correct() 4.0 *K4 *alpha - *(2.0*K3*trD2 + K2*tr2D) + *(2*K3*trD2 + K2*tr2D) ); Theta_ = sqr ( (l1 + sqrt(l2 + l3)) - /(2.0*max(alpha, residualAlpha_)*K4) + /(2*max(alpha, residualAlpha_)*K4) ); kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_); @@ -517,7 +517,7 @@ void Foam::RASModels::kineticTheoryModel::correct() volScalarField ThetaSqrt("sqrtTheta", sqrt(Theta_)); // Bulk viscosity p. 45 (Lun et al. 1984). - lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi; + lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1 + e_)*ThetaSqrt/sqrtPi; // Frictional pressure volScalarField pf diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index 5b70db5b700475bba86b28a8de01b53881218f7d..81843423c03bdaced2e023dd259d91cc4fee0ce0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2016 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,17 +24,17 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::kineticTheoryModel + Foam::RASModels::kineticTheoryModel Description Kinetic theory particle phase RAS model Reference: \verbatim - "Derivation, implementation, and validation of computer simulation - models for gas-solid fluidized beds", - van Wachem, B.G.M., - Ph.D. Thesis, Delft University of Technology, Amsterdam, 2000. + van Wachem, B. G. M. (2000). + Derivation, implementation, and validation of computer simulation models + for gas-solid fluidized beds. + PhD Thesis, TU Delft. \endverbatim There are no default model coefficients. @@ -149,11 +149,11 @@ class kineticTheoryModel void correctNut() {} - //- No copy construct - kineticTheoryModel(const kineticTheoryModel&) = delete; + //- Disallow default bitwise copy construct + kineticTheoryModel(const kineticTheoryModel&); - //- No copy assignment - void operator=(const kineticTheoryModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const kineticTheoryModel&); public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C similarity index 90% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C index 16f8339c0f3bbdef135508a266b7e481a14297b5..3640937b2bd277bf4d9d0bc971666d8015d32b88 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,9 +78,9 @@ Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0 { return - 1.0/(1.0 - alpha) - + 3.0*alpha/(2.0*sqr(1.0 - alpha)) - + sqr(alpha)/(2.0*pow3(1.0 - alpha)); + 1.0/(1 - alpha) + + 3*alpha/(2*sqr(1 - alpha)) + + sqr(alpha)/(2*pow3(1 - alpha)); } @@ -93,9 +93,9 @@ Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0prime ) const { return - 2.5/sqr(1.0 - alpha) - + 4.0*alpha/pow3(1.0 - alpha) - + 1.5*sqr(alpha)/pow4(1.0 - alpha); + 2.5/sqr(1 - alpha) + + 4*alpha/pow3(1 - alpha) + + 1.5*sqr(alpha)/pow4(1 - alpha); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H index 64168f3bf7bdf68d34032d5df3887f8d70c99fe9..d05c3c94cfc1a2dfb2ee4dfa64d35d8ba2e56216 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef CarnahanStarling_H -#define CarnahanStarling_H +#ifndef CarnahanStarlingRadial_H +#define CarnahanStarlingRadial_H #include "radialModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C index 054b8f4db1aed288117f3017e8c4a24c64e7f5b0..cb9f8423483e353be5f535b2535c3e5d8c858bf0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -77,7 +77,7 @@ Foam::kineticTheoryModels::radialModels::LunSavage::g0 ) const { - return pow(1.0 - alpha/alphaMax, -2.5*alphaMax); + return pow(1 - alpha/alphaMax, -2.5*alphaMax); } @@ -89,7 +89,7 @@ Foam::kineticTheoryModels::radialModels::LunSavage::g0prime const dimensionedScalar& alphaMax ) const { - return 2.5*pow(1.0 - alpha/alphaMax, -2.5*alphaMax - 1); + return 2.5*pow(1 - alpha/alphaMax, -2.5*alphaMax - 1); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H index 4c28ecc6923d99adbb935d18186c97f5c3855ec5..aecae7252d7abe6e4d086df7629fffc6fbc91b4c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef LunSavage_H -#define LunSavage_H +#ifndef LunSavageRadial_H +#define LunSavageRadial_H #include "radialModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C index d443452e1fe1bae8f97559389ead2c4e3f931190..f08f368744a15da4ae19197c952f2c5745f8c743 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -76,7 +76,7 @@ Foam::kineticTheoryModels::radialModels::SinclairJackson::g0 const dimensionedScalar& alphaMax ) const { - return 1.0/(1.0 - cbrt(min(alpha, alphaMinFriction)/alphaMax)); + return 1.0/(1 - cbrt(min(alpha, alphaMinFriction)/alphaMax)); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H index 5a1c7d6b48c2ebca6e673df54227fd3a4e526eb2..f7227a677bd308d0870efa87e45f1ccc13b6c737 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::SinclairJackson + Foam::kineticTheoryModels::radialModels::SinclairJackson Description @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef SinclairJackson_H -#define SinclairJackson_H +#ifndef SinclairJacksonRadial_H +#define SinclairJacksonRadial_H #include "radialModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C similarity index 67% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index c2c7bfd2e82f6999992c695b884f130f6e3e695d..48e96d81eae8b28d05ee6bf259df605104199cf1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,20 +35,24 @@ Foam::kineticTheoryModels::radialModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("radialModel")); + word radialModelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " << modelType << endl; + Info<< "Selecting radialModel " + << radialModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(radialModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorInFunction - << "Unknown radialModel type " - << modelType << nl << nl - << "Valid radialModel types :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalError + << "radialModel::New(const dictionary&) : " << endl + << " unknown radialModelType type " + << radialModelType + << ", constructor not in hash table" << endl << endl + << " Valid radialModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr<radialModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C index 2bdd7eaa1ca05b82278fb4bf7d406d29863635d1..02d33f5836ca98fdae2c70d29f1ae3587d1c323e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H similarity index 93% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H index 1ef1fdc1f9f5cf54ddc6d6c0fd6aa4fcd86ce8c3..cc025025f27db6d41d1a370c50f429d7974f5463 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,11 +54,11 @@ class radialModel { // Private member functions - //- No copy construct - radialModel(const radialModel&) = delete; + //- Disallow default bitwise copy construct + radialModel(const radialModel&); - //- No copy assignment - void operator=(const radialModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const radialModel&); protected: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C index 959d39de5365bacc364300ca6a3cef548645ae65..fd7c9d88705c41115a3aa547f6637b2657b6e282 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H index 9ed633508f06ad4fcc8ad8a9f1fcacf6b8ec953b..7d18db586aa07280bdfa47c1236eaf27023d76c7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Gidaspow_H -#define Gidaspow_H +#ifndef GidaspowViscosity_H +#define GidaspowViscosity_H #include "viscosityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C similarity index 86% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index c5f39b17df5c9b161a0b454171d63a25f067a8cd..dfde140a4fef649ddfdb4feccaa00e0ff4264b4b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -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. @@ -84,18 +84,15 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu { const scalar sqrtPi = sqrt(constant::mathematical::pi); - volScalarField lamda - ( - scalar(1) + da/(6.0*sqrt(2.0)*(alpha1 + scalar(1.0e-5)))/L_ - ); + const volScalarField lamda(1 + da/(6*sqrt(2.0)*(alpha1 + 1e-5))/L_); return da*sqrt(Theta)* ( - (4.0/5.0)*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1)*sqr(alpha1)/(3.0-e) - + (1.0/6.0)*sqrtPi*alpha1*(0.5*lamda + 0.25*(3.0*e - 1.0)) - /(0.5*(3.0 - e)*lamda) - + (10/96.0)*sqrtPi/((1.0 + e)*0.5*(3.0 - e)*g0*lamda) + (4.0/5.0)*sqr(alpha1)*g0*(1 + e)/sqrtPi + + (1.0/15.0)*sqrtPi*g0*(1 + e)*(3*e - 1)*sqr(alpha1)/(3 - e) + + (1.0/6.0)*sqrtPi*alpha1*(0.5*lamda + 0.25*(3*e - 1)) + /(0.5*(3 - e)*lamda) + + (10.0/96.0)*sqrtPi/((1 + e)*0.5*(3 - e)*g0*lamda) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H index a6b95d0671c41511c5d99361298302eda3022405..3d8b51f19596e1900542a180f2f42a51cb1dfba6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef HrenyaSinclair_H -#define HrenyaSinclair_H +#ifndef HrenyaSinclairViscosity_H +#define HrenyaSinclairViscosity_H #include "viscosityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C index c8a478710abe330b7bd5aa4b85867e841e5bd6e0..ecece29480bb8f54221fa34c1a69cf4cd02b6650 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,9 +78,9 @@ Foam::kineticTheoryModels::viscosityModels::Syamlal::nu return da*sqrt(Theta)* ( - (4.0/5.0)*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1.0)*sqr(alpha1)/(3.0 - e) - + (1.0/6.0)*alpha1*sqrtPi/(3.0 - e) + (4.0/5.0)*sqr(alpha1)*g0*(1 + e)/sqrtPi + + (1.0/15.0)*sqrtPi*g0*(1 + e)*(3*e - 1)*sqr(alpha1)/(3 - e) + + (1.0/6.0)*alpha1*sqrtPi/(3 - e) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H index 2b29eeb23d12db1aceaa2287a931d122fc67b668..b09878a353255cc7b40e60f1e6d45e41db3dbc99 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Syamlal_H -#define Syamlal_H +#ifndef SyamlalViscosity_H +#define SyamlalViscosity_H #include "viscosityModel.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C index c3d967f9839e4999533300d2c29e3d6c6ed89643..1b54b2014d26227feae19763414b275427700953 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,7 +65,12 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::nu const dimensionedScalar& e ) const { - return dimensionedScalar(dimViscosity, Zero)*alpha1; + return dimensionedScalar + ( + "0", + dimensionSet(0, 2, -1, 0, 0, 0, 0), + 0.0 + )*alpha1; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H index e002512f0c5209a1c7c7075e7467895d8ab60816..fd3ee097cc62988f66ede1887b183c6a8053043b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::noneViscosity + Foam::kineticTheoryModels::noneViscosity Description diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C similarity index 67% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index 44fa62d35519b4e01669f0a89497194df289211f..429842a2c6e228bfb21637e068b590aef0c6723e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,20 +35,23 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - const word modelType(dict.get<word>("viscosityModel")); + word viscosityModelType(dict.lookup("viscosityModel")); - Info<< "Selecting viscosityModel " << modelType << endl; + Info<< "Selecting viscosityModel " + << viscosityModelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(viscosityModelType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorInFunction - << "Unknown viscosityModel type " - << modelType << nl << nl - << "Valid viscosityModel types :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + FatalError + << "viscosityModel::New(const dictionary&) : " << endl + << " unknown viscosityModelType type " + << viscosityModelType + << ", constructor not in hash table" << endl << endl + << " Valid viscosityModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); } return autoPtr<viscosityModel>(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C index fa4df7d1a6428d5817b0182e86f680fa3051ac2e..823bcb61c64ca4c2e4d64854af0f8d58fb1d7da4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H index 42fcb206aa3b5d03d9a5647b279df75ce81c65a5..624e00de7d508474ee5f98f109c64989e6c922c1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::viscosityModel + Foam::kineticTheoryModels::viscosityModel Description @@ -56,11 +56,11 @@ class viscosityModel { // Private member functions - //- No copy construct - viscosityModel(const viscosityModel&) = delete; + //- Disallow default bitwise copy construct + viscosityModel(const viscosityModel&); - //- No copy assignment - void operator=(const viscosityModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const viscosityModel&); protected: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C similarity index 98% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C index 28ff419c5d5235ccc0f29bb9deb762024df3984b..26468f93605e6917ae6e4c78ad8199add61ccaaf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2016 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C similarity index 79% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 78ca28533bf08eaad0b2788d47626e11f24c91c5..4c06e91e5a7f21fddec44b48495bd87273f94fdf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,7 +64,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel expMax_(coeffDict_.get<scalar>("expMax")), g0_("g0", dimPressure, coeffDict_) { - nut_ == dimensionedScalar(nut_.dimensions(), Zero); + nut_ == dimensionedScalar(nut_.dimensions()); if (type == typeName) { @@ -85,9 +85,9 @@ bool Foam::RASModels::phasePressureModel::read() >::read() ) { - coeffDict().readEntry("alphaMax", alphaMax_); - coeffDict().readEntry("preAlphaExp", preAlphaExp_); - coeffDict().readEntry("expMax", expMax_); + coeffDict().lookup("alphaMax") >> alphaMax_; + coeffDict().lookup("preAlphaExp") >> preAlphaExp_; + coeffDict().lookup("expMax") >> expMax_; g0_.readIfPresent(coeffDict()); return true; @@ -116,18 +116,21 @@ Foam::RASModels::phasePressureModel::epsilon() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::phasePressureModel::R() const { - return tmp<volSymmTensorField>::New + return tmp<volSymmTensorField> ( - IOobject + new volSymmTensorField ( - IOobject::groupName("R", U_.group()), - runTime_.timeName(), + IOobject + ( + IOobject::groupName("R", U_.group()), + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero) + dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero) + ) ); } @@ -191,20 +194,25 @@ Foam::RASModels::phasePressureModel::pPrimef() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::phasePressureModel::devRhoReff() const { - return tmp<volSymmTensorField>::New + return tmp<volSymmTensorField> ( - IOobject + new volSymmTensorField ( - IOobject::groupName("devRhoReff", U_.group()), - runTime_.timeName(), + IOobject + ( + IOobject::groupName("devRhoReff", U_.group()), + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<symmTensor> - ( - rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), Zero + dimensioned<symmTensor> + ( + "R", + rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), + Zero + ) ) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index fefa44fce17ed466936798c042a0116fb8af4aa7..9dc98ce2e88927c176ed22acc0679370da9ca831 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::phasePressureModel + Foam::RASModels::phasePressureModel Description Particle-particle phase-pressure RAS model @@ -104,11 +104,11 @@ class phasePressureModel void correctNut() {} - //- No copy construct - phasePressureModel(const phasePressureModel&) = delete; + //- Disallow default bitwise copy construct + phasePressureModel(const phasePressureModel&); - //- No copy assignment - void operator=(const phasePressureModel&) = delete; + //- Disallow default bitwise assignment + void operator=(const phasePressureModel&); public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files index 3bd53b3cb18831bbe96751a2c7d3f38375781c87..67caa0d98b595287a8b8ac805684944397dc9da2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/files @@ -4,6 +4,7 @@ diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoales diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C diameterModels/IATE/IATEsources/phaseChange/phaseChange.C +diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C twoPhaseSystem.C newTwoPhaseSystem.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options similarity index 88% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options index 3fa406f3d31c621a66c6ffc8c95d64a51077c112..8ecc152446e57b9dd96b27c04514dd319a116e61 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options @@ -2,6 +2,8 @@ EXE_INC = \ -I../../interfacialModels/lnInclude \ -I../../interfacialCompositionModels/lnInclude \ -I../../phaseSystems/lnInclude \ + -I../twoPhaseCompressibleTurbulenceModels/lnInclude \ + -I../../derivedFvPatchFields/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C index 6a5e90e3553a0ebee8927c4f596986e325a1f89f..52097885bddd4441d6eee6296d36bd18199135b0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -119,7 +119,7 @@ void Foam::diameterModels::IATE::correct() ( max ( - fvc::average(phase_ + phase_.oldTime()), + 0.5*fvc::average(phase_ + phase_.oldTime()), residualAlpha_ ) ); @@ -171,8 +171,8 @@ bool Foam::diameterModels::IATE::read(const dictionary& phaseProperties) { diameterModel::read(phaseProperties); - diameterProperties_.readEntry("dMax", dMax_); - diameterProperties_.readEntry("dMin", dMin_); + diameterProperties_.lookup("dMax") >> dMax_; + diameterProperties_.lookup("dMin") >> dMin_; // Re-create all the sources updating number, type and coefficients PtrList<IATEsource> diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H index fadf193b08d70abcd01a60a7e1b23b03f5aaf070..93e9080c7c583177a0995ea09a864ba01b285b89 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2015 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,10 +35,11 @@ Description per unit volume. In every other respect this model is as presented in the paper: + Reference: \verbatim - "Development of Interfacial Area Transport Equation" - Ishii, M., Kim, S. and Kelly, J., - Nuclear Engineering and Technology, Vol.37 No.6 December 2005 + Ishii, M., Kim, S., & Kelly, J. (2005). + Development of interfacial area transport equation. + Nuclear Engineering and Technology, 37(6), 525-536. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C similarity index 83% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C index fa97334a6723a4997d4e855ba2bc67d98987bcb5..0722b9216f7c60c6e908c975aa2e8a874fc7fe21 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.C @@ -5,7 +5,7 @@ \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2011-2015 OpenFOAM Foundation + | Copyright (C) 2011-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,7 @@ License #include "IATEsource.H" #include "fvMatrix.H" #include "phaseCompressibleTurbulenceModel.H" -#include "gravityMeshObject.H" +#include "uniformDimensionedFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -52,16 +52,17 @@ Foam::diameterModels::IATEsource::New const dictionary& dict ) { - auto cstrIter = dictionaryConstructorTablePtr_->cfind(type); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(type); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalIOErrorInFunction(dict) + FatalErrorInFunction << "Unknown IATE source type " << type << nl << nl - << "Valid IATE source types :" << nl + << "Valid IATE source types : " << endl << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalIOError); + << exit(FatalError); } return autoPtr<IATEsource>(cstrIter()(iate, dict)); @@ -73,7 +74,7 @@ Foam::diameterModels::IATEsource::New Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Ur() const { const uniformDimensionedVectorField& g = - meshObjects::gravity::New(phase().db().time()); + phase().mesh().time().lookupObject<uniformDimensionedVectorField>("g"); return sqrt(2.0) @@ -86,19 +87,16 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Ur() const *pow(max(1 - phase(), scalar(0)), 1.75); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Ut() const { - return sqrt(2*otherPhase().turbulence().k()); + return sqrt(2*otherPhase().k()); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Re() const { - return max(Ur()*phase().d()/otherPhase().nu(), scalar(1.0e-3)); + return max(Ur()*phase().d()/otherPhase().nu(), scalar(1e-3)); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::CD() const { const volScalarField Eo(this->Eo()); @@ -116,11 +114,10 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::CD() const ); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Mo() const { const uniformDimensionedVectorField& g = - meshObjects::gravity::New(phase().db().time()); + phase().db().time().lookupObject<uniformDimensionedVectorField>("g"); return mag(g)*pow4(otherPhase().nu())*sqr(otherPhase().rho()) @@ -128,11 +125,10 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Mo() const /pow3(fluid().sigma()); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Eo() const { const uniformDimensionedVectorField& g = - meshObjects::gravity::New(phase().db().time()); + phase().db().time().lookupObject<uniformDimensionedVectorField>("g"); return mag(g)*sqr(phase().d()) @@ -140,7 +136,6 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Eo() const /fluid().sigma(); } - Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::We() const { return diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H index 63e58a2f705fcd6497b8f556fe7163b44c193b56..32285226fc0be240d3cd580ac0b53e52f2dc5ee6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/IATEsource/IATEsource.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -117,7 +117,7 @@ public: autoPtr<IATEsource> clone() const { NotImplemented; - return nullptr; + return autoPtr<IATEsource>(nullptr); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C similarity index 94% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C index ac7b8add5ba1f4dc9b9a9b6124afeff20c1d097a..2533bd885e347775d11df841a614c7850e8adb8b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,7 +61,7 @@ Foam::diameterModels::IATEsources::dummy::R iate_.phase().mesh() ), iate_.phase().mesh(), - dimensionedScalar(kappai.dimensions()/dimTime, Zero) + dimensionedScalar(kappai.dimensions()/dimTime, 0) ); return fvm::Su(R, kappai); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H index 670535d98fa70f5c12c379878e32de4a3537b1d1..287a1a1e769d48adfa685e25307c0b2e500ca055 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C similarity index 84% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C index 487d879adaa9698f812f737b05ee159b8a810438..3f988ad2d6c13830988a62dc46217010404cf8f9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,7 +56,9 @@ Foam::diameterModels::IATEsources::phaseChange::phaseChange const dictionary& dict ) : - IATEsource(iate) + IATEsource(iate), + pairName_(dict.lookup("pairName")), + iDmdtPtr_(nullptr) {} @@ -69,24 +71,20 @@ Foam::diameterModels::IATEsources::phaseChange::R volScalarField& kappai ) const { - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem - < - twoPhaseSystem - > - >& phaseChangeFluid = refCast - < - const ThermalPhaseChangePhaseSystem - < - MomentumTransferPhaseSystem<twoPhaseSystem> - > - >(fluid()); + if (!iDmdtPtr_) + { + iDmdtPtr_ = &alphai.mesh().lookupObject<volScalarField> + ( + IOobject::groupName("iDmdt", pairName_) + ); + } + + const volScalarField& iDmdt = *iDmdtPtr_; return -fvm::SuSp ( (1.0/3.0) - *phaseChangeFluid.iDmdt(phase())()() + *iDmdt() /(alphai()*phase().rho()()), kappai ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H index 740aadc20604c84ccec1c920a2d53a49fa6de97a..bffde46adf75a1b11ea9bbd8605664b85bc8a71f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/phaseChange/phaseChange.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,6 +56,13 @@ class phaseChange : public IATEsource { + // Private data + + //- Phase pair name + word pairName_; + + //- Pointer to the corresponding iDmdt field + mutable const volScalarField* iDmdtPtr_; public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C index aeecee784d1a552c5ca2dda958045baffcd21acc..68950b2d77205f5a336a5ec3992f4c2e902f5212 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,7 +78,7 @@ Foam::diameterModels::IATEsources::randomCoalescence::R iate_.phase().mesh() ), iate_.phase().mesh(), - dimensionedScalar(dimless/dimTime, Zero) + dimensionedScalar(dimless/dimTime) ); const scalar Crc = Crc_.value(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H index 9f0706bad9208d9d714c2438b90259d9a6fd7923..c24e85843d8f01288020d1e139153ece57c4bf5a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,10 +29,11 @@ Class Description Random coalescence IATE source as defined in paper: + Reference: \verbatim - "Development of Interfacial Area Transport Equation" - Ishii, M., Kim, S. and Kelly, J., - Nuclear Engineering and Technology, Vol.37 No.6 December 2005 + Ishii, M., Kim, S., & Kelly, J. (2005). + Development of interfacial area transport equation. + Nuclear Engineering and Technology, 37(6), 525-536. \endverbatim diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C similarity index 95% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C index 678e4a0437078af6e0075c2044c095b77dc241c0..e0964ac69ea5612355e0394e405d0d2cec270447 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -77,7 +77,7 @@ Foam::diameterModels::IATEsources::turbulentBreakUp::R iate_.phase().mesh() ), iate_.phase().mesh(), - dimensionedScalar(kappai.dimensions()/dimTime, Zero) + dimensionedScalar(kappai.dimensions()/dimTime) ); const scalar Cti = Cti_.value(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H similarity index 91% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H index 2d8daea39164bc9601ce5260f1bfefdccca18cdd..276e63168e23d8f596d21b707c9f20f80fb477a2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.H @@ -1,11 +1,11 @@ -/*---------------------------------------------------------------------------* \ +/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,10 +29,11 @@ Class Description Turbulence-induced break-up IATE source as defined in paper: + Reference: \verbatim - "Development of Interfacial Area Transport Equation" - Ishii, M., Kim, S. and Kelly, J., - Nuclear Engineering and Technology, Vol.37 No.6 December 2005 + Ishii, M., Kim, S., & Kelly, J. (2005). + Development of interfacial area transport equation. + Nuclear Engineering and Technology, 37(6), 525-536. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C index ff3e9809bb5c10341bce64ba8bdf6eea85a778cd..387f913f751c65fd0841ffee98b747acc60ad68a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H similarity index 92% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H index 4cf000a3d875f0f624dff43860a722930e491c4f..385180506902d8efe6a762a00425b2fd71dc44fa 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoalescence.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2016 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,10 +29,11 @@ Class Description Bubble coalescence due to wake entrainment IATE source as defined in paper: + Reference: \verbatim - "Development of Interfacial Area Transport Equation" - Ishii, M., Kim, S. and Kelly, J., - Nuclear Engineering and Technology, Vol.37 No.6 December 2005 + Ishii, M., Kim, S., & Kelly, J. (2005). + Development of interfacial area transport equation. + Nuclear Engineering and Technology, 37(6), 525-536. \endverbatim SourceFiles diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C similarity index 89% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C index 849850652012e794e25b2683029f97e1e2514ca9..4556de21a4c275b565dd2ef3a67e2e6afea82490 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -76,7 +76,7 @@ Foam::diameterModels::IATEsources::wallBoiling::R phase().mesh() ), phase().mesh(), - dimensionedScalar(dimless/dimTime, Zero) + dimensionedScalar(dimless/dimTime) ); volScalarField::Internal Rdk @@ -88,19 +88,16 @@ Foam::diameterModels::IATEsources::wallBoiling::R phase().mesh() ), phase().mesh(), - dimensionedScalar(kappai.dimensions()/dimTime, Zero) + dimensionedScalar(kappai.dimensions()/dimTime) ); const phaseCompressibleTurbulenceModel& turbulence = - const_cast<phaseCompressibleTurbulenceModel&> + phase().db().lookupObjectRef<phaseCompressibleTurbulenceModel> ( - phase().db().lookupObject<phaseCompressibleTurbulenceModel> + IOobject::groupName ( - IOobject::groupName - ( - turbulenceModel::propertiesName, - otherPhase().name() - ) + turbulenceModel::propertiesName, + otherPhase().name() ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.H similarity index 97% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.H index 459cab6c70e4094497a78585e69f9773c5ff97e7..b6c7a90a0c82ad81f7177071fe48c45969e91d8c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/IATEsource/wallBoiling.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2016 OpenFOAM Foundation + | Copyright (C) 2016-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C index ffac48ad63d2a33ef9f7d1503155bc73fbbd1f1d..f92e886cea5d466e1781ad625110a5f7c7c27883 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/newTwoPhaseSystem.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,7 +34,7 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New const fvMesh& mesh ) { - const word systemType + const word twoPhaseSystemType ( IOdictionary ( @@ -47,19 +47,21 @@ Foam::autoPtr<Foam::twoPhaseSystem> Foam::twoPhaseSystem::New IOobject::NO_WRITE, false ) - ).get<word>("type") + ).lookup("type") ); - Info<< "Selecting twoPhaseSystem " << systemType << endl; + Info<< "Selecting twoPhaseSystem " + << twoPhaseSystemType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType); + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(twoPhaseSystemType); - if (!cstrIter.found()) + if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown twoPhaseSystem type " - << systemType << nl << nl - << "Valid twoPhaseSystem types :" << endl + << "Unknown twoPhaseSystemType type " + << twoPhaseSystemType << endl << endl + << "Valid twoPhaseSystem types are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C similarity index 77% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index f73ead43b3c5d51ec487a1e61bc30ce005e43797..af8ad970e646d8f95f53a548c0b41186f98366db 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2017 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +31,7 @@ License #include "MULES.H" #include "subCycle.H" +#include "UniformField.H" #include "fvcDdt.H" #include "fvcDiv.H" @@ -87,12 +88,6 @@ Foam::twoPhaseSystem::sigma() const } -const Foam::dragModel& Foam::twoPhaseSystem::drag(const phaseModel& phase) const -{ - return lookupSubModel<dragModel>(phase, otherPhase(phase)); -} - - Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::Kd() const { @@ -113,13 +108,6 @@ Foam::twoPhaseSystem::Kdf() const } -const Foam::virtualMassModel& -Foam::twoPhaseSystem::virtualMass(const phaseModel& phase) const -{ - return lookupSubModel<virtualMassModel>(phase, otherPhase(phase)); -} - - Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::Vm() const { @@ -130,62 +118,6 @@ Foam::twoPhaseSystem::Vm() const } -Foam::tmp<Foam::surfaceScalarField> -Foam::twoPhaseSystem::Vmf() const -{ - return Vmf - ( - phasePairKey(phase1().name(), phase2().name()) - ); -} - - -Foam::tmp<Foam::volVectorField> -Foam::twoPhaseSystem::F() const -{ - return F - ( - phasePairKey(phase1().name(), phase2().name()) - ); -} - - -Foam::tmp<Foam::surfaceScalarField> -Foam::twoPhaseSystem::Ff() const -{ - return Ff - ( - phasePairKey(phase1().name(), phase2().name()) - ); -} - - -Foam::tmp<Foam::volScalarField> -Foam::twoPhaseSystem::D() const -{ - return D - ( - phasePairKey(phase1().name(), phase2().name()) - ); -} - - -bool Foam::twoPhaseSystem::transfersMass() const -{ - return transfersMass(phase1()); -} - - -Foam::tmp<Foam::volScalarField> -Foam::twoPhaseSystem::dmdt() const -{ - return dmdt - ( - phasePairKey(phase1().name(), phase2().name()) - ); -} - - void Foam::twoPhaseSystem::solve() { const Time& runTime = mesh_.time(); @@ -195,8 +127,8 @@ void Foam::twoPhaseSystem::solve() const dictionary& alphaControls = mesh_.solverDict(alpha1.name()); - label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles")); - label nAlphaCorr(alphaControls.get<label>("nAlphaCorr")); + label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); + label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); bool LTS = fv::localEulerDdt::enabled(mesh_); @@ -241,10 +173,12 @@ void Foam::twoPhaseSystem::solve() surfaceScalarField phir("phir", phi1 - phi2); tmp<surfaceScalarField> alphaDbyA; - - if (notNull(phase1_.DbyA()) && notNull(phase2_.DbyA())) + if (DByAfs().found(phase1_.name()) && DByAfs().found(phase2_.name())) { - surfaceScalarField DbyA(phase1_.DbyA() + phase2_.DbyA()); + surfaceScalarField DbyA + ( + *DByAfs()[phase1_.name()] + *DByAfs()[phase2_.name()] + ); alphaDbyA = fvc::interpolate(max(alpha1, scalar(0))) @@ -265,7 +199,7 @@ void Foam::twoPhaseSystem::solve() mesh_ ), mesh_, - dimensionedScalar(dimless/dimTime, Zero) + dimensionedScalar(dimless/dimTime) ); volScalarField::Internal Su @@ -289,8 +223,8 @@ void Foam::twoPhaseSystem::solve() { if (dgdt[celli] > 0.0) { - Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4); - Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4); + Sp[celli] -= dgdt[celli]/max(1 - alpha1[celli], 1e-4); + Su[celli] += dgdt[celli]/max(1 - alpha1[celli], 1e-4); } else if (dgdt[celli] < 0.0) { @@ -343,21 +277,21 @@ void Foam::twoPhaseSystem::solve() alphaPhi10, (alphaSubCycle.index()*Sp)(), (Su - (alphaSubCycle.index() - 1)*Sp*alpha1)(), - phase1_.alphaMax(), - 0 + UniformField<scalar>(phase1_.alphaMax()), + zeroField() ); if (alphaSubCycle.index() == 1) { - phase1_.alphaPhi() = alphaPhi10; + phase1_.alphaPhiRef() = alphaPhi10; } else { - phase1_.alphaPhi() += alphaPhi10; + phase1_.alphaPhiRef() += alphaPhi10; } } - phase1_.alphaPhi() /= nAlphaSubCycles; + phase1_.alphaPhiRef() /= nAlphaSubCycles; } else { @@ -369,11 +303,11 @@ void Foam::twoPhaseSystem::solve() alphaPhi1, Sp, Su, - phase1_.alphaMax(), - 0 + UniformField<scalar>(phase1_.alphaMax()), + zeroField() ); - phase1_.alphaPhi() = alphaPhi1; + phase1_.alphaPhiRef() = alphaPhi1; } if (alphaDbyA.valid()) @@ -387,15 +321,15 @@ void Foam::twoPhaseSystem::solve() alpha1Eqn.relax(); alpha1Eqn.solve(); - phase1_.alphaPhi() += alpha1Eqn.flux(); + phase1_.alphaPhiRef() += alpha1Eqn.flux(); } - phase1_.alphaRhoPhi() = + phase1_.alphaRhoPhiRef() = fvc::interpolate(phase1_.rho())*phase1_.alphaPhi(); - phase2_.alphaPhi() = phi_ - phase1_.alphaPhi(); - phase2_.correctInflowOutflow(phase2_.alphaPhi()); - phase2_.alphaRhoPhi() = + phase2_.alphaPhiRef() = phi_ - phase1_.alphaPhi(); + phase2_.correctInflowOutflow(phase2_.alphaPhiRef()); + phase2_.alphaRhoPhiRef() = fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); Info<< alpha1.name() << " volume fraction = " diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H similarity index 62% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H index ca778f55c4193e84e723488bebfe4f1b67d13bca..799039668c25d854f8ad1b816d2597b1cd04e485 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2013-2015 OpenFOAM Foundation + | Copyright (C) 2013-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,6 +55,8 @@ class twoPhaseSystem : public phaseSystem { +private: + // Private member functions //- Return the drag coefficient for phase pair @@ -66,31 +68,16 @@ class twoPhaseSystem //- Return the virtual mass coefficient for phase pair virtual tmp<volScalarField> Vm(const phasePairKey& key) const = 0; - //- Return the face virtual mass coefficient for phase pair - virtual tmp<surfaceScalarField> Vmf(const phasePairKey& key) const = 0; - - //- Return the combined force (lift + wall-lubrication) for phase pair - virtual tmp<volVectorField> F(const phasePairKey& key) const = 0; - - //- Return the combined face-force (lift + wall-lubrication) - // for phase pair - virtual tmp<surfaceScalarField> Ff(const phasePairKey& key) const = 0; - - //- Return the turbulent diffusivity for phase pair - // Multiplies the phase-fraction gradient - virtual tmp<volScalarField> D(const phasePairKey& key) const = 0; - - //- Return true if there is mass transfer for phase - virtual bool transfersMass(const phaseModel& phase) const = 0; - - //- Return the interfacial mass flow rate for phase pair - virtual tmp<volScalarField> dmdt(const phasePairKey& key) const = 0; - protected: // Protected data + //- Flag to indicate that returned lists of fields are "complete"; i.e., + // that an absence of force is returned as a constructed list of zeros, + // rather than a null pointer + static const bool fillFields_ = true; + //- Phase model 1 phaseModel& phase1_; @@ -137,72 +124,36 @@ public: // Member Functions - //- Constant access phase model 1 + using phaseSystem::sigma; + using phaseSystem::dmdts; + + //- Return phase model 1 const phaseModel& phase1() const; //- Access phase model 1 phaseModel& phase1(); - //- Constant access phase model 2 + //- Return phase model 2 const phaseModel& phase2() const; //- Access phase model 2 phaseModel& phase2(); - //- Constant access the phase not given as an argument - const phaseModel& otherPhase - ( - const phaseModel& phase - ) const; - - //- Return the momentum transfer matrices - virtual autoPtr<momentumTransferTable> momentumTransfer() const = 0; - - //- Return the heat transfer matrices - virtual autoPtr<heatTransferTable> heatTransfer() const = 0; - - //- Return the mass transfer matrices - virtual autoPtr<massTransferTable> massTransfer() const = 0; - - using phaseSystem::sigma; + //- Return the phase not given as an argument + const phaseModel& otherPhase(const phaseModel& phase) const; //- Return the surface tension coefficient tmp<volScalarField> sigma() const; - //- Return the drag model for the given phase - const dragModel& drag(const phaseModel& phase) const; - //- Return the drag coefficient tmp<volScalarField> Kd() const; //- Return the face drag coefficient tmp<surfaceScalarField> Kdf() const; - //- Return the virtual mass model for the given phase - const virtualMassModel& virtualMass(const phaseModel& phase) const; - //- Return the virtual mass coefficient tmp<volScalarField> Vm() const; - //- Return the face virtual mass coefficient - tmp<surfaceScalarField> Vmf() const; - - //- Return the combined force (lift + wall-lubrication) - tmp<volVectorField> F() const; - - //- Return the combined face-force (lift + wall-lubrication) - tmp<surfaceScalarField> Ff() const; - - //- Return the turbulent diffusivity - // Multiplies the phase-fraction gradient - tmp<volScalarField> D() const; - - //- Return true if there is mass transfer - bool transfersMass() const; - - //- Return the interfacial mass flow rate - tmp<volScalarField> dmdt() const; - //- Solve for the phase fractions virtual void solve(); }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H similarity index 96% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H index 5638d93e665550aea256c09d043ce532e561ab51..1d38a1d0929d751463040aa0d50abc1fa2ec56bc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2014-2015 OpenFOAM Foundation + | Copyright (C) 2014-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C similarity index 52% rename from applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C rename to src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C index b39dc05ae86e90765c2ea7e6ffe8cc8f19e857b3..4211bb460d174b563636b2e47e62c8a334cdcc95 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystems.C @@ -5,7 +5,7 @@ \\ / A nd | \\/ M anipulation | ------------------------------------------------------------------------------- - | Copyright (C) 2015 OpenFOAM Foundation + | Copyright (C) 2015-2018 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,7 +30,10 @@ License #include "phaseSystem.H" #include "twoPhaseSystem.H" #include "MomentumTransferPhaseSystem.H" -#include "HeatTransferPhaseSystem.H" +#include "OneResistanceHeatTransferPhaseSystem.H" +#include "TwoResistanceHeatTransferPhaseSystem.H" +#include "PhaseTransferPhaseSystem.H" +#include "PopulationBalancePhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H" @@ -39,24 +42,33 @@ License namespace Foam { typedef - HeatTransferPhaseSystem + PhaseTransferPhaseSystem < - MomentumTransferPhaseSystem<twoPhaseSystem> + OneResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<twoPhaseSystem> + > > - heatAndMomentumTransferTwoPhaseSystem; + basicTwoPhaseSystem; addNamedToRunTimeSelectionTable ( twoPhaseSystem, - heatAndMomentumTransferTwoPhaseSystem, + basicTwoPhaseSystem, dictionary, - heatAndMomentumTransferTwoPhaseSystem + basicTwoPhaseSystem ); typedef InterfaceCompositionPhaseChangePhaseSystem < - MomentumTransferPhaseSystem<twoPhaseSystem> + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<twoPhaseSystem> + > + > > interfaceCompositionPhaseChangeTwoPhaseSystem; @@ -71,7 +83,13 @@ namespace Foam typedef ThermalPhaseChangePhaseSystem < - MomentumTransferPhaseSystem<twoPhaseSystem> + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<twoPhaseSystem> + > + > > thermalPhaseChangeTwoPhaseSystem; @@ -82,6 +100,51 @@ namespace Foam dictionary, thermalPhaseChangeTwoPhaseSystem ); + + typedef + PopulationBalancePhaseSystem + < + PhaseTransferPhaseSystem + < + OneResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<twoPhaseSystem> + > + > + > + populationBalanceTwoPhaseSystem; + + addNamedToRunTimeSelectionTable + ( + twoPhaseSystem, + populationBalanceTwoPhaseSystem, + dictionary, + populationBalanceTwoPhaseSystem + ); + + typedef + ThermalPhaseChangePhaseSystem + < + PopulationBalancePhaseSystem + < + PhaseTransferPhaseSystem + < + TwoResistanceHeatTransferPhaseSystem + < + MomentumTransferPhaseSystem<twoPhaseSystem> + > + > + > + > + thermalPhaseChangePopulationBalanceTwoPhaseSystem; + + addNamedToRunTimeSelectionTable + ( + twoPhaseSystem, + thermalPhaseChangePopulationBalanceTwoPhaseSystem, + dictionary, + thermalPhaseChangePopulationBalanceTwoPhaseSystem + ); } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 337373c685bdff2ff4dfbf4e7dcfab3e75b23731..70bfe55f2b9a491275bbdb4eac854560ac981d35 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -479,6 +479,12 @@ public: const label patchi ) const = 0; + //- Thermal diffusivity for energy of mixture [kg/m/s] + virtual tmp<volScalarField> alphahe() const = 0; + + //- Thermal diffusivity for energy of mixture for patch [kg/m/s] + virtual tmp<scalarField> alphahe(const label patchi) const = 0; + //- Effective thermal diffusivity for temperature // of mixture [J/m/s/K] virtual tmp<volScalarField> kappaEff diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index af0fc30ab6046cea4e203048afc608a5ec1587ca..5d8c58eee4c10f6a8b53c4b6d2074952bd9908ed 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -841,6 +841,31 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::kappa } +template<class BasicThermo, class MixtureType> +Foam::tmp<Foam::volScalarField> +Foam::heThermo<BasicThermo, MixtureType>::alphahe() const +{ + tmp<Foam::volScalarField> alphaEff(this->CpByCpv()*this->alpha_); + alphaEff.ref().rename("alphahe"); + return alphaEff; +} + + +template<class BasicThermo, class MixtureType> +Foam::tmp<Foam::scalarField> +Foam::heThermo<BasicThermo, MixtureType>::alphahe(const label patchi) const +{ + return + this->CpByCpv + ( + this->p_.boundaryField()[patchi], + this->T_.boundaryField()[patchi], + patchi + ) + *this->alpha_.boundaryField()[patchi]; +} + + template<class BasicThermo, class MixtureType> Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::kappaEff diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index 7d8f0903ecdd8595465f527dca893a1338588901..1184e832c46a4a169df2ebf6b3ed79ddce3887ff 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -290,6 +290,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(const volScalarField&) const; diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C index a7ebfa07deaea53997ef71db74f1f2660805d6fe..093cbef04a4ea9ceebe6c5ff106c8da9b4a0e340 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C @@ -38,6 +38,7 @@ License #include "adiabaticPerfectFluid.H" #include "hConstThermo.H" +#include "eConstThermo.H" #include "janafThermo.H" #include "sensibleEnthalpy.H" #include "sensibleInternalEnergy.H" @@ -45,6 +46,7 @@ License #include "constTransport.H" #include "sutherlandTransport.H" +#include "WLFTransport.H" #include "icoPolynomial.H" #include "hPolynomialThermo.H" @@ -302,6 +304,18 @@ makeThermos specie ); +makeThermos +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + eConstThermo, + rhoConst, + specie +); + makeThermos ( rhoThermo, @@ -314,6 +328,18 @@ makeThermos specie ); +makeThermos +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + eConstThermo, + perfectFluid, + specie +); + makeThermos ( rhoThermo, @@ -326,6 +352,20 @@ makeThermos specie ); + +makeThermos +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + eConstThermo, + adiabaticPerfectFluid, + specie +); + + makeThermos ( rhoThermo, @@ -411,6 +451,18 @@ makeThermos ); +makeThermos +( + rhoThermo, + heRhoThermo, + pureMixture, + WLFTransport, + sensibleInternalEnergy, + eConstThermo, + rhoConst, + specie +); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C index bf7ac2bacb105b9373c3553ab476e5044fb8fc3f..466f6c547840b54e974d9c05bded0fe0edf937dc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C @@ -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. @@ -84,6 +84,27 @@ namespace Foam icoPoly8HThermoPhysics ); + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constFluidHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constHThermoPhysics + ); + makeChemistryModelType ( @@ -120,6 +141,27 @@ namespace Foam icoPoly8HThermoPhysics ); + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constFluidHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constHThermoPhysics + ); + makeChemistryModelType ( @@ -156,6 +198,27 @@ namespace Foam icoPoly8HThermoPhysics ); + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constFluidHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constHThermoPhysics + ); + makeChemistryModelType ( @@ -192,6 +255,27 @@ namespace Foam icoPoly8HThermoPhysics ); + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constFluidHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constHThermoPhysics + ); + // Chemistry moldels based on sensibleInternalEnergy makeChemistryModelType @@ -229,6 +313,28 @@ namespace Foam icoPoly8EThermoPhysics ); + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constFluidEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constEThermoPhysics + ); + + makeChemistryModelType ( @@ -265,6 +371,27 @@ namespace Foam icoPoly8EThermoPhysics ); + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constFluidEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constEThermoPhysics + ); + makeChemistryModelType ( @@ -301,6 +428,27 @@ namespace Foam icoPoly8EThermoPhysics ); + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constFluidEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constEThermoPhysics + ); + makeChemistryModelType ( @@ -336,6 +484,27 @@ namespace Foam rhoReactionThermo, icoPoly8EThermoPhysics ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constFluidEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constEThermoPhysics + ); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C index 12c27581a4e099cdcfb1ca5534013761c41a25c8..650d74b9232ee1812c4ddf34869714d8e62dde4a 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C @@ -50,6 +50,14 @@ namespace Foam incompressibleGasHThermoPhysics ); makeChemistryReductionMethods(psiReactionThermo, icoPoly8HThermoPhysics); + makeChemistryReductionMethods(psiReactionThermo, constFluidHThermoPhysics); + makeChemistryReductionMethods + ( + psiReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistryReductionMethods(psiReactionThermo, constHThermoPhysics); + makeChemistryReductionMethods(rhoReactionThermo, constGasHThermoPhysics); makeChemistryReductionMethods(rhoReactionThermo, gasHThermoPhysics); @@ -64,6 +72,14 @@ namespace Foam incompressibleGasHThermoPhysics ); makeChemistryReductionMethods(rhoReactionThermo, icoPoly8HThermoPhysics); + makeChemistryReductionMethods(rhoReactionThermo, constFluidHThermoPhysics); + makeChemistryReductionMethods + ( + rhoReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistryReductionMethods(rhoReactionThermo, constHThermoPhysics); + // Chemistry solvers based on sensibleInternalEnergy @@ -80,6 +96,14 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistryReductionMethods(psiReactionThermo, icoPoly8EThermoPhysics); + makeChemistryReductionMethods(psiReactionThermo, constFluidEThermoPhysics); + makeChemistryReductionMethods + ( + psiReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistryReductionMethods(psiReactionThermo, constEThermoPhysics); + makeChemistryReductionMethods(rhoReactionThermo, constGasEThermoPhysics); makeChemistryReductionMethods(rhoReactionThermo, gasEThermoPhysics); @@ -94,6 +118,13 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistryReductionMethods(rhoReactionThermo, icoPoly8EThermoPhysics); + makeChemistryReductionMethods(rhoReactionThermo, constFluidEThermoPhysics); + makeChemistryReductionMethods + ( + rhoReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistryReductionMethods(rhoReactionThermo, constEThermoPhysics); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C index 3d17047ebffe8a01ebe6039b7472faddb2705162..0f2e40f02d371fdfec9928f806416dd124e15443 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C @@ -50,6 +50,14 @@ namespace Foam incompressibleGasHThermoPhysics ); makeChemistryTabulationMethods(psiReactionThermo, icoPoly8HThermoPhysics); + makeChemistryTabulationMethods(psiReactionThermo, constFluidHThermoPhysics); + makeChemistryTabulationMethods + ( + psiReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistryTabulationMethods(psiReactionThermo, constHThermoPhysics); + makeChemistryTabulationMethods(rhoReactionThermo, constGasHThermoPhysics); @@ -65,6 +73,14 @@ namespace Foam incompressibleGasHThermoPhysics ); makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8HThermoPhysics); + makeChemistryTabulationMethods(rhoReactionThermo, constFluidHThermoPhysics); + makeChemistryTabulationMethods + ( + rhoReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistryTabulationMethods(rhoReactionThermo, constHThermoPhysics); + // Chemistry solvers based on sensibleInternalEnergy @@ -82,6 +98,14 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistryTabulationMethods(psiReactionThermo, icoPoly8EThermoPhysics); + makeChemistryTabulationMethods(psiReactionThermo, constFluidEThermoPhysics); + makeChemistryTabulationMethods + ( + psiReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistryTabulationMethods(psiReactionThermo, constEThermoPhysics); + makeChemistryTabulationMethods(rhoReactionThermo, constGasEThermoPhysics); @@ -97,6 +121,14 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8EThermoPhysics); + makeChemistryTabulationMethods(rhoReactionThermo, constFluidEThermoPhysics); + makeChemistryTabulationMethods + ( + rhoReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistryTabulationMethods(rhoReactionThermo, constEThermoPhysics); + } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index 1dd999fffd58b12d5911a4eff8688f1d597b65de..07a49f86a3f3c9355e2df76a1351fe851cf6af87 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -46,9 +46,19 @@ namespace Foam makeChemistrySolverTypes ( psiReactionThermo, - incompressibleGasHThermoPhysics) + incompressibleGasHThermoPhysics + ) ; makeChemistrySolverTypes(psiReactionThermo, icoPoly8HThermoPhysics); + makeChemistrySolverTypes(psiReactionThermo, constFluidHThermoPhysics); + makeChemistrySolverTypes + ( + psiReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistrySolverTypes(psiReactionThermo, constHThermoPhysics); + + makeChemistrySolverTypes(rhoReactionThermo, constGasHThermoPhysics); makeChemistrySolverTypes(rhoReactionThermo, gasHThermoPhysics); makeChemistrySolverTypes @@ -62,6 +72,14 @@ namespace Foam incompressibleGasHThermoPhysics ); makeChemistrySolverTypes(rhoReactionThermo, icoPoly8HThermoPhysics); + makeChemistrySolverTypes(rhoReactionThermo, constFluidHThermoPhysics); + makeChemistrySolverTypes + ( + rhoReactionThermo, + constAdiabaticFluidHThermoPhysics + ); + makeChemistrySolverTypes(rhoReactionThermo, constHThermoPhysics); + // Chemistry solvers based on sensibleInternalEnergy makeChemistrySolverTypes(psiReactionThermo, constGasEThermoPhysics); @@ -77,6 +95,14 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistrySolverTypes(psiReactionThermo, icoPoly8EThermoPhysics); + makeChemistrySolverTypes(psiReactionThermo, constFluidEThermoPhysics); + makeChemistrySolverTypes + ( + psiReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistrySolverTypes(psiReactionThermo, constEThermoPhysics); + makeChemistrySolverTypes(rhoReactionThermo, constGasEThermoPhysics); makeChemistrySolverTypes(rhoReactionThermo, gasEThermoPhysics); makeChemistrySolverTypes @@ -90,6 +116,14 @@ namespace Foam incompressibleGasEThermoPhysics ); makeChemistrySolverTypes(rhoReactionThermo, icoPoly8EThermoPhysics); + + makeChemistrySolverTypes(rhoReactionThermo, constFluidEThermoPhysics); + makeChemistrySolverTypes + ( + rhoReactionThermo, + constAdiabaticFluidEThermoPhysics + ); + makeChemistrySolverTypes(rhoReactionThermo, constEThermoPhysics); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index 7ecbee9f26c2c6cd152c57a30c07a036d5c86135..34464f4355b02fe1e207443216cd9500770bad3c 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -46,6 +46,10 @@ makeChemistryReader(gasHThermoPhysics); makeChemistryReader(constIncompressibleGasHThermoPhysics); makeChemistryReader(incompressibleGasHThermoPhysics); makeChemistryReader(icoPoly8HThermoPhysics); +makeChemistryReader(constFluidHThermoPhysics); +makeChemistryReader(constAdiabaticFluidHThermoPhysics); +makeChemistryReader(constHThermoPhysics); + makeChemistryReaderType(foamChemistryReader, constGasHThermoPhysics); makeChemistryReaderType(foamChemistryReader, gasHThermoPhysics); @@ -56,6 +60,9 @@ makeChemistryReaderType ); makeChemistryReaderType(foamChemistryReader, incompressibleGasHThermoPhysics); makeChemistryReaderType(foamChemistryReader, icoPoly8HThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constFluidHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constAdiabaticFluidHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constHThermoPhysics); @@ -66,6 +73,10 @@ makeChemistryReader(gasEThermoPhysics); makeChemistryReader(constIncompressibleGasEThermoPhysics); makeChemistryReader(incompressibleGasEThermoPhysics); makeChemistryReader(icoPoly8EThermoPhysics); +makeChemistryReader(constFluidEThermoPhysics); +makeChemistryReader(constAdiabaticFluidEThermoPhysics); +makeChemistryReader(constEThermoPhysics); + makeChemistryReaderType(foamChemistryReader, constGasEThermoPhysics); makeChemistryReaderType(foamChemistryReader, gasEThermoPhysics); @@ -76,6 +87,9 @@ makeChemistryReaderType ); makeChemistryReaderType(foamChemistryReader, incompressibleGasEThermoPhysics); makeChemistryReaderType(foamChemistryReader, icoPoly8EThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constFluidEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constAdiabaticFluidEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constEThermoPhysics); // Solid chemistry readers for solids based on sensibleInternalEnergy diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C index 552487505f9b1bc177ccfc81b38d995ff11b8aac..fca3c715da674092163424440355bf08566f98b0 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C @@ -44,6 +44,7 @@ License #include "constTransport.H" #include "sutherlandTransport.H" +#include "WLFTransport.H" #include "homogeneousMixture.H" #include "inhomogeneousMixture.H" @@ -352,6 +353,33 @@ makeThermoPhysicsReactionThermos icoPoly8EThermoPhysics ); +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constFluidEThermoPhysics +); + +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constAdiabaticFluidEThermoPhysics +); + +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constEThermoPhysics +); + // Single-step reaction thermo for internal energy @@ -455,6 +483,17 @@ makeReactionThermo specie ); +makeReactionThermo +( + rhoReactionThermo, + heRhoThermo, + singleComponentMixture, + WLFTransport, + sensibleInternalEnergy, + eConstThermo, + rhoConst, + specie +); // Multi-component thermo for sensible enthalpy @@ -587,6 +626,32 @@ makeThermoPhysicsReactionThermos icoPoly8HThermoPhysics ); +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constFluidHThermoPhysics +); + +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constAdiabaticFluidHThermoPhysics +); + +makeThermoPhysicsReactionThermos +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constHThermoPhysics +); // Single-step reaction thermo for sensible enthalpy diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H index 2a4877b5326881b1dedfdb831861628af641b564..ddee5780b713cabcf8cfc3d91f579ed08cf74f5d 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H @@ -168,6 +168,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H index 3ac925a4f735d45efddf08a8e45c8debc951d201..a85498b7848c331f157f1dfc084458c87e56a6a5 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H @@ -102,6 +102,19 @@ inline Foam::scalar Foam::Boussinesq<Specie>::Cp(scalar p, scalar T) const return 0; } +template<class Specie> +inline Foam::scalar Foam::Boussinesq<Specie>::E(scalar p, scalar T) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::Boussinesq<Specie>::Cv(scalar p, scalar T) const +{ + return 0; +} + template<class Specie> inline Foam::scalar Foam::Boussinesq<Specie>::S @@ -143,7 +156,7 @@ inline Foam::scalar Foam::Boussinesq<Specie>::CpMCv scalar T ) const { - return this->R(); + return 0; } diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H index 2c46215982eeb07594ba75a4694759624e8bd69c..b0803f48cf970f4ef46f365a464f504f82dbb1dd 100644 --- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H +++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGas.H @@ -166,6 +166,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H index 5e5378d4cc144aa84609537a6bf2bbf7b4d4b326..2879d9c76e9739b72c99881f80e73c7eb0982ac3 100644 --- a/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/PengRobinsonGas/PengRobinsonGasI.H @@ -154,6 +154,50 @@ inline Foam::scalar Foam::PengRobinsonGas<Specie>::Cp(scalar p, scalar T) const } +template<class Specie> +inline Foam::scalar Foam::PengRobinsonGas<Specie>::E(scalar p, scalar T) const +{ + const scalar Pr = p/Pc_; + const scalar Tr = T/Tc_; + const scalar B = 0.07780*Pr/Tr; + const scalar kappa = 0.37464 + 1.54226*omega_ - 0.26992*sqr(omega_); + const scalar alpha = sqr(1 + kappa*(1 - sqrt(Tr))); + + const scalar Z = this->Z(p, T); + + return + this->R() + *Tc_ + *( + - 2.078*(1 + kappa)*sqrt(alpha) + *log((Z + 2.414*B)/(Z - 0.414*B)) + ); +} + + +template<class Specie> +inline Foam::scalar Foam::PengRobinsonGas<Specie>::Cv(scalar p, scalar T) const +{ + const scalar a = 0.45724*sqr(RR*Tc_)/Pc_; + const scalar b = 0.07780*RR*Tc_/Pc_; + const scalar kappa = 0.37464 + 1.54226*omega_ - 0.26992*sqr(omega_); + + const scalar B = b*p/(RR*T); + + const scalar Z = this->Z(p, T); + + const scalar app = kappa*a*(1 + kappa)/(2*sqrt(pow3(T)*Tc_)); + + const scalar root2 = sqrt(2.0); + + return + ( + app*(T/(2*root2*b))*log((Z + (root2 + 1)*B)/(Z - (root2 - 1)*B)) + - RR + )/this->W(); +} + + template<class Specie> inline Foam::scalar Foam::PengRobinsonGas<Specie>::S ( diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H index 66cb71580cf49e6620ce9582264e78bac2fe5e37..b9419f2e5108a91bcbb2342e3a3a611083b1bb56 100644 --- a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluid.H @@ -165,6 +165,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H index 4082a43b3661f694a9a8f08d1a4463d6ce2e8dc7..7f8df4f578a3af24683df469d6a18e00364b67c2 100644 --- a/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/adiabaticPerfectFluid/adiabaticPerfectFluidI.H @@ -118,6 +118,28 @@ inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Cp } +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::E +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Cv +( + scalar p, + scalar T +) const +{ + return 0; +} + + template<class Specie> inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::S ( diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H index 534bf43ef10a74ef0e3aee2d467cfa21f53bb170..76519e40217a40eddf0dd2034cc669d1c08e30dc 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -184,6 +184,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H index d68e20e68d1d4b4baedba384e869186ce5fd6b9e..1b640017d3ba66f14f819ac7c5a876044d2521d9 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -106,6 +106,28 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::Cp } +template<class Specie, int PolySize> +inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::E +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template<class Specie, int PolySize> +inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::Cv +( + scalar p, + scalar T +) const +{ + return 0; +} + + template<class Specie, int PolySize> inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::S ( @@ -146,7 +168,7 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::CpMCv scalar T ) const { - return -(p/sqr(rhoCoeffs_.value(T)))*rhoCoeffs_.derivative(T); + return 0; } diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H index c58f58da5d7202da7043857ca415d7f5dfec3db7..82279b48489f840d149b8dc9e4ff471e799155e0 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGas.H @@ -153,6 +153,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H index 29ba8dca616d2369a2b8ad5651da65b445d64a39..2638288c9a1d110568819c03ed04145194ca3ff1 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressiblePerfectGas/incompressiblePerfectGasI.H @@ -107,6 +107,28 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Cp } +template<class Specie> +inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::E +( + scalar p, + scalar T +) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Cv +( + scalar p, + scalar T +) const +{ + return 0; +} + + template<class Specie> inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::S ( @@ -147,7 +169,7 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::CpMCv scalar T ) const { - return this->R(); + return 0; } diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linear.H b/src/thermophysicalModels/specie/equationOfState/linear/linear.H index 466e8ef149674efbeaaa2877396445af184011ab..a76bfcb76f7ad4dbca0072e8c9f45091bc5e3e3e 100644 --- a/src/thermophysicalModels/specie/equationOfState/linear/linear.H +++ b/src/thermophysicalModels/specie/equationOfState/linear/linear.H @@ -154,6 +154,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H index f5a4e2b144ee7bd4c0176d83fd010f46c65f7c2d..a5a19b83a86f9e7a909e88f6b14932268e8be5e5 100644 --- a/src/thermophysicalModels/specie/equationOfState/linear/linearI.H +++ b/src/thermophysicalModels/specie/equationOfState/linear/linearI.H @@ -99,6 +99,19 @@ inline Foam::scalar Foam::linear<Specie>::Cp(scalar p, scalar T) const return 0; } +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::E(scalar p, scalar T) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::linear<Specie>::Cv(scalar p, scalar T) const +{ + return 0; +} + template<class Specie> inline Foam::scalar Foam::linear<Specie>::S(scalar p, scalar T) const diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H index f50cf28a6636c125dc882f0ad42d6923c51df6c5..0ccfc18deeec3036277214567cf292250121a987 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluid.H @@ -153,6 +153,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H index ee58d0b339231b3548518d42c9f244d171106261..402e02135b5ded6a75a1ab959eafd1b2d96a2aff 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H @@ -97,7 +97,7 @@ inline Foam::scalar Foam::perfectFluid<Specie>::rho(scalar p, scalar T) const template<class Specie> inline Foam::scalar Foam::perfectFluid<Specie>::H(scalar p, scalar T) const { - return 0; + return 0; } @@ -108,6 +108,20 @@ inline Foam::scalar Foam::perfectFluid<Specie>::Cp(scalar p, scalar T) const } +template<class Specie> +inline Foam::scalar Foam::perfectFluid<Specie>::E(scalar p, scalar T) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::perfectFluid<Specie>::Cv(scalar p, scalar T) const +{ + return 0; +} + + template<class Specie> inline Foam::scalar Foam::perfectFluid<Specie>::S(scalar p, scalar T) const { @@ -132,7 +146,10 @@ inline Foam::scalar Foam::perfectFluid<Specie>::Z(scalar p, scalar T) const template<class Specie> inline Foam::scalar Foam::perfectFluid<Specie>::CpMCv(scalar p, scalar T) const { - return 0; + const scalar R = this->R(); + const scalar rho = this->rho(p, T); + + return R*sqr(p/(rho*R*T)); } diff --git a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H index b37e0dd1ebf00f0e7838397118dbd14d5ad95381..3b3f8c758d714c952bb64badc73a190ee4b680db 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGas.H @@ -137,6 +137,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H index 1180fd50b9c23977c47da4b41742249439df3eeb..67f7df5c853c89781ac6cda253239d62bda53f2f 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H @@ -93,6 +93,20 @@ inline Foam::scalar Foam::perfectGas<Specie>::Cp(scalar p, scalar T) const } +template<class Specie> +inline Foam::scalar Foam::perfectGas<Specie>::E(scalar p, scalar T) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::perfectGas<Specie>::Cv(scalar p, scalar T) const +{ + return 0; +} + + template<class Specie> inline Foam::scalar Foam::perfectGas<Specie>::S(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H index 9cc2f6bf356dde800565271900128e8776d49b48..cc4b29d4ab2300b2d26598e7f2b900aa1f997631 100644 --- a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H +++ b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConst.H @@ -139,6 +139,12 @@ public: //- Return Cp departure [J/(kg K] inline scalar Cp(scalar p, scalar T) const; + //- Return internal energy departure [J/kg] + inline scalar E(const scalar p, const scalar T) const; + + //- Return Cv departure [J/(kg K] + inline scalar Cv(scalar p, scalar T) const; + //- Return entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H index 49a15e9aac6cae928e27c7cab256a4750e2d8da2..716ff75c70f1f6a102de0d0803d63dc7285db5eb 100644 --- a/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H +++ b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H @@ -86,6 +86,20 @@ inline Foam::scalar Foam::rhoConst<Specie>::Cp(scalar p, scalar T) const } +template<class Specie> +inline Foam::scalar Foam::rhoConst<Specie>::E(scalar p, scalar T) const +{ + return 0; +} + + +template<class Specie> +inline Foam::scalar Foam::rhoConst<Specie>::Cv(scalar p, scalar T) const +{ + return 0; +} + + template<class Specie> inline Foam::scalar Foam::rhoConst<Specie>::S(scalar p, scalar T) const { diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index 019054a33f9ef6e43250df6a823d1030a7d9d77d..fee28eb3a816bffe3c3baab9edcac721bdbf5d94 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -58,6 +58,14 @@ namespace Foam typedef Reaction<icoPoly8HThermoPhysics> icoPoly8HReaction; + typedef Reaction<constFluidHThermoPhysics> constFluidHReaction; + + typedef Reaction<constAdiabaticFluidHThermoPhysics> + constAdiabaticFluidHReaction; + + typedef Reaction<constHThermoPhysics> constHReaction; + + // internal ennergy based reactions typedef Reaction<constGasEThermoPhysics> constGasEReaction; @@ -70,6 +78,13 @@ namespace Foam incompressibleGasEReaction; typedef Reaction<icoPoly8EThermoPhysics> icoPoly8EReaction; + + typedef Reaction<constFluidEThermoPhysics> constFluidEReaction; + + typedef Reaction<constAdiabaticFluidEThermoPhysics> + constAdiabaticFluidEReaction; + + typedef Reaction<constEThermoPhysics> constEReaction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index 3c06c56de7fb7ecd8c861aad3321e52ff2e83086..bad3682ae5b0e24cd0ab17add93ed07c52774dc4 100644 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -41,6 +41,7 @@ Description #include "adiabaticPerfectFluid.H" #include "rhoConst.H" #include "hConstThermo.H" +#include "eConstThermo.H" #include "janafThermo.H" #include "sensibleEnthalpy.H" @@ -188,7 +189,7 @@ namespace Foam < species::thermo < - hConstThermo + eConstThermo < perfectGas<specie> >, @@ -214,7 +215,7 @@ namespace Foam < species::thermo < - hConstThermo + eConstThermo < incompressiblePerfectGas<specie> >, @@ -269,7 +270,7 @@ namespace Foam < species::thermo < - hConstThermo + eConstThermo < perfectFluid<specie> >, @@ -283,7 +284,7 @@ namespace Foam < species::thermo < - hConstThermo + eConstThermo < adiabaticPerfectFluid<specie> >, @@ -297,7 +298,7 @@ namespace Foam < species::thermo < - hConstThermo + eConstThermo < rhoConst<specie> >, diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C index 5b922da42e3f4b1c75d63f43a4787fa9bcfad9e2..44d5a58eef98661cc512dab98e3f86ff971ea8da 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C @@ -94,6 +94,14 @@ namespace Foam ) makeReactions(incompressibleGasHThermoPhysics, incompressibleGasHReaction) makeReactions(icoPoly8HThermoPhysics, icoPoly8HReaction) + makeReactions(constFluidHThermoPhysics, constFluidHReaction) + makeReactions + ( + constAdiabaticFluidHThermoPhysics, + constAdiabaticFluidHReaction + ) + makeReactions(constHThermoPhysics, constHReaction) + makeReactions(constGasEThermoPhysics, constGasEReaction) makeReactions(gasEThermoPhysics, gasEReaction) @@ -104,6 +112,13 @@ namespace Foam ) makeReactions(incompressibleGasEThermoPhysics, incompressibleGasEReaction) makeReactions(icoPoly8EThermoPhysics, icoPoly8EReaction) + makeReactions(constFluidEThermoPhysics, constFluidEReaction) + makeReactions + ( + constAdiabaticFluidEThermoPhysics, + constAdiabaticFluidEReaction + ) + makeReactions(constEThermoPhysics, constEReaction) } // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H b/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H index b84869d46c0abc79dfd4cdd29515d2ee19e294fc..38f8a656d9dc6f9b2ed9d00591d75e0ffbe13d96 100644 --- a/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H +++ b/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H @@ -69,7 +69,7 @@ public: // Fundamental properties - static word name() + static word energyName() { return "ha"; } diff --git a/src/thermophysicalModels/specie/thermo/absoluteInternalEnergy/absoluteInternalEnergy.H b/src/thermophysicalModels/specie/thermo/absoluteInternalEnergy/absoluteInternalEnergy.H index 75181c690bc2b5e3d104c85840dc2bbe3d3df681..d71076a835becee35431c5e6dedc3ca5835c374d 100644 --- a/src/thermophysicalModels/specie/thermo/absoluteInternalEnergy/absoluteInternalEnergy.H +++ b/src/thermophysicalModels/specie/thermo/absoluteInternalEnergy/absoluteInternalEnergy.H @@ -70,7 +70,7 @@ public: // Fundamental properties - static word name() + static word energyName() { return "ea"; } diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H index e527766aedbc3858de3eb99eeb8df042d9f974ac..f0066cb51ef2f71aab55c3b81af126639439a086 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H @@ -144,14 +144,14 @@ public: // Fundamental properties - //- Heat capacity at constant pressure [J/(kg K)] - inline scalar Cp(const scalar p, const scalar T) const; + //- Heat capacity at constant volume [J/(kg K)] + inline scalar Cv(const scalar p, const scalar T) const; - //- Absolute Enthalpy [J/kg] - inline scalar Ha(const scalar p, const scalar T) const; + //- Sensible internal energy [J/kg] + inline scalar Es(const scalar p, const scalar T) const; - //- Sensible enthalpy [J/kg] - inline scalar Hs(const scalar p, const scalar T) const; + //- Absolute internal energy [J/kg] + inline scalar Ea(const scalar p, const scalar T) const; //- Chemical enthalpy [J/kg] inline scalar Hc() const; @@ -159,6 +159,17 @@ public: //- Entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; + #include "EtoHthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + // I-O diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index 8649b29497d08d578a4ddd2dbbebe5c413269655..b528f6ff0e7ff4320d560ad726ffd5a0c0d36eef 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -85,35 +85,35 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::limit template<class EquationOfState> -inline Foam::scalar Foam::eConstThermo<EquationOfState>::Cp +inline Foam::scalar Foam::eConstThermo<EquationOfState>::Cv ( const scalar p, const scalar T ) const { - return Cv_ + this->CpMCv(p, T) + EquationOfState::Cp(p, T); + return Cv_ + EquationOfState::Cv(p, T); } template<class EquationOfState> -inline Foam::scalar Foam::eConstThermo<EquationOfState>::Ha +inline Foam::scalar Foam::eConstThermo<EquationOfState>::Es ( const scalar p, const scalar T ) const { - return Cp(p, T)*T + Hf_ + EquationOfState::H(p, T); + return Cv_*T + EquationOfState::E(p, T); } template<class EquationOfState> -inline Foam::scalar Foam::eConstThermo<EquationOfState>::Hs +inline Foam::scalar Foam::eConstThermo<EquationOfState>::Ea ( const scalar p, const scalar T ) const { - return Cp(p, T)*T + EquationOfState::H(p, T); + return Es(p, T) + Hc(); } @@ -135,6 +135,27 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::S } +template<class EquationOfState> +inline Foam::scalar Foam::eConstThermo<EquationOfState>::dGdT +( + const scalar p, + const scalar T +) const +{ + return 0; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eConstThermo<EquationOfState>::dCpdT +( + const scalar p, + const scalar T +) const +{ + return 0; +} + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState> diff --git a/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.C b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..f433a407d499a2f0e5e1778a2308b7916789813e --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.C @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "eRefConstThermo.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class EquationOfState> +Foam::eRefConstThermo<EquationOfState>::eRefConstThermo(const dictionary& dict) +: + EquationOfState(dict), + Cv_(readScalar(dict.subDict("thermodynamics").lookup("Cv"))), + Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf"))), + Tref_(readScalar(dict.subDict("thermodynamics").lookup("Tref"))), + Eref_(readScalar(dict.subDict("thermodynamics").lookup("Eref"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class EquationOfState> +void Foam::eRefConstThermo<EquationOfState>::write(Ostream& os) const +{ + EquationOfState::write(os); + + dictionary dict("thermodynamics"); + dict.add("Cv", Cv_); + dict.add("Hf", Hf_); + dict.add("Tref", Tref_); + dict.add("Eref", Eref_); + os << indent << dict.dictName() << dict; +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template<class EquationOfState> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const eRefConstThermo<EquationOfState>& ct +) +{ + ct.write(os); + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.H b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..938d56cb9a73cf8a59524471fd784e1b01110759 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.H @@ -0,0 +1,224 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::eRefConstThermo + +Description + Constant properties thermodynamics package + templated into the EquationOfState. + +SourceFiles + eRefConstThermoI.H + eRefConstThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef eRefConstThermo_H +#define eRefConstThermo_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class EquationOfState> class eRefConstThermo; + +template<class EquationOfState> +inline eRefConstThermo<EquationOfState> operator+ +( + const eRefConstThermo<EquationOfState>&, + const eRefConstThermo<EquationOfState>& +); + +template<class EquationOfState> +inline eRefConstThermo<EquationOfState> operator* +( + const scalar, + const eRefConstThermo<EquationOfState>& +); + +template<class EquationOfState> +inline eRefConstThermo<EquationOfState> operator== +( + const eRefConstThermo<EquationOfState>&, + const eRefConstThermo<EquationOfState>& +); + +template<class EquationOfState> +Ostream& operator<< +( + Ostream&, + const eRefConstThermo<EquationOfState>& +); + + +/*---------------------------------------------------------------------------*\ + Class eRefConstThermo Declaration +\*---------------------------------------------------------------------------*/ + +template<class EquationOfState> +class eRefConstThermo +: + public EquationOfState +{ + // Private data + + scalar Cv_; + scalar Hf_; + scalar Tref_; + scalar Eref_; + + + // Private Member Functions + + //- Construct from components + inline eRefConstThermo + ( + const EquationOfState& st, + const scalar cv, + const scalar hf, + const scalar tref, + const scalar eref + ); + + +public: + + // Constructors + + //- Construct from dictionary + eRefConstThermo(const dictionary& dict); + + //- Construct as named copy + inline eRefConstThermo(const word&, const eRefConstThermo&); + + //- Construct and return a clone + inline autoPtr<eRefConstThermo> clone() const; + + //- Selector from dictionary + inline static autoPtr<eRefConstThermo> New(const dictionary& dict); + + + // Member Functions + + //- Return the instantiated type name + static word typeName() + { + return "eRefConst<" + EquationOfState::typeName() + '>'; + } + + //- Limit the temperature to be in the range Tlow_ to Thigh_ + inline scalar limit(const scalar T) const; + + + // Fundamental properties + + //- Heat capacity at constant volume [J/(kg K)] + inline scalar Cv(const scalar p, const scalar T) const; + + //- Sensible internal energy [J/kg] + inline scalar Es(const scalar p, const scalar T) const; + + //- Absolute internal energy [J/kg] + inline scalar Ea(const scalar p, const scalar T) const; + + //- Chemical enthalpy [J/kg] + inline scalar Hc() const; + + //- Entropy [J/(kg K)] + inline scalar S(const scalar p, const scalar T) const; + + #include "EtoHthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + + + // I-O + + //- Write to Ostream + void write(Ostream& os) const; + + + // Member operators + + inline void operator+=(const eRefConstThermo&); + + + // Friend operators + + friend eRefConstThermo operator+ <EquationOfState> + ( + const eRefConstThermo&, + const eRefConstThermo& + ); + + friend eRefConstThermo operator* <EquationOfState> + ( + const scalar, + const eRefConstThermo& + ); + + friend eRefConstThermo operator== <EquationOfState> + ( + const eRefConstThermo&, + const eRefConstThermo& + ); + + + // IOstream Operators + + friend Ostream& operator<< <EquationOfState> + ( + Ostream&, + const eRefConstThermo& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "eRefConstThermoI.H" + +#ifdef NoRepository + #include "eRefConstThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermoI.H b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermoI.H new file mode 100644 index 0000000000000000000000000000000000000000..dea35619459403439f88759122540ed6ada29a19 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermoI.H @@ -0,0 +1,274 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class EquationOfState> +inline Foam::eRefConstThermo<EquationOfState>::eRefConstThermo +( + const EquationOfState& st, + const scalar cv, + const scalar hf, + const scalar tref, + const scalar eref +) +: + EquationOfState(st), + Cv_(cv), + Hf_(hf), + Tref_(tref), + Eref_(eref) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class EquationOfState> +inline Foam::eRefConstThermo<EquationOfState>::eRefConstThermo +( + const word& name, + const eRefConstThermo& ct +) +: + EquationOfState(name, ct), + Cv_(ct.Cv_), + Hf_(ct.Hf_), + Tref_(ct.Tref_), + Eref_(ct.Eref_) +{} + + +template<class EquationOfState> +inline Foam::autoPtr<Foam::eRefConstThermo<EquationOfState>> +Foam::eRefConstThermo<EquationOfState>::clone() const +{ + return autoPtr<eRefConstThermo<EquationOfState>> + ( + new eRefConstThermo<EquationOfState>(*this) + ); +} + + +template<class EquationOfState> +inline Foam::autoPtr<Foam::eRefConstThermo<EquationOfState>> +Foam::eRefConstThermo<EquationOfState>::New(const dictionary& dict) +{ + return autoPtr<eRefConstThermo<EquationOfState>> + ( + new eRefConstThermo<EquationOfState>(dict) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::limit +( + const scalar T +) const +{ + return T; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::Cv +( + const scalar p, + const scalar T +) const +{ + return Cv_ + EquationOfState::Cv(p, T); +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::Es +( + const scalar p, const scalar T +) const +{ + return Cv_*(T - Tref_) + Eref_ + EquationOfState::E(p, T); +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::Hc() const +{ + return Hf_; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::Ea +( + const scalar p, const scalar T +) const +{ + return Es(p, T) + Hc(); +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::S +( + const scalar p, const scalar T +) const +{ + return Cp(p, T)*log(T/Tstd) + EquationOfState::S(p, T); +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::dGdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::eRefConstThermo<EquationOfState>::dCpdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class EquationOfState> +inline void Foam::eRefConstThermo<EquationOfState>::operator+= +( + const eRefConstThermo<EquationOfState>& ct +) +{ + scalar Y1 = this->Y(); + + EquationOfState::operator+=(ct); + + if (mag(this->Y()) > SMALL) + { + Y1 /= this->Y(); + const scalar Y2 = ct.Y()/this->Y(); + + Cv_ = Y1*Cv_ + Y2*ct.Cv_; + Hf_ = Y1*Hf_ + Y2*ct.Hf_; + } +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class EquationOfState> +inline Foam::eRefConstThermo<EquationOfState> Foam::operator+ +( + const eRefConstThermo<EquationOfState>& ct1, + const eRefConstThermo<EquationOfState>& ct2 +) +{ + EquationOfState eofs + ( + static_cast<const EquationOfState&>(ct1) + + static_cast<const EquationOfState&>(ct2) + ); + + if (mag(eofs.Y()) < SMALL) + { + return eRefConstThermo<EquationOfState> + ( + eofs, + ct1.Cv_, + ct1.Hf_, + ct1.Tref_, + ct1.Eref_ + ); + } + else + { + return eRefConstThermo<EquationOfState> + ( + eofs, + ct1.Y()/eofs.Y()*ct1.Cv_ + + ct2.Y()/eofs.Y()*ct2.Cv_, + ct1.Y()/eofs.Y()*ct1.Hf_ + + ct2.Y()/eofs.Y()*ct2.Hf_, + ct1.Y()/eofs.Y()*ct1.Tref_ + + ct2.Y()/eofs.Y()*ct2.Tref_, + ct1.Y()/eofs.Y()*ct1.Eref_ + + ct2.Y()/eofs.Y()*ct2.Eref_ + ); + } +} + + +template<class EquationOfState> +inline Foam::eRefConstThermo<EquationOfState> Foam::operator* +( + const scalar s, + const eRefConstThermo<EquationOfState>& ct +) +{ + return eRefConstThermo<EquationOfState> + ( + s*static_cast<const EquationOfState&>(ct), + ct.Cv_, + ct.Hf_, + ct.Tref_, + ct.Eref_ + ); +} + + +template<class EquationOfState> +inline Foam::eRefConstThermo<EquationOfState> Foam::operator== +( + const eRefConstThermo<EquationOfState>& ct1, + const eRefConstThermo<EquationOfState>& ct2 +) +{ + EquationOfState eofs + ( + static_cast<const EquationOfState&>(ct1) + == static_cast<const EquationOfState&>(ct2) + ); + + return eRefConstThermo<EquationOfState> + ( + eofs, + ct2.Y()/eofs.Y()*ct2.Cv_ + - ct1.Y()/eofs.Y()*ct1.Cv_, + ct2.Y()/eofs.Y()*ct2.Hf_ + - ct1.Y()/eofs.Y()*ct1.Hf_ + ); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H index 3078767d1724932b47f60e17c8b61125ee5a828d..dd222982c30f17133d65d60db17b3271343b69d5 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H @@ -152,6 +152,18 @@ public: //- Entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; + #include "HtoEthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + + // I-O diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H index 693836febef6fda7ebb3a4023dd3d5fa325c5828..74cc1d57096d1c8ed7374691943d70d8f1334805 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H @@ -101,7 +101,7 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::Ha const scalar p, const scalar T ) const { - return Cp_*T + Hf_ + EquationOfState::H(p, T); + return Hs(p, T) + Hc(); } @@ -132,6 +132,25 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::S } +template<class EquationOfState> +inline Foam::scalar Foam::hConstThermo<EquationOfState>::dGdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::hConstThermo<EquationOfState>::dCpdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState> diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H index b9adcafb664c075dfd2754b1ea8e049474100039..cd8d730e6cdba89b7e1bb55954b46a5476a3274a 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H @@ -209,6 +209,19 @@ public: inline scalar S(const scalar p, const scalar T) const; + #include "HtoEthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + + + // I-O //- Write to Ostream diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 87497bb1e8c691242473a2f6679c62b59a6101df..543ca9970613d7e0b238dad901923e2bcbb9a7e5 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -128,6 +128,35 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::S } +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dGdT +( + const scalar p, + const scalar T +) const +{ + return + ( + hCoeffs_.derivative(T) + - T*sCoeffs_.derivative(T) + - sCoeffs_.value(T) + ); +} + + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dCpdT +( + const scalar p, + const scalar T +) const +{ + return + ( + CpCoeffs_.derivative(T) + ); +} + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState, int PolySize> diff --git a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermo.H b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermo.H index 354fa9c50e80cb5c1b3cf07f0109b304d6eed5f8..68205ebe02f6a7d4fff5fa5c78840847d0332a3d 100644 --- a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermo.H @@ -174,6 +174,19 @@ public: inline scalar S(const scalar p, const scalar T) const; + #include "HtoEthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + + + // Member operators inline void operator+=(const hPowerThermo&); diff --git a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H index c265140035921640cbfdfd0d2050203d5c2a7970..c6e8dd25b0bde69aad5fb0eff8b0205ff3ae5250 100644 --- a/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPower/hPowerThermoI.H @@ -160,6 +160,30 @@ inline Foam::scalar Foam::hPowerThermo<EquationOfState>::S } +template<class EquationOfState> +inline Foam::scalar Foam::hPowerThermo<EquationOfState>::dGdT +( + const scalar p, const scalar T +) const +{ + // To be implemented + NotImplemented; + return 0; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::hPowerThermo<EquationOfState>::dCpdT +( + const scalar p, const scalar T +) const +{ + // To be implemented + NotImplemented; + return 0; +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState> diff --git a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermo.H b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermo.H index 9ad3008c1bfb063e3235f16a8d3ef3cb76f74bf6..65be6cc0229bdbaeb8e293e7bd81feb0a6f6ede6 100644 --- a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermo.H @@ -156,6 +156,17 @@ public: //- Entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; + #include "HtoEthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + // I-O diff --git a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H index 0a3f5d39b0478409116c3b256408858ee34edea3..b4894800981cc8f87846e08775826ee4808c3ef2 100644 --- a/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H @@ -107,7 +107,7 @@ inline Foam::scalar Foam::hRefConstThermo<EquationOfState>::Ha const scalar p, const scalar T ) const { - return Cp_*(T-Tref_) + Href_ + Hf_ + EquationOfState::H(p, T); + return Hs(p, T) + Hc(); } @@ -138,6 +138,26 @@ inline Foam::scalar Foam::hRefConstThermo<EquationOfState>::S } +template<class EquationOfState> +inline Foam::scalar Foam::hRefConstThermo<EquationOfState>::dGdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + + +template<class EquationOfState> +inline Foam::scalar Foam::hRefConstThermo<EquationOfState>::dCpdT +( + const scalar p, const scalar T +) const +{ + return 0; +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState> diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H index 3349e8c1870656d2b70b71f1cbcfc430d63d5116..40f94d953151f55b86c985c64fab3c14132a4a88 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H @@ -191,6 +191,17 @@ public: //- Entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; + #include "HtoEthermo.H" + + + // Derivative term used for Jacobian + + //- Derivative of Gibbs free energy w.r.t. temperature + inline scalar dGdT(const scalar p, const scalar T) const; + + //- Temperature derivative of heat capacity at constant pressure + inline scalar dCpdT(const scalar p, const scalar T) const; + // I-O diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index acbd05506ce74b1b57e35fb98f601f1e5f5b1954..9a370e9dc05e55d0d6972228b2dd04170d6b9152 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -239,6 +239,30 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::S } +template<class EquationOfState> +inline Foam::scalar Foam::janafThermo<EquationOfState>::dGdT +( + const scalar p, + const scalar T +) const +{ + const coeffArray& a = coeffs(T); + return -((a[0] + a[5]/T)/T + a[1]/2 + T*(a[2]/3 + T*(a[3]/4 + T*a[4]/5))); +} + + +template<class EquationOfState> +inline Foam::scalar Foam::janafThermo<EquationOfState>::dCpdT +( + const scalar p, + const scalar T +) const +{ + const coeffArray& a = coeffs(T); + return + (((4*a[4]*T + 3*a[3])*T + 2*a[2])*T + a[1]); +} + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class EquationOfState> diff --git a/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H b/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H index 5073ebb302237341b04c694ab5009fa026b8ff20..41bc17f2ac969b6c42595c1b4d7f977489940dcc 100644 --- a/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H +++ b/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H @@ -69,7 +69,7 @@ public: // Fundamental properties - static word name() + static word energyName() { return "h"; } diff --git a/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H b/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H index feffbdc4e6d46817df10b398470c81ab14ea2777..dff64d1e3b5e7f9f896d2d074dc538776bc2f916 100644 --- a/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H +++ b/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H @@ -69,7 +69,7 @@ public: // Fundamental properties - static word name() + static word energyName() { return "e"; } diff --git a/src/thermophysicalModels/specie/thermo/thermo/EtoHthermo.H b/src/thermophysicalModels/specie/thermo/thermo/EtoHthermo.H new file mode 100644 index 0000000000000000000000000000000000000000..89d0a6d7d996bf55e02694f5f2599b0b26eafe46 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/thermo/EtoHthermo.H @@ -0,0 +1,26 @@ +inline scalar Cp +( + const scalar p, + const scalar T +) const +{ + return Cv(p, T) + EquationOfState::CpMCv(p, T); +} + +inline scalar Hs +( + const scalar p, + const scalar T +) const +{ + return Es(p, T) + p/EquationOfState::rho(p, T); +} + +inline scalar Ha +( + const scalar p, + const scalar T +) const +{ + return Ea(p, T) + p/EquationOfState::rho(p, T); +} diff --git a/src/thermophysicalModels/specie/thermo/thermo/HtoEthermo.H b/src/thermophysicalModels/specie/thermo/thermo/HtoEthermo.H new file mode 100644 index 0000000000000000000000000000000000000000..67561713fe8585023bcc643be3b77165dc3c12c0 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/thermo/HtoEthermo.H @@ -0,0 +1,26 @@ +inline scalar Cv +( + const scalar p, + const scalar T +) const +{ + return Cp(p, T) - EquationOfState::CpMCv(p, T); +} + +inline scalar Es +( + const scalar p, + const scalar T +) const +{ + return Hs(p, T) - p/EquationOfState::rho(p, T); +} + +inline scalar Ea +( + const scalar p, + const scalar T +) const +{ + return Ha(p, T) - p/EquationOfState::rho(p, T); +} diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermo.H b/src/thermophysicalModels/specie/thermo/thermo/thermo.H index 73cfcc9ee6c60170950c26aa2269e324df607d0f..ad040193f2cc1ab53e858b2d7232a35e874fde35 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermo.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermo.H @@ -165,14 +165,21 @@ public: // Absolute Enthalpy [J/kg] // inline scalar Ha(const scalar p, const scalar T) const; + // Heat capacity at constant volume [J/(kg K)] + // inline scalar Cv(const scalar p, const scalar T) const; + + // Sensible internal energy [J/kg] + // inline scalar Es(const scalar p, const scalar T) const; + + // Absolute internal energy [J/kg] + // inline scalar Ea(const scalar p, const scalar T) const; + // Entropy [J/(kg K)] // inline scalar S(const scalar p, const scalar T) const; // Mass specific derived properties - //- Heat capacity at constant volume [J/(kg K)] - inline scalar Cv(const scalar p, const scalar T) const; //- Heat capacity at constant pressure/volume [J/(kg K)] inline scalar Cpv(const scalar p, const scalar T) const; @@ -187,12 +194,6 @@ public: //- Enthalpy/Internal energy [J/kg] inline scalar HE(const scalar p, const scalar T) const; - //- Sensible internal energy [J/kg] - inline scalar Es(const scalar p, const scalar T) const; - - //- Absolute internal energy [J/kg] - inline scalar Ea(const scalar p, const scalar T) const; - //- Gibbs free energy [J/kg] inline scalar G(const scalar p, const scalar T) const; @@ -320,6 +321,15 @@ public: ) const; + // Derivative term used for Jacobian + + //- Derivative of B (acooding to Niemeyer et al.) w.r.t. temperature + inline scalar dKcdTbyKc(const scalar p, const scalar T) const; + + //- Derivative of cp w.r.t. temperature + inline scalar dcpdT(const scalar p, const scalar T) const; + + // I-O //- Write to Ostream diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H index 5e1b3c85b0a1b7f00f7f7535dccec270ab04e538..f03d8b5b11a4b2623b8161ce260347749614b85b 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H @@ -102,15 +102,7 @@ template<class Thermo, template<class> class Type> inline Foam::word Foam::species::thermo<Thermo, Type>::heName() { - return Type<thermo<Thermo, Type>>::name(); -} - - -template<class Thermo, template<class> class Type> -inline Foam::scalar -Foam::species::thermo<Thermo, Type>::Cv(const scalar p, const scalar T) const -{ - return this->Cp(p, T) - this->CpMCv(p, T); + return Type<thermo<Thermo, Type>>::energyName(); } @@ -151,22 +143,6 @@ Foam::species::thermo<Thermo, Type>::HE(const scalar p, const scalar T) const } -template<class Thermo, template<class> class Type> -inline Foam::scalar -Foam::species::thermo<Thermo, Type>::Es(const scalar p, const scalar T) const -{ - return this->Hs(p, T) - p/this->rho(p, T); -} - - -template<class Thermo, template<class> class Type> -inline Foam::scalar -Foam::species::thermo<Thermo, Type>::Ea(const scalar p, const scalar T) const -{ - return this->Ha(p, T) - p/this->rho(p, T); -} - - template<class Thermo, template<class> class Type> inline Foam::scalar Foam::species::thermo<Thermo, Type>::G(const scalar p, const scalar T) const @@ -446,6 +422,34 @@ inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEa } +template<class Thermo, template<class> class Type> +inline Foam::scalar +Foam::species::thermo<Thermo, Type>::dKcdTbyKc +( + const scalar p, + const scalar T +) const +{ + const scalar nm = this->Y()/this->W(); + + if (equal(nm, SMALL)) + { + return -this->dGdT(Pstd, T)*this->Y()/RR; + } + else + { + return -(nm/T + this->dGdT(Pstd, T)*this->Y()/RR); + } +} + + +template<class Thermo, template<class> class Type> +inline Foam::scalar +Foam::species::thermo<Thermo, Type>::dcpdT(const scalar p, const scalar T) const +{ + return this->dCpdT(p, T)*this->W(); +} + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Thermo, template<class> class Type> diff --git a/src/thermophysicalModels/specie/transport/WLF/WLFTransport.C b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.C new file mode 100644 index 0000000000000000000000000000000000000000..628600401df33a59d93eca645213dd36a9d0fa2a --- /dev/null +++ b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "WLFTransport.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Thermo> +Foam::scalar Foam::WLFTransport<Thermo>::readCoeff +( + const word& coeffName, + const dictionary& dict +) +{ + return readScalar(dict.subDict("transport").lookup(coeffName)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo> +Foam::WLFTransport<Thermo>::WLFTransport(const dictionary& dict) +: + Thermo(dict), + mu0_(readCoeff("mu0", dict)), + Tr_(readCoeff("Tr", dict)), + C1_(readCoeff("C1", dict)), + C2_(readCoeff("C2", dict)), + rPr_(1.0/readScalar(dict.subDict("transport").lookup("Pr"))) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Thermo> +void Foam::WLFTransport<Thermo>::write(Ostream& os) const +{ + os << this->specie::name() << endl + << token::BEGIN_BLOCK << incrIndent << nl; + + Thermo::write(os); + + dictionary dict("transport"); + dict.add("mu0", mu0_); + dict.add("Tr", Tr_); + dict.add("C1", C1_); + dict.add("C2", C2_); + dict.add("Pr", 1.0/rPr_); + + os << indent << dict.dictName() << dict + << decrIndent << token::END_BLOCK << nl; +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<class Thermo> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const WLFTransport<Thermo>& wlft +) +{ + wlft.write(os); + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H new file mode 100644 index 0000000000000000000000000000000000000000..d267b5a2be6c440ab26aa9d1dcd98bb3dc0c5ea8 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H @@ -0,0 +1,210 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::WLFTransport + +Description + Transport package using the Williams-Landel-Ferry model. + + Templated into a given thermodynamics package (needed for thermal + conductivity). + + Dynamic viscosity [kg/m.s] + \f[ + \mu = \mu_0 \exp \left(\frac{-C_1 ( T - T_r )}{C_2 + T - T_r}\right) + \f] + + References: + \verbatim + Williams, M. L., Landel, R. F., & Ferry, J. D. (1955). + The temperature dependence of relaxation mechanisms + in amorphous polymers and other glass-forming liquids. + Journal of the American Chemical society, 77(14), 3701-3707. + \endverbatim + +SourceFiles + WLFTransportI.H + WLFTransport.C + +\*---------------------------------------------------------------------------*/ + +#ifndef WLFTransport_H +#define WLFTransport_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class Thermo> class WLFTransport; + +template<class Thermo> +inline WLFTransport<Thermo> operator+ +( + const WLFTransport<Thermo>&, + const WLFTransport<Thermo>& +); + +template<class Thermo> +inline WLFTransport<Thermo> operator* +( + const scalar, + const WLFTransport<Thermo>& +); + +template<class Thermo> +Ostream& operator<< +( + Ostream&, + const WLFTransport<Thermo>& +); + + +/*---------------------------------------------------------------------------*\ + Class WLFTransport Declaration +\*---------------------------------------------------------------------------*/ + +template<class Thermo> +class WLFTransport +: + public Thermo +{ + // Private data + + //- Dynamic viscosity at the reference temperature [Pa.s] + scalar mu0_; + + //- Reference temperature [T] + scalar Tr_; + + //- WLF coefficient 1 [] + scalar C1_; + + //- WLF coefficient 2 [T] + scalar C2_; + + //- Reciprocal Prandtl Number [] + scalar rPr_; + + + // Private Member Functions + + //- Read coefficient from dictionary + scalar readCoeff(const word& coeffName, const dictionary& dict); + + +public: + + // Constructors + + //- Construct as named copy + inline WLFTransport(const word&, const WLFTransport&); + + //- Construct from dictionary + WLFTransport(const dictionary& dict); + + //- Construct and return a clone + inline autoPtr<WLFTransport> clone() const; + + // Selector from dictionary + inline static autoPtr<WLFTransport> New(const dictionary& dict); + + + // Member functions + + //- Return the instantiated type name + static word typeName() + { + return "WLF<" + Thermo::typeName() + '>'; + } + + //- Dynamic viscosity [kg/ms] + inline scalar mu(const scalar p, const scalar T) const; + + //- Thermal conductivity [W/mK] + inline scalar kappa(const scalar p, const scalar T) const; + + //- Thermal diffusivity of enthalpy [kg/ms] + inline scalar alphah(const scalar p, const scalar T) const; + + // Species diffusivity + // inline scalar D(const scalar p, const scalar T) const; + + //- Write to Ostream + void write(Ostream& os) const; + + + // Member operators + + inline void operator=(const WLFTransport&); + + inline void operator+=(const WLFTransport&); + + inline void operator*=(const scalar); + + + // Friend operators + + friend WLFTransport operator+ <Thermo> + ( + const WLFTransport&, + const WLFTransport& + ); + + friend WLFTransport operator* <Thermo> + ( + const scalar, + const WLFTransport& + ); + + + // Ostream Operator + + friend Ostream& operator<< <Thermo> + ( + Ostream&, + const WLFTransport& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "WLFTransportI.H" + +#ifdef NoRepository + #include "WLFTransport.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H b/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H new file mode 100644 index 0000000000000000000000000000000000000000..b078e26c3c1a107ce1a0c8f5c0c60f59dde85c04 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H @@ -0,0 +1,222 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#include "specie.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo> +inline Foam::WLFTransport<Thermo>::WLFTransport +( + const word& name, + const WLFTransport& wlft +) +: + Thermo(name, wlft), + mu0_(wlft.mu0_), + Tr_(wlft.Tr_), + C1_(wlft.C1_), + C2_(wlft.C2_), + rPr_(wlft.rPr_) +{} + + +template<class Thermo> +inline Foam::autoPtr<Foam::WLFTransport<Thermo>> +Foam::WLFTransport<Thermo>::clone() const +{ + return autoPtr<WLFTransport<Thermo>> + ( + new WLFTransport<Thermo>(*this) + ); +} + + +template<class Thermo> +inline Foam::autoPtr<Foam::WLFTransport<Thermo>> +Foam::WLFTransport<Thermo>::New +( + const dictionary& dict +) +{ + return autoPtr<WLFTransport<Thermo>> + ( + new WLFTransport<Thermo>(dict) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Thermo> +inline Foam::scalar Foam::WLFTransport<Thermo>::mu +( + const scalar p, + const scalar T +) const +{ + return mu0_*exp(-C1_*(T - Tr_)/(C2_ + T - Tr_)); +} + + +template<class Thermo> +inline Foam::scalar Foam::WLFTransport<Thermo>::kappa +( + const scalar p, const scalar T +) const +{ + return this->Cp(p, T)*mu(p, T)*rPr_; +} + + +template<class Thermo> +inline Foam::scalar Foam::WLFTransport<Thermo>::alphah +( + const scalar p, + const scalar T +) const +{ + + return mu(p, T)*rPr_; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Thermo> +inline void Foam::WLFTransport<Thermo>::operator= +( + const WLFTransport<Thermo>& wlft +) +{ + Thermo::operator=(wlft); + + mu0_ = wlft.mu0_; + Tr_ = wlft.Tr_; + C1_ = wlft.C1_; + C2_ = wlft.C2_; + rPr_ = wlft.rPr_; +} + + +template<class Thermo> +inline void Foam::WLFTransport<Thermo>::operator+= +( + const WLFTransport<Thermo>& wlft +) +{ + scalar Y1 = this->Y(); + + Thermo::operator+=(wlft); + + if (mag(this->Y()) > SMALL) + { + Y1 /= this->Y(); + scalar Y2 = wlft.Y()/this->Y(); + + mu0_ = Y1*mu0_ + Y2*wlft.mu0_; + Tr_ = Y1*Tr_ + Y2*wlft.Tr_; + C1_ = Y1*C1_ + Y2*wlft.C1_; + C2_ = Y1*C2_ + Y2*wlft.C2_; + rPr_ = 1.0/(Y1/rPr_ + Y2/wlft.rPr_); + } +} + + +template<class Thermo> +inline void Foam::WLFTransport<Thermo>::operator*= +( + const scalar s +) +{ + Thermo::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class Thermo> +inline Foam::WLFTransport<Thermo> Foam::operator+ +( + const WLFTransport<Thermo>& wlft1, + const WLFTransport<Thermo>& wlft2 +) +{ + Thermo t + ( + static_cast<const Thermo&>(wlft1) + static_cast<const Thermo&>(wlft2) + ); + + if (mag(t.Y()) < SMALL) + { + return WLFTransport<Thermo> + ( + t, + 0, + wlft1.mu0_, + wlft1.Tr_, + wlft1.C1_, + wlft1.C2_, + wlft1.rPr_ + ); + } + else + { + scalar Y1 = wlft1.Y()/t.Y(); + scalar Y2 = wlft2.Y()/t.Y(); + + return WLFTransport<Thermo> + ( + t, + Y1*wlft1.mu0_ + Y2*wlft2.mu0_, + Y1*wlft1.Tr_ + Y2*wlft2.Tr_, + Y1*wlft1.C1_ + Y2*wlft2.C1_, + Y1*wlft1.C2_ + Y2*wlft2.C2_, + 1.0/(Y1/wlft1.rPr_ + Y2/wlft2.rPr_) + ); + } +} + + +template<class Thermo> +inline Foam::WLFTransport<Thermo> Foam::operator* +( + const scalar s, + const WLFTransport<Thermo>& wlft +) +{ + return WLFTransport<Thermo> + ( + s*static_cast<const Thermo&>(wlft), + wlft.mu0_, + wlft.Tr_, + wlft.C1_, + wlft.C2_, + 1.0/wlft.rPr_ + ); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.H index 38559aa10353b1c9f556ed93333b145681d8f198..a06abcc4bdb2fb677d907615168368f6034b128c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalProperties/thermophysicalProperties.H @@ -141,15 +141,15 @@ public: //- Heat capacity at constant pressure [J/(kg K)] virtual scalar Cp(const scalar p, const scalar T) const = 0; - //- Absolute Enthalpy [J/kg] - virtual scalar Ha(const scalar p, const scalar T) const = 0; - //- Sensible enthalpy [J/kg] virtual scalar Hs(const scalar p, const scalar T) const = 0; //- Chemical enthalpy [J/kg] virtual scalar Hc() const = 0; + //- Absolute Enthalpy [J/kg] + virtual scalar Ha(const scalar p, const scalar T) const = 0; + // Entropy [J/(kg K)] virtual scalar S(const scalar p, const scalar T) const = 0; diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H index c38e4acc218867a9af39431a45926de26987cfcb..19cc3e218bde1d7bcd8924625602d4cc5fc7df5c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H @@ -133,6 +133,15 @@ public: //- Chemical enthalpy [J/kg] inline scalar Hc() const; + //- Heat capacity at constant volume [J/(kg K)] + inline scalar Cv(const scalar p, const scalar T) const; + + //- Sensible internal energy [J/kg] + inline scalar Es(const scalar p, const scalar T) const; + + //- Absolute internal energy [J/kg] + inline scalar Ea(const scalar p, const scalar T) const; + // Entropy [J/(kg K)] inline scalar S(const scalar p, const scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H index f1de7ada6d16439e001ca7caa9cdce4860d44053..26c4c396e105cb8b737907251d680d6fae31ef0b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H @@ -135,6 +135,42 @@ Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Hc() const } +template<class ThermophysicalProperties> +inline Foam::scalar +Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Cv +( + scalar p, + scalar T +) const +{ + return propertiesPtr_->Cp(p, T) - CpMCv(p, T); +} + + +template<class ThermophysicalProperties> +inline Foam::scalar +Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Es +( + scalar p, + scalar T +) const +{ + return propertiesPtr_->Hs(p, T) - p/propertiesPtr_->rho(p, T); +} + + +template<class ThermophysicalProperties> +inline Foam::scalar +Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Ea +( + scalar p, + scalar T +) const +{ + return propertiesPtr_->Ha(p, T) - p/propertiesPtr_->rho(p, T); +} + + template<class ThermophysicalProperties> inline Foam::scalar Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::S diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/ice/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/ice/fvSchemes index 6ec78d15aaf28df8680c0fd31ae260d91107d8c9..d08b8c7066be79b4b89d209b00849af1bf2548f4 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/ice/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/ice/fvSchemes @@ -40,7 +40,7 @@ laplacianSchemes default none; laplacian((rho*nuEff),U) Gauss linear limited corrected 0.333; laplacian(rhorAUf,p_rgh) Gauss linear limited corrected 0.333; - laplacian(thermo:alpha,h) Gauss linear limited corrected 0.333; + laplacian(alphahe,h) Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/T b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/T new file mode 100644 index 0000000000000000000000000000000000000000..d7df3b5d0ef5231dbd36979a20176f65c6b20b5f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/T @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/solid"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 1123; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + maxY + { + type zeroGradient; + } + + solid_to_water + { + type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed; + value uniform 1123; + Tnbr T.liquid; + kappaMethod solidThermo; + region solid; + // Name of the other phase in the flid region mixing with 'liquid' phase + otherPhase gas; + qrNbr none; + qr none; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/p b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/p new file mode 100644 index 0000000000000000000000000000000000000000..ca8bd796fa59fb2c11e6c964a32e2bd60edcd7ad --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/solid/p @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/heater"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + + +internalField uniform 100000; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + ".*" + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.gas new file mode 100644 index 0000000000000000000000000000000000000000..a53a7c1e5398836cf21f62f332e82f5c6f8e0498 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.gas @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 333; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type inletOutlet; + value uniform 373; + inletValue uniform 373; + } + + maxX + { + type fixedValue; + value uniform 333; + } + minY + { + type fixedValue; + value uniform 333; + } + + water_to_solid + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 1123; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.liquid new file mode 100644 index 0000000000000000000000000000000000000000..bc995af0f6c46a7e25bc54556dfadbaad6312a9d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/T.liquid @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object T.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 333; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type inletOutlet; + value uniform 373; + inletValue uniform 373; + } + + maxX + { + type fixedValue; + value uniform 333; + } + minY + { + type fixedValue; + value uniform 333; + } + + water_to_solid + { + type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed; + value uniform 1123; + Tnbr T; + kappaMethod phaseSystem; + region fluid; + // Name of the other phase in the fluid region mixing with this phase + otherPhase gas; + qrNbr none; + qr none; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.gas new file mode 100644 index 0000000000000000000000000000000000000000..4c1ca2024e51f26231bcb3bf8ff2c50141b1f52b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.gas @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0/water"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 1 -1 0 0 0 0 ]; + +internalField uniform ( 0 0 0 ); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform ( 0 0 0 ); + inletValue uniform ( 0 0 0 ); + } + + maxX + { + type fixedValue; + value uniform ( 0 0 0 ); + } + minY + { + type fixedValue; + value uniform ( 0 0 0 ); + } + + water_to_solid + { + type fixedValue; + value uniform ( 0 0 0 ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.liquid new file mode 100644 index 0000000000000000000000000000000000000000..d00f506696d03968ac466948ff8a13cf00242234 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/U.liquid @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0/water"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 1 -1 0 0 0 0 ]; + +internalField uniform ( 0 0 0 ); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type pressureInletOutletVelocity; + phi phi.liquid; + value uniform ( 0 0 0 ); + inletValue uniform ( 0 0 0 ); + } + + maxX + { + type fixedValue; + value uniform ( 0 0 0 ); + } + minY + { + type fixedValue; + value uniform ( 0 0 0 ); + } + + water_to_solid + { + type fixedValue; + value uniform ( 0 0 0 ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas new file mode 100644 index 0000000000000000000000000000000000000000..f69dcf9507fe176f2d72a17bc4e4a3252a3dbb32 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas @@ -0,0 +1,23359 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + + +internalField nonuniform List<scalar> +23300 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + maxY + { + type inletOutlet; + phi phi.gas; + inletValue uniform 1; + value uniform 0; + } + symmetry + { + type symmetry; + } + maxX + { + type zeroGradient; + } + minY + { + type zeroGradient; + } + empty + { + type empty; + } + water_to_solid + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas.org similarity index 74% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.gas rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas.org index 2b0dad11c66669442c9df52c8a3d925533b921da..34a153239839387e83df28aa850ff27338dc7553 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.gas +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.gas.org @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -10,41 +10,45 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "5"; - object water.gas; + location "0/water"; + object alpha.liquid; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; -internalField uniform 1; + +internalField uniform 0; boundaryField { - inlet - { - type fixedValue; - value uniform 1; - } - outlet + maxY { type inletOutlet; phi phi.gas; inletValue uniform 1; - value uniform 1; + value uniform 0; + } + symmetry + { + type symmetry; } - wall1 + maxX { type zeroGradient; } - wall2 + minY { type zeroGradient; } - defaultFaces + empty { type empty; } + water_to_solid + { + type zeroGradient; + } } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.liquid similarity index 67% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.liquid rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.liquid index 1260daf11f67ba45a90fee5e53b4a6e890c37830..b6f3673c44f05ce737b7f185a2cbf5ac2bbf83a8 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/water.liquid +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alpha.liquid @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -10,41 +10,46 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "5"; - object water.liquid; + location "0/water"; + object alpha.liquid; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; + internalField uniform 1; boundaryField { - inlet + maxY { - type fixedValue; + type calculated; value uniform 1; } - outlet + symmetry { - type inletOutlet; - phi phi.liquid; - inletValue uniform 1; - value uniform 1; + type symmetry; } - wall1 + maxX { - type zeroGradient; + type calculated; + value uniform 1; } - wall2 + minY { - type zeroGradient; + type calculated; + value uniform 1; } - defaultFaces + empty { type empty; } + water_to_solid + { + type calculated; + value uniform 1; + } } diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.gas new file mode 100644 index 0000000000000000000000000000000000000000..e2efc137ac793e5e1e0c09da3f409ba7920f748d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.gas @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + ".*" + { + type compressible::alphatPhaseChangeJayatillekeWallFunction; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + + dmdt uniform 0; + value uniform 1e-8; + } + water_to_solid + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type Lavieville; + alphaCrit 0.2; + } + + LeidenfrostModel + { + type Spiegler; + Tcrit 647; + } + + filmBoilingModel + { + type Bromley; + } + value uniform 0; + } + maxY + { + type calculated; + value uniform 1e-8; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.liquid new file mode 100644 index 0000000000000000000000000000000000000000..c46ba2b2366db301256113b424f855fcac6b566e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/alphat.liquid @@ -0,0 +1,103 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + ".*" + { + type compressible::alphatPhaseChangeJayatillekeWallFunction; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + + dmdt uniform 0; + value uniform 1e-8; + } + water_to_solid + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + dmdt uniform 0; + partitioningModel + { + type Lavieville; + alphaCrit 0.2; + } + nucleationSiteModel + { + type LemmertChawla; + Cn 185; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + LeidenfrostModel + { + type Spiegler; + Tcrit 647; + } + CHFModel + { + type Zuber; + } + CHFSubCoolModel + { + type HuaXu; + Kburn 0.5; + } + MHFModel + { + type Jeschar; + Kmhf 1; + } + TDNBModel + { + type Schroeder; + } + filmBoilingModel + { + type Bromley; + } + value uniform 1e-8; + } + + maxY + { + type calculated; + value uniform 1e-8; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.gas new file mode 100644 index 0000000000000000000000000000000000000000..2946ad8bed6e2e48294f3e7764459567bafef4e1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.gas @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 1e-4; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + maxY + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } + + maxX + { + type epsilonWallFunction; + value $internalField; + } + minY + { + type epsilonWallFunction; + value $internalField; + } + + water_to_solid + { + type epsilonWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.liquid new file mode 100644 index 0000000000000000000000000000000000000000..1ccb1c1285f75ec0277ae49daefe057c979a1e72 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/epsilon.liquid @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object epsilon.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 1e-4; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + maxY + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } + + maxX + { + type epsilonWallFunction; + value $internalField; + } + minY + { + type epsilonWallFunction; + value $internalField; + } + + water_to_solid + { + type epsilonWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.orig b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/f.gas.bubbles similarity index 73% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.orig rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/f.gas.bubbles index 4900988be0247e878e017b3f6c8ec7a0ccfcd1a5..9cfa1094c7d956a30c76008a8556702d795d8f74 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.orig +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/f.gas.bubbles @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -10,33 +10,30 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; - object alpha.air; + location "0/water"; + object f.gas.bubbles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; +dimensions [ 0 0 0 0 0 0 0 ]; -internalField uniform 0; +internalField uniform 1; boundaryField { - inlet - { - type fixedValue; - value uniform 0.5; - } - outlet + #includeEtc "caseDicts/setConstraintTypes" + + maxY { type inletOutlet; - phi phi.air; - inletValue uniform 1; value uniform 1; + inletValue uniform 1; } - walls + ".*" { type zeroGradient; } } + // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.gas new file mode 100644 index 0000000000000000000000000000000000000000..7a0687e6afcd96621e7809c32551a5cc8ab64e78 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.gas @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 1e-5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + maxY + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } + + maxX + { + type kqRWallFunction; + value $internalField; + } + minY + { + type kqRWallFunction; + value $internalField; + } + + water_to_solid + { + type kqRWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.liquid new file mode 100644 index 0000000000000000000000000000000000000000..0106da005bccfc78f1c922c9887fab7ff0daf826 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/k.liquid @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object k.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 1e-5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } + + maxX + { + type kqRWallFunction; + value $internalField; + } + minY + { + type kqRWallFunction; + value $internalField; + } + + water_to_solid + { + type kqRWallFunction; + value $internalField;; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.gas new file mode 100644 index 0000000000000000000000000000000000000000..ef96f62ca30f90f0c1ce4ea84684fb7856167da1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.gas @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type calculated; + value uniform 0; + } + ".*" + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.liquid new file mode 100644 index 0000000000000000000000000000000000000000..0b3b2a865834c71df45b29a282014739e6fc576b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/nut.liquid @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.000; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type calculated; + value uniform 0.000; + } + ".*" + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.000; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p new file mode 100644 index 0000000000000000000000000000000000000000..6c831b2dd65b877d33cf6ad287da03a7867300ea --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 1e5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + ".*" + { + type calculated; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p_rgh b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..ca571a7d763d581bbc42064ed6b8c8e2ce5505c2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/0.orig/water/p_rgh @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus.feature-EulerEulerSolvers | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0/water"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 100000; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + maxY + { + type prghTotalPressure; + value $internalField; + p $internalField; + p0 $internalField; + U U.gas; + } + + maxX + { + type fixedFluxPressure; + value $internalField; + } + minY + { + type fixedFluxPressure; + value $internalField; + } + + water_to_solid + { + type fixedFluxPressure; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..0aed8a228195d513f9cb0eb280552f9a803ad78d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase0 + +rm -rf constant/cellToRegion +rm -rf constant/*/polyMesh # region meshes + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..3f3d938956aed16660a5b98880c66b8b6797b337 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=$(getApplication) + +./Allrun.pre + +runApplication $application + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre new file mode 100755 index 0000000000000000000000000000000000000000..bed1272eb3a4da0ab801f3db4a4daebf8679c60c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre @@ -0,0 +1,20 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions + +runApplication blockMesh +runApplication topoSet + +# Restore initial fields +restore0Dir + +runApplication splitMeshRegions -cellZonesOnly -overwrite + +runApplication setFields -region water + +echo +echo "Use paraFoam -touch-all to create files for paraview post-processing" +echo +echo "End" + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Tsat_water_1_2bar.csv b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Tsat_water_1_2bar.csv new file mode 100644 index 0000000000000000000000000000000000000000..bdab8b9ab17c06be63834f9e2372d22c6ad27b4e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Tsat_water_1_2bar.csv @@ -0,0 +1,66 @@ +p,Tsat +99083.3,372.499 +100667,372.942 +102250,373.379 +103833,373.811 +105417,374.237 +107000,374.658 +108583,375.074 +110167,375.485 +111750,375.891 +113333,376.293 +114917,376.689 +116500,377.082 +118083,377.47 +119667,377.853 +121250,378.233 +122833,378.608 +124417,378.98 +126000,379.347 +127583,379.711 +129167,380.071 +130750,380.427 +132333,380.78 +133917,381.13 +135500,381.476 +137083,381.819 +138667,382.158 +140250,382.494 +141833,382.828 +143417,383.158 +145000,383.485 +146583,383.809 +148167,384.131 +149750,384.449 +151333,384.765 +152917,385.078 +154500,385.389 +156083,385.697 +157667,386.002 +159250,386.305 +160833,386.605 +162417,386.903 +164000,387.199 +165583,387.492 +167167,387.783 +168750,388.072 +170333,388.358 +171917,388.642 +173500,388.925 +175083,389.205 +176667,389.483 +178250,389.759 +179833,390.033 +181417,390.305 +183000,390.575 +184583,390.843 +186167,391.109 +187750,391.374 +189333,391.636 +190917,391.897 +192500,392.156 +194083,392.413 +195667,392.669 +197250,392.923 +198833,393.175 +200417,393.426 diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/g b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..dda4a9c6d02f8db8fe073447f002f07e8232f265 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/combustionProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/regionProperties similarity index 77% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/combustionProperties.gas rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/regionProperties index 9d7d2bff13d9d442bfcf683dec8778efe6688ba5..6bad9f7af500073367aee0286f44e0dac31810e9 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/combustionProperties.gas +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/regionProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -11,23 +11,14 @@ FoamFile format ascii; class dictionary; location "constant"; - object combustionProperties; + object regionProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR; - -active false; - -laminarCoeffs -{} - -noCombustionCoeffs -{} - -PaSRCoeffs -{ - Cmix 1.0; -} +regions +( + fluid (water) + solid (solid) +); // ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/combustionProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/radiationProperties similarity index 77% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/combustionProperties.gas rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/radiationProperties index 9d7d2bff13d9d442bfcf683dec8778efe6688ba5..47be9327877ae2d23047a1b42303fc0b07d2493b 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/combustionProperties.gas +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/radiationProperties @@ -1,33 +1,23 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ + FoamFile { version 2.0; format ascii; class dictionary; location "constant"; - object combustionProperties; + object radiationProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR; - -active false; - -laminarCoeffs -{} +radiation off; -noCombustionCoeffs -{} - -PaSRCoeffs -{ - Cmix 1.0; -} +radiationModel none; // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..87c6d7e101a8e4655dd21da9090685f01ff70755 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/solid/thermophysicalProperties @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + molWeight 50; + } + + transport + { + kappa 60; + } + + thermodynamics + { + Hf 0; + Cp 450; + } + + equationOfState + { + rho 8000; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/chemistryProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/fvOptions similarity index 66% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/chemistryProperties.gas rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/fvOptions index ec49dd479773d21e415fa09ddd7e3ed194b3e722..f1871220330aa547af50cd7dd0da1c43d56efb1c 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/chemistryProperties.gas +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/fvOptions @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -11,30 +11,28 @@ FoamFile format ascii; class dictionary; location "constant"; - object chemistryProperties.gas; + object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -chemistryType +limitTLiq { - solver EulerImplicit; + type limitTemperature; + min 300; + max 2000; + selectionMode all; + phase liquid; + active yes; } -chemistry off; - -initialChemicalTimeStep 1e-07; - -EulerImplicitCoeffs -{ - cTauChem 1; - equilibriumRateLimiter off; -} - -odeCoeffs +limitTGas { - solver Rosenbrock43; - absTol 1e-12; - relTol 0.01; + type limitTemperature; + min 300; + max 2000; + selectionMode all; + phase gas; + active yes; } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/phaseProperties b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..2c20768d8f80db6fce140b56a69d83d150a0390f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/phaseProperties @@ -0,0 +1,331 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type thermalPhaseChangeTwoPhaseSystem; + +phases (gas liquid); + +// phase change in the bulk of the fluid. +phaseChange off; + +//populationBalances (bubbles); + +gas +{ + type purePhaseModel; + diameterModel isothermal; + + isothermalCoeffs + { + d0 5e-3; + p0 1e5; + } + Sc 0.7; + + velocityGroupCoeffs + { + populationBalance bubbles; + + formFactor 0.5235987756; + + sizeGroups + ( + f0 {d 0.5e-4; value 0 ;} + f1 {d 1.040e-3; value 0 ;} + f2 {d 1.640e-3; value 0 ;} + f3 {d 2.265e-3; value 0 ;} + f4 {d 2.889e-3; value 0 ;} + f5 {d 3.512e-3; value 0 ;} + f6 {d 4.141e-3; value 0 ;} + f7 {d 4.771e-3; value 1 ;} + f8 {d 5.402e-3; value 0 ;} + f9 {d 6.033e-3; value 0 ;} + f10 {d 6.665e-3; value 0 ;} + f11 {d 7.297e-3; value 0 ;} + f12 {d 7.929e-3; value 0 ;} + f13 {d 8.562e-3; value 0 ;} + f14 {d 9.194e-3; value 0 ;} + f15 {d 1.194e-2; value 0 ;} + f16 {d 2.400e-2; value 0 ;} + f17 {d 2.700e-2; value 0 ;} + f18 {d 3.000e-2; value 0 ;} + ); + } + + residualAlpha 1e-4; +} + +liquid +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 0.00045; + } + Sc 0.7; + + residualAlpha 1e-4; +} + +populationBalanceCoeffs +{ + bubbles + { + continuousPhase liquid; + + coalescenceModels + ( + PrinceBlanch + { + C1 0.05; + h0 1e-4; + hf 1e-8; + turbulentCollisions true; + buoyantCollisions false; + laminarShearCollisions false; + } + ); + + binaryBreakupModels + (); + + breakupModels + ( + LaakkonenAlopaeusAittamaa + { + C1 6;// Default: 6; + C2 0.04; + C3 0.01; + daughterSizeDistributionModel uniformBinary; + } + ); + + driftModels + ( + phaseChange + { + pairNames (gasAndLiquid); + } + + densityChange{} + ); + + nucleationModels + ( + wallBoiling + { + velocityGroup gas; + } + ); + } +} + + +blending +{ + + default + { + type linear; + minFullyContinuousAlpha.gas 0.7; + minPartlyContinuousAlpha.gas 0.3; + minFullyContinuousAlpha.liquid 0.7; + minPartlyContinuousAlpha.liquid 0.3; + } + + drag + { + type linear; + minFullyContinuousAlpha.gas 0.7; + minPartlyContinuousAlpha.gas 0.3; + minFullyContinuousAlpha.liquid 0.7; + minPartlyContinuousAlpha.liquid 0.3; + } + + heatTransfer + { + type linear; + minPartlyContinuousAlpha.gas 0; + minFullyContinuousAlpha.gas 1; + minPartlyContinuousAlpha.liquid 0; + minFullyContinuousAlpha.liquid 1; + } + + massTransfer + { + type linear; + minPartlyContinuousAlpha.gas 0; + minFullyContinuousAlpha.gas 1; + minPartlyContinuousAlpha.liquid 0; + minFullyContinuousAlpha.liquid 1; + } +} + + +surfaceTension +( + (gas and liquid) + { + type constant; + sigma 0.07; + } +); + +saturationModel +{ + type function1; + + function csvFile; + functionCoeffs + { + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator ","; + mergeSeparators no; + file "Tsat_water_1_2bar.csv"; + outOfBounds clamp; + interpolationScheme linear; + }; +}; + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } + + (liquid in gas) + { + type constant; + E0 1.0; + } +); + + +drag +( + (gas in liquid) + { + type IshiiZuber; + residualRe 1e-4; + + swarmCorrection + { + type none; + } + } + + (liquid in gas) + { + type IshiiZuber; + residualRe 1e-4; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (gas in liquid) + { + type constantCoefficient; + Cvm 0.5; + } + + (liquid in gas) + { + type constantCoefficient; + Cvm 0.5; + } +); + +heatTransfer.gas +( + (gas in liquid) + { + type spherical; + residualAlpha 1e-3; + } + + (liquid in gas) + { + type RanzMarshall; + residualAlpha 1e-3; + } +); + +heatTransfer.liquid +( + (gas in liquid) + { + type RanzMarshall; + residualAlpha 1e-3; + } + + (liquid in gas) + { + type spherical; + residualAlpha 1e-3; + } +); + +phaseTransfer +(); + +lift +( + (gas in liquid) + { + type Tomiyama; + } +); + +wallLubrication +( + (gas in liquid) + { + type Antal; + Cw1 -0.01; + Cw2 0.05; + Cwc 10.0; + Cwd 6.8; + p 1.7; + } +); + +turbulentDispersion +( + (gas in liquid) + { + type Burns; + sigma 0.7; + Ctd 1.0; + residualAlpha 1e-3; + } +); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..66c53ae4df45695f523e181edf3ba0a30b1402e3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.gas @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hRefConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +dpdt no; + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Hf 0; + Cp 2078;//12078.4;//.4;//; + Tref 373.55; + Href 2675500; + } + transport + { + mu 1.2256e-5; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..c94e250bb781df385abfb78e002cd2950d101bac --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/thermophysicalProperties.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +dpdt no; + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1000; + } + thermodynamics + { + Hf 0; + Cp 4195; + Tref 373.55; + Href 417500; + } + transport + { + mu 959e-6; + Pr 6.62; + } +} + + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..bf9aa34509a4701852210420b4c5a7d099c91456 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.gas @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel mixtureKEpsilon; + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.liquid b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..c98d60bdef13fad279df34de1807159ad18e9173 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/constant/water/turbulenceProperties.liquid @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel mixtureKEpsilon;//kEpsilon; + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..e8d85b0e21e5110a1bf393761163c3fb7e2abb10 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/blockMeshDict @@ -0,0 +1,90 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1e-3; + +vertices +( + (0 0 -1) + (70 0 -1) + (70 140 -1) + (0 140 -1) + + (0 0 1) + (70 0 1) + (70 140 1) + (0 140 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (140 170 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + maxY + { + type patch; + faces + ( + (3 7 6 2) + ); + } + symmetric + { + type symmetry; + faces + ( + (0 4 7 3) + ); + } + maxX + { + type wall; + faces + ( + (2 6 5 1) + ); + } + minY + { + type wall; + faces + ( + (1 5 4 0) + ); + } + emptyPatch + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..6fc3ab41fa0898a41dee5f7627477aedf9bade4f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +DebugSwitches +{ + compressible::alphatWallBoilingWallFunction 0; + compressible::turbulentTemperatureTwoPhaseRadCoupledMixed 0; +} + +application chtMultiRegionTwoPhaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 1e-6; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +maxCo 0.5; + +// Maximum diffusion number +maxDi 10.0; + +maxDeltaT 1e-3; + +adjustTimeStep yes; + +functions +{ +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..392b808bddcccff3564465f5087a784fedb5822a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/decomposeParDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; + +// method hierarchical; +// method simple; +// method manual; + +regions +{ + heater + { + numberOfSubdomains 1; + method simple; // none; + + coeffs + { + n (1 1 1); + } + } +} + +coeffs +{ + n (2 2 1); +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/chemistryProperties.gas b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSchemes similarity index 64% rename from tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/chemistryProperties.gas rename to tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSchemes index ec49dd479773d21e415fa09ddd7e3ed194b3e722..6eb6075903c00a34b6a889d3c7f9c695545da44a 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/chemistryProperties.gas +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSchemes @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -10,31 +10,33 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object chemistryProperties.gas; + object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -chemistryType +ddtSchemes { - solver EulerImplicit; } -chemistry off; +gradSchemes +{ +} + +divSchemes +{ +} -initialChemicalTimeStep 1e-07; +laplacianSchemes +{ +} -EulerImplicitCoeffs +interpolationSchemes { - cTauChem 1; - equilibriumRateLimiter off; } -odeCoeffs +snGradSchemes { - solver Rosenbrock43; - absTol 1e-12; - relTol 0.01; } + // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..3c276ee0cb3340cc48b4dacd6630721f0f8b4979 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +PIMPLE +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..519e55b318c4f3b9d5e583a933b5c6a699ac232e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/changeDictionaryDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// boundary +// { +// minY +// { +// type patch; +// } +// minZ +// { +// type patch; +// } +// maxZ +// { +// type patch; +// } +// } + +T +{ + internalField uniform 300; + + boundaryField + { + + "heater_to_.*" + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappaMethod solidThermo; + qrNbr none; + qr none; + value uniform 300; + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/decomposeParDict new file mode 120000 index 0000000000000000000000000000000000000000..46638e60f61f453fde97c51772ad6111792db0f6 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/decomposeParDict @@ -0,0 +1 @@ +../decomposeParDict \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..c72aefc1a1b5c6d1421353d220a04ed860d4e792 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSchemes @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(alpha,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSolution b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..69f98458c6e92a3392dbedfecd04840b44ef1920 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/solid/fvSolution @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + h + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + hFinal + { + $h; + tolerance 1e-06; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/topoSetDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..b5c9fc27648092fb3d6c6309c21703afad58bae9 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/topoSetDict @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + // Heater + { + name heaterCellSet; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (-0.01 29e-3 -1 )(4.77e-3 70e-3 1); + } + } + + { + name solid; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set heaterCellSet; + } + } + + { + name bottomWaterCellSet; + type cellSet; + action new; + source cellToCell; + sourceInfo + { + set heaterCellSet; + } + } + + { + name bottomWaterCellSet; + type cellSet; + action invert; + } + + { + name water; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set bottomWaterCellSet; + } + } +); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..eab1292c4eb0fceb3613d9764eef4f2aa56f4464 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/changeDictionaryDict @@ -0,0 +1,143 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +U +{ + internalField uniform (0 0 0); + + boundaryField + { + maxY + { + type inletOutlet; + inletValue uniform (0 0 0); + } + + ".*" + { + type fixedValue; + value uniform (0 0 0); + } + } +} + +T +{ + internalField uniform 300; + + boundaryField + { + maxY + { + type inletOutlet; + inletValue uniform 300; + } + + ".*" + { + type fixedValue; + value uniform 300; + } + + "water_to_.*" + { + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + kappaMethod fluidThermo; + qrNbr none; + qr none; + value uniform 300; + } + } +} + +epsilon +{ + internalField uniform 0.01; + + boundaryField + { + + maxY + { + type inletOutlet; + inletValue uniform 0.01; + } + + ".*" + { + type epsilonWallFunction; + value uniform 0.01; + } + } +} + +k +{ + internalField uniform 0.1; + + boundaryField + { + maxY + { + type inletOutlet; + inletValue uniform 0.1; + } + + ".*" + { + type kqRWallFunction; + value uniform 0.1; + } + } +} + +p_rgh +{ + internalField uniform 0; + + boundaryField + { + maxY + { + type prghTotalHydrostaticPressure; + p0 $internalField; + value uniform 0; + } + + ".*" + { + type fixedFluxPressure; + value $internalField; + } + } +} + +p +{ + internalField uniform 0; + + boundaryField + { + ".*" + { + type calculated; + value uniform 0; + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/decomposeParDict new file mode 120000 index 0000000000000000000000000000000000000000..46638e60f61f453fde97c51772ad6111792db0f6 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/decomposeParDict @@ -0,0 +1 @@ +../decomposeParDict \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..40da91f94d3dce45a44d5d4d484a383bb5fb8586 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSchemes @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + /* + grad((1-alpha.gas)) leastSquares;//Gauss linear; + grad(alpha.gas) leastSquares;//Gauss linear; + grad(U.gas) leastSquares;//Gauss linear; + grad(U.liquid) leastSquares;// Gauss linear; + + grad(h.gas) leastSquares; + grad(h.liquid) leastSquares; + + grad(alpha.liquid) leastSquares; + grad(alpha.gas) leastSquares; + + grad(rho) leastSquares; + + grad(p_rgh) leastSquares; + + grad(epsilon.liquid) leastSquares; + grad(k.liquid) leastSquares; + */ + +} + +divSchemes +{ + default none;//Gauss upwind; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss upwind;//limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss upwind;//limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss upwind;//limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss upwind;//limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss upwind;//limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss upwind;//limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss upwind; + "div\(phim,(k|epsilon)m\)" Gauss upwind; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; + +/* + div(phi,U) Gauss upwind; + div(phi,K) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +*/ +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSolution b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..b2cab69760629881a88819d2327f4141f3ff3ca7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/fvSolution @@ -0,0 +1,124 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + bubbles + { + nCorr 1; + tolerance 1e-4; + renormalizeOnRestart true; + renormalize false; + solveOnFinalIterOnly true; + } + + rho + { + solver PCG; + preconditioner DIC; + tolerance 1e-7; + relTol 0.1; + } + + rhoFinal + { + $rho; + tolerance 1e-7; + relTol 0; + } + + p_rgh + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother GaussSeidel; + + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-7; + relTol 0; + } + + "(e|h|k|epsilon).*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-8; + relTol 0.001; + minIter 1; + maxIter 20; + } + + "(U)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-7; + relTol 0.1; + } + + "(U)Final" + { + $U; + tolerance 1e-7; + relTol 0; + } + + "f.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 2; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + nEnergyCorrectors 4; + faceMomentum yes; +} + +relaxationFactors +{ + fields + { + iDmdt 1; + } + + equations + { + ".*" 1; + "h.*" 1; + "U.*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/setFieldsDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..480274f7e60d50ef05c052aeacc457b127b90c9f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/water/setFieldsDict @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.gas 1 + //volScalarFieldValue T.liquid 373 + //volScalarFieldValue T.gas 373 +); + +regions +( + boxToCell + { + box (-1 0 -1) (1 75e-3 1); + fieldValues + ( + volScalarFieldValue alpha.gas 0 + volScalarFieldValue alpha.liquid 1 + //volScalarFieldValue T.liquid 333 + //volScalarFieldValue T.gas 333 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/decomposeParDict b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/decomposeParDict index 2cea9b2e966128f80e120192d2f29cc75d798e3f..475b6abfbb914570525d105b986a716748d61d75 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/decomposeParDict +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/decomposeParDict @@ -23,4 +23,5 @@ coeffs n (4 2 1); } + // ************************************************************************* // diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties index ad0d8e7624754286bee969b1652a8fa4644a6535..f54e124d8f2cfded90c050b12786e2a5076aa66e 100644 --- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties +++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties @@ -18,8 +18,8 @@ phaseChangeTwoPhaseModel constant; constantCoeffs { - coeffC coeffC [0 0 -1 -1 0 0 0] 50; - coeffE coeffE [0 0 -1 -1 0 0 0] 50; + coeffC 150; + coeffE 150; } diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties index 0b54ae88580470e562929a11924f566c4c76fc4b..11f814f6f7c4f69e6902c7d5f4c2ff0316f7588b 100644 --- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties +++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties @@ -16,6 +16,5 @@ FoamFile TSat TSat [0 0 0 1 0] 366; // saturation temperature -pDivU false; // ************************************************************************* // diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict index 67dc38c44d982edb66c0e7a4b0c900bdc423799f..e8ebeb5689c153862bdfddcf3efae9d1514aacdb 100644 --- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict +++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict @@ -25,7 +25,7 @@ stopAt endTime; endTime 10; -deltaT 1e-4; +deltaT 1e-5; writeControl adjustableRunTime; diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes index 5ba00f840e70802ab6fa93b6d83114d2bb48ae5b..d999a009d2140e24c04ff088e6f1fd85365c0a12 100644 --- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes +++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes @@ -39,6 +39,8 @@ divSchemes div(phirb,alpha) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; + + div((interpolate(cp)*rhoPhi),T) Gauss upwind; } laplacianSchemes diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution index 51085f283bc65871b4373ec643b55a4d92177dbe..cfeb0071b3ec8b2d5e1a59bfdbaa48f89e25311a 100644 --- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution +++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution @@ -96,7 +96,15 @@ solvers relTol 0; }; - "(k.*|omega.*|Theta.*|T.*).*" + "T.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0.0; + } + + "(k.*|omega.*|Theta.*).*" { solver PBiCGStab; preconditioner DILU; diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.gas new file mode 100644 index 0000000000000000000000000000000000000000..835f14915f64f7fc9054abf35f07bb2d125a0893 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.gas @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + wall2 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.liquid new file mode 100644 index 0000000000000000000000000000000000000000..0025a47da871546c42ebd1110c9a5311c55d50b0 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/T.liquid @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + wall2 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.gas2 @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e29917dc0f4be4984874d05beaee2f07a845cf23 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/U.liquid @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.liquid; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.liquid; + value uniform (0 1 0); + } + wall1 + { + type noSlip; + } + wall2 + { + type noSlip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.gas new file mode 100644 index 0000000000000000000000000000000000000000..c60002360ff3534a34eb2753370be06b4145240e --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.gas @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0; + value uniform 0; + } + wall1 + { + type zeroGradient; + } + wall2 + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.liquid new file mode 100644 index 0000000000000000000000000000000000000000..5d799f75264cf14e3fe229914bff8d9c69512e11 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alpha.liquid @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1; + } + outlet + { + type calculated; + value uniform 1; + } + wall1 + { + type calculated; + value uniform 1; + } + wall2 + { + type calculated; + value uniform 1; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.gas new file mode 100644 index 0000000000000000000000000000000000000000..76b810b72cc7a2797f56bf78ad2a9cff2a45c5c7 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.gas @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + alphaCrit 0.2; + } + value uniform 0; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + alphaCrit 0.2; + } + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.liquid new file mode 100644 index 0000000000000000000000000000000000000000..de529d16587feeee38400d56d4f74c95b76ae589 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/alphat.liquid @@ -0,0 +1,101 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction;//Lavieville; + alphaCrit 0.2; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction;//Lavieville; + alphaCrit 0.2; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.gas new file mode 100644 index 0000000000000000000000000000000000000000..72ab457033402c99f578a2a27c7e306fbbaa7c73 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.gas @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.liquid new file mode 100644 index 0000000000000000000000000000000000000000..2b70ecaa0534327f8a9ed0a6c106391171dc2268 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/epsilon.liquid @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.001; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 0.00015; + value uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.gas new file mode 100644 index 0000000000000000000000000000000000000000..106fb50b0404e6ce611e20f7afdcda271f7e0e7d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.01; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.liquid new file mode 100644 index 0000000000000000000000000000000000000000..09b9fd20f6db414bff7c18ac1ed7718f266a8393 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/k.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 3.75e-05; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.gas new file mode 100644 index 0000000000000000000000000000000000000000..014fc171535e8a4bb440c8946d0a671594d39264 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e5fb6061d08cee36651ebd319a9dc00fc99ac196 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/nut.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p new file mode 100644 index 0000000000000000000000000000000000000000..b2458fb471c585e9107552080ce0428cba3b1d3b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type calculated; + value uniform 100000; + } + outlet + { + type calculated; + value uniform 100000; + } + wall1 + { + type calculated; + value uniform 100000; + } + wall2 + { + type calculated; + value uniform 100000; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p_rgh b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..6935a7293bee83402d8c9d785ee55c42d4e0cb7e --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/0/p_rgh @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + } + outlet + { + type prghPressure; + p uniform 100000; + value uniform 100000; + } + wall1 + { + type fixedFluxPressure; + } + wall2 + { + type fixedFluxPressure; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..84094579771dbf39255a890a29b848048389c10b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase +cp system/controlDict.org system/controlDict + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e2b33f6cea5a2e278082ebda12d066f15073a0c7 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun @@ -0,0 +1,22 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=$(getApplication) + +runApplication blockMesh +runApplication $application + +if ! isTest $@ +then + foamDictionary system/controlDict -entry endTime -set 4 + foamDictionary system/controlDict -entry startTime -set 0.5 + foamDictionary 0.5/T.liquid -entry boundaryField.wall2.q -set 'uniform 500000' + foamDictionary 0.5/T.liquid -entry boundaryField.wall1.q -set 'uniform 500000' + foamDictionary 0.5/U.liquid -entry boundaryField.inlet.type -set 'fixedValue' + runApplication -a $application +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/g b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..825f0a08cbd62f1224f19eff670a783c2973c2ff --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/phaseProperties b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..6cabb5deefedc9b7ee21db90015bc8c0a9f8aa19 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/phaseProperties @@ -0,0 +1,170 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type thermalPhaseChangeMultiphaseSystem; + +phases (gas liquid); + +phaseChange on; + +gas +{ + type purePhaseModel; + diameterModel constant; + + constantCoeffs + { + d 0.00045; + } + + Sct 0.7; + + residualAlpha 1e-4; +} + +liquid +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 0.00045; + } + Sct 0.7; + + residualAlpha 1e-4; +} + +blending +{ + default + { + type none; + continuousPhase liquid; + } +} + +surfaceTension +( + (gas and liquid) + { + type constant; + sigma 0.07; + } +); + +saturationModel +{ + type constant;//function1; + + Tsat 373; + pSat 1e5; + + function csvFile; + functionCoeffs + { + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator ","; + mergeSeparators no; + file "Tsat_water_1_2bar.csv"; + outOfBounds clamp; + interpolationScheme linear; + }; +}; + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } +); + +drag +( + (gas in liquid) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (gas in liquid) + { + type constantCoefficient; + Cvm 0.5; + } +); + +interfaceComposition +(); + +interfaceCompression +(); + +heatTransfer.gas +( + (gas in liquid) + { + type spherical; + residualAlpha 1e-3; + } +); + +heatTransfer.liquid +( + (gas in liquid) + { + type RanzMarshall; + residualAlpha 1e-3; + } +); + +phaseTransfer +(); + +lift +(); + +wallLubrication +(); + +turbulentDispersion +( + /*(gas in liquid) + { + type Burns; + sigma 0.7; + Ctd 1.0; + residualAlpha 1e-3; + }*/ +); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..908b7bec188a6b9bf6eb1ac24dddb418d5d11253 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.gas @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Hf 0; + Cv 12078.4; + Tref 373.55; + Eref 2675500; + } + transport + { + mu 1.2256e-5; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..7768d06337d0309cd51ff2e94c15574afe50534b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.liquid @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 959; + } + thermodynamics + { + Hf 0; + Cv 4195; + Tref 373.55; + Eref 417500; + } + transport + { + mu 2.8291e-4; + Pr 2.289; + } +} + + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..baf6ade451ebc44da76a8c6979a8f887821e74d4 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.gas @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar;//RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..844aa58c28fd2282ad0548e0400942249321daf3 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/turbulenceProperties.liquid @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/blockMeshDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..45671cd7a86c86bb311ce50425b39698a54f5ba9 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/blockMeshDict @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (0.05 0 0) + (0.05 2 0) + (0 2 0) + (0 0 0.1) + (0.05 0 0.1) + (0.05 2 0.1) + (0 2 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 75 1) simpleGrading (1 1 1) +); + +boundary +( + inlet + { + type mappedPatch; + offset (0 0.1 0); + sampleRegion region0; + sampleMode nearestCell; + samplePatch none; + + faces + ( + (1 5 4 0) + ); + } + + outlet + { + type patch; + faces + ( + (3 7 6 2) + ); + } + + wall1 + { + type wall; + faces + ( + (0 4 7 3) + ); + } + + wall2 + { + type wall; + faces + ( + (2 6 5 1) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..4bcc475a7d289568d10de9e9546b79a3506e36f2 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingMultiphaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict.org b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict.org new file mode 100644 index 0000000000000000000000000000000000000000..4bcc475a7d289568d10de9e9546b79a3506e36f2 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/controlDict.org @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingMultiphaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSchemes b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..454b27e383d9fd8f73fef24151cb999065dd4863 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss upwind; + "div\(phim,(k|epsilon)m\)" Gauss upwind; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + default no; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSolution b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..3cdf78c21bfdda2e697825334a50e7b35ec9002b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/system/fvSolution @@ -0,0 +1,105 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver GAMG; + smoother DIC; + tolerance 1e-8; + relTol 0.01; + maxIter 100; + minIter 2; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + } + + "(e|h).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0.001; + minIter 1; + maxIter 20; + } + + "(k|epsilon|Theta).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + minIter 1; + } + + "Yi.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + residualAlpha 1e-8; + } +} + +PIMPLE +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + nEnergyCorrectors 2; + faceMomentum yes; +} + +relaxationFactors +{ + fields + { + iDmdt 0.1; + } + + equations + { + ".*" 1; + "e.*" 0.5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas new file mode 100644 index 0000000000000000000000000000000000000000..835f14915f64f7fc9054abf35f07bb2d125a0893 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + wall2 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..835f14915f64f7fc9054abf35f07bb2d125a0893 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.gas2 @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + wall2 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.liquid new file mode 100644 index 0000000000000000000000000000000000000000..0025a47da871546c42ebd1110c9a5311c55d50b0 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/T.liquid @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + wall2 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.gas2 @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e29917dc0f4be4984874d05beaee2f07a845cf23 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/U.liquid @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.liquid; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.liquid; + value uniform (0 1 0); + } + wall1 + { + type noSlip; + } + wall2 + { + type noSlip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas new file mode 100644 index 0000000000000000000000000000000000000000..c60002360ff3534a34eb2753370be06b4145240e --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0; + value uniform 0; + } + wall1 + { + type zeroGradient; + } + wall2 + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..c60002360ff3534a34eb2753370be06b4145240e --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.gas2 @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0; + value uniform 0; + } + wall1 + { + type zeroGradient; + } + wall2 + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.liquid new file mode 100644 index 0000000000000000000000000000000000000000..5d799f75264cf14e3fe229914bff8d9c69512e11 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alpha.liquid @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1; + } + outlet + { + type calculated; + value uniform 1; + } + wall1 + { + type calculated; + value uniform 1; + } + wall2 + { + type calculated; + value uniform 1; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas new file mode 100644 index 0000000000000000000000000000000000000000..c79a4b9ff005663b4994553b05029788b5d1fcd9 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatPhaseChangeJayatillekeWallFunction; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + } + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..eb91501a3c8f7d5e91d52a604d7ff63da5c78c4d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.gas2 @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + } + value uniform 0; + } + wall2 + { + type compressible::alphatPhaseChangeJayatillekeWallFunction; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.liquid new file mode 100644 index 0000000000000000000000000000000000000000..f8b0db51c1d6063250a4de7f84041b45eebd6ec4 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/alphat.liquid @@ -0,0 +1,99 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas2; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas new file mode 100644 index 0000000000000000000000000000000000000000..72ab457033402c99f578a2a27c7e306fbbaa7c73 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..72ab457033402c99f578a2a27c7e306fbbaa7c73 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.gas2 @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.liquid new file mode 100644 index 0000000000000000000000000000000000000000..2b70ecaa0534327f8a9ed0a6c106391171dc2268 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/epsilon.liquid @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.001; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 0.00015; + value uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas new file mode 100644 index 0000000000000000000000000000000000000000..106fb50b0404e6ce611e20f7afdcda271f7e0e7d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.01; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..106fb50b0404e6ce611e20f7afdcda271f7e0e7d --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.gas2 @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.01; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.liquid new file mode 100644 index 0000000000000000000000000000000000000000..09b9fd20f6db414bff7c18ac1ed7718f266a8393 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/k.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 3.75e-05; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas new file mode 100644 index 0000000000000000000000000000000000000000..014fc171535e8a4bb440c8946d0a671594d39264 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..014fc171535e8a4bb440c8946d0a671594d39264 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.gas2 @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e5fb6061d08cee36651ebd319a9dc00fc99ac196 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/nut.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p new file mode 100644 index 0000000000000000000000000000000000000000..b2458fb471c585e9107552080ce0428cba3b1d3b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type calculated; + value uniform 100000; + } + outlet + { + type calculated; + value uniform 100000; + } + wall1 + { + type calculated; + value uniform 100000; + } + wall2 + { + type calculated; + value uniform 100000; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p_rgh b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..6935a7293bee83402d8c9d785ee55c42d4e0cb7e --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/0/p_rgh @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + } + outlet + { + type prghPressure; + p uniform 100000; + value uniform 100000; + } + wall1 + { + type fixedFluxPressure; + } + wall2 + { + type fixedFluxPressure; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..84094579771dbf39255a890a29b848048389c10b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase +cp system/controlDict.org system/controlDict + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e2b33f6cea5a2e278082ebda12d066f15073a0c7 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun @@ -0,0 +1,22 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=$(getApplication) + +runApplication blockMesh +runApplication $application + +if ! isTest $@ +then + foamDictionary system/controlDict -entry endTime -set 4 + foamDictionary system/controlDict -entry startTime -set 0.5 + foamDictionary 0.5/T.liquid -entry boundaryField.wall2.q -set 'uniform 500000' + foamDictionary 0.5/T.liquid -entry boundaryField.wall1.q -set 'uniform 500000' + foamDictionary 0.5/U.liquid -entry boundaryField.inlet.type -set 'fixedValue' + runApplication -a $application +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/g b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..825f0a08cbd62f1224f19eff670a783c2973c2ff --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/phaseProperties b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..cd909dfa830b8d1805fc7f96df931c38f30a8900 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/phaseProperties @@ -0,0 +1,225 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type thermalPhaseChangeMultiphaseSystem; + +phases (gas gas2 liquid); + +phaseChange on; + +gas +{ + type purePhaseModel; + diameterModel constant; + + constantCoeffs + { + d 0.00045; + } + + Sct 0.7; + + residualAlpha 1e-4; +} + +gas2 +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 0.00045; + } + + Sct 0.7; + + residualAlpha 1e-4; +} + +liquid +{ + type purePhaseModel; + diameterModel constant; + + constantCoeffs + { + d 0.00045; + } + Sc 0.7; + + residualAlpha 1e-4; +} + +blending +{ + default + { + type none; + continuousPhase liquid; + } +} + +surfaceTension +( + (gas and liquid) + { + type constant; + sigma 0.07; + } + + (gas2 and liquid) + { + type constant; + sigma 0.07; + } + +); + +saturationModel +{ + type constant; + + Tsat 373; + pSat 1e5; +}; + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } + + (gas2 in liquid) + { + type constant; + E0 1.0; + } +); + +drag +( + (gas in liquid) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (gas2 in liquid) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (gas in liquid) + { + type constantCoefficient; + Cvm 0.5; + } + + (gas2 in liquid) + { + type constantCoefficient; + Cvm 0.5; + } +); + +interfaceComposition +(); + +interfaceCompression +(); + +heatTransfer.gas +( + (gas in liquid) + { + type spherical; + residualAlpha 1e-3; + } +); + + +heatTransfer.gas2 +( + (gas2 in liquid) + { + type spherical; + residualAlpha 1e-3; + } +); + +heatTransfer.liquid +( + (gas in liquid) + { + type RanzMarshall; + residualAlpha 1e-3; + } + + (gas2 in liquid) + { + type RanzMarshall; + residualAlpha 1e-3; + } +); + +phaseTransfer +(); + +lift +(); + +wallLubrication +(); + +turbulentDispersion +( + /*(gas in liquid) + { + type Burns; + sigma 0.7; + Ctd 1.0; + residualAlpha 1e-3; + } + (gas2 in liquid) + { + type Burns; + sigma 0.7; + Ctd 1.0; + residualAlpha 1e-3; + } +*/ +); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..908b7bec188a6b9bf6eb1ac24dddb418d5d11253 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Hf 0; + Cv 12078.4; + Tref 373.55; + Eref 2675500; + } + transport + { + mu 1.2256e-5; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..908b7bec188a6b9bf6eb1ac24dddb418d5d11253 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas2 @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Hf 0; + Cv 12078.4; + Tref 373.55; + Eref 2675500; + } + transport + { + mu 1.2256e-5; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..7768d06337d0309cd51ff2e94c15574afe50534b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.liquid @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 959; + } + thermodynamics + { + Hf 0; + Cv 4195; + Tref 373.55; + Eref 417500; + } + transport + { + mu 2.8291e-4; + Pr 2.289; + } +} + + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..baf6ade451ebc44da76a8c6979a8f887821e74d4 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar;//RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas2 b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..baf6ade451ebc44da76a8c6979a8f887821e74d4 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.gas2 @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar;//RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..844aa58c28fd2282ad0548e0400942249321daf3 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/turbulenceProperties.liquid @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/blockMeshDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..58c8a49286a8b6970875fb2e9d9674aa401fe856 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/blockMeshDict @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) + (0.05 0 0) + (0.05 2 0) + (0 2 0) + (0 0 0.1) + (0.05 0 0.1) + (0.05 2 0.1) + (0 2 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 75 1) simpleGrading (1 1 1) +); + +boundary +( + inlet + { + type mappedPatch; + offset (0 0.1 0); + sampleRegion region0; + sampleMode nearestCell; + samplePatch none; + + faces + ( + (1 5 4 0) + ); + } + + outlet + { + type patch; + faces + ( + (3 7 6 2) + ); + } + + wall1 + { + type wall; + faces + ( + (0 4 7 3) + ); + } + + wall2 + { + type wall; + faces + ( + (2 6 5 1) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..4bcc475a7d289568d10de9e9546b79a3506e36f2 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingMultiphaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict.org b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict.org new file mode 100644 index 0000000000000000000000000000000000000000..4bcc475a7d289568d10de9e9546b79a3506e36f2 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/controlDict.org @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingMultiphaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSchemes b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..454b27e383d9fd8f73fef24151cb999065dd4863 --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss upwind; + "div\(phim,(k|epsilon)m\)" Gauss upwind; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + default no; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSolution b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..3cdf78c21bfdda2e697825334a50e7b35ec9002b --- /dev/null +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/system/fvSolution @@ -0,0 +1,105 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver GAMG; + smoother DIC; + tolerance 1e-8; + relTol 0.01; + maxIter 100; + minIter 2; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + } + + "(e|h).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0.001; + minIter 1; + maxIter 20; + } + + "(k|epsilon|Theta).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + minIter 1; + } + + "Yi.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + residualAlpha 1e-8; + } +} + +PIMPLE +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + nEnergyCorrectors 2; + faceMomentum yes; +} + +relaxationFactors +{ + fields + { + iDmdt 0.1; + } + + equations + { + ".*" 1; + "e.*" 0.5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties index c12ce1b4f2177665288fc81b1630a820de2bfb6e..2c769b504e22b40cc58870002e10117dd47ed44f 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferMultiphaseSystem; +type basicMultiphaseSystem; phases (air water); @@ -47,6 +47,14 @@ water blending { default + { + type linear; + minFullyContinuousAlpha.air 0.7; + minPartlyContinuousAlpha.air 0.3; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.3; + } + drag { type linear; minFullyContinuousAlpha.air 0.7; @@ -150,6 +158,9 @@ heatTransfer } ); +phaseTransfer +(); + lift (); diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/controlDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/controlDict index 881c8c47205314b36f1f53c3597af3c6ab7bb8be..dbea626cf557d99738072c03bce913599ce9f4c9 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/controlDict +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/controlDict @@ -29,7 +29,7 @@ deltaT 0.005; writeControl runTime; -writeInterval 1; +writeInterval 10; purgeWrite 0; @@ -51,7 +51,7 @@ maxCo 0.5; maxDeltaT 1; -functions0 +functions { fieldAverage1 { diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict index dde268b71ce878e64823870a4999a7bc66c0bd64..8e897fbe0d9c7c4cfb94310fe7ef53745e76486a 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict @@ -18,6 +18,7 @@ FoamFile defaultFieldValues ( volScalarFieldValue alpha.air 1 + volScalarFieldValue alpha.water 0 ); regions @@ -28,6 +29,7 @@ regions fieldValues ( volScalarFieldValue alpha.air 0 + volScalarFieldValue alpha.water 1 ); } ); diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties index 32f0d0736737c49d2bf95c0640bd7614e4c477ef..51e28a5ed49bb11925242f16902b08ef005962dd 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferMultiphaseSystem; +type basicMultiphaseSystem; phases (water oil mercury air); @@ -82,6 +82,19 @@ blending minFullyContinuousAlpha.air 0.7; minPartlyContinuousAlpha.air 0.5; } +/* + drag + { + type linear; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.3; + minFullyContinuousAlpha.oil 0.7; + minPartlyContinuousAlpha.oil 0.3; + minFullyContinuousAlpha.mercury 0.7; + minPartlyContinuousAlpha.mercury 0.3; + minFullyContinuousAlpha.air 0.7; + minPartlyContinuousAlpha.air 0.3; + }*/ } surfaceTension @@ -446,6 +459,9 @@ heatTransfer lift (); +phaseTransfer +(); + wallLubrication (); diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air index fdfa6b65b21340ab7bc26a5c182d78c89c9f52ab..2ac810f0465a3fb96f725d95224836f28d7637ed 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air @@ -26,6 +26,8 @@ thermoType energy sensibleInternalEnergy; } +pressureWorkAlphaLimit 0.99; + mixture { specie diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.mercury b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.mercury index 5534eaeef7d4f35d946ab2739436972acdc1d9fb..61a41dfd7d8a5522fe2f25e062fc9eb3e2014218 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.mercury +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.mercury @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; @@ -38,7 +38,7 @@ mixture } thermodynamics { - Cp 135; + Cv 135; Hf 0; } transport diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.oil b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.oil index 3949bd3f208016c4cc3da4748fedfb0419cddcb5..0ab2fbe47a43d9a655a57753ed3b3f2d20e0c84c 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.oil +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.oil @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; @@ -38,7 +38,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/controlDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/controlDict index 623a91d25fa1688325f7a975877a634f1f1057a4..47b216d7a5f914f33eb3b05ddbfde66e20470d6d 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/controlDict +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/controlDict @@ -17,9 +17,9 @@ FoamFile application reactingMultiphaseEulerFoam; -startFrom startTime; +startFrom latestTime; -startTime 0; +startTime 0.6; stopAt endTime; @@ -47,7 +47,7 @@ runTimeModifiable yes; adjustTimeStep yes; -maxCo 0.5; +maxCo 0.2; maxDeltaT 1; diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes index d062fd80f2e5d533cfa26f909b76e619943fc7fa..aa56467be2c850410920ada6b2ebe387aeb0e940 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes @@ -30,8 +30,8 @@ divSchemes "div\(phi,alpha.*\)" Gauss vanLeer; "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; - "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinear 1; + "div\(phi.*,U.*\)" Gauss limitedLinear 1; "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSolution b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSolution index 478c27bac0fdd377da78a434262053c61e5cb55a..fd1bb96563cdb8c7812416232521e4dce39b3a57 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSolution +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/fvSolution @@ -19,7 +19,8 @@ solvers { "alpha.*" { - nAlphaSubCycles 2; + nAlphaCorr 1; + nAlphaSubCycles 2; } p_rgh @@ -32,6 +33,7 @@ solvers p_rghFinal { + $p_rgh; solver PCG; preconditioner { @@ -76,8 +78,9 @@ solvers PIMPLE { nOuterCorrectors 1; - nCorrectors 3; + nCorrectors 3; nNonOrthogonalCorrectors 0; + faceMomentum false; pRefCell 0; pRefValue 0; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties index d75557d6a3066b6fb5823f4b3ef97b66aa285191..101d6e2d37a4cdb8f79c875790de7e024680b79d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -148,6 +148,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution index f3eea450973522d4e41ca0f73a2f4e783265d264..fdad42572f37671dc7017392bb5d031f6ee147a6 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties index 9f0b6a579628cd0ff799b62c87bb856da54a4974..cd9c68677462ea436e5148195ce91078412978ce 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (solids gas); @@ -104,6 +104,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties index d75557d6a3066b6fb5823f4b3ef97b66aa285191..101d6e2d37a4cdb8f79c875790de7e024680b79d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -148,6 +148,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution index 7124667c603c9fc0bf55379fb571cf92395696eb..fa66d408e22e3301238374f4fcb9337dba2bf24f 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/combustionProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/combustionProperties.gas index 1c1c6dbddb5d1da44fb2e78a6a667ec0c558f99c..094d35e36665d1f012f2bec8625ead22a95563e2 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/combustionProperties.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/combustionProperties.gas @@ -17,14 +17,6 @@ FoamFile combustionModel PaSR; -active true; - -laminarCoeffs -{} - -noCombustionCoeffs -{} - PaSRCoeffs { Cmix 1.0; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties index 0acfa57d5e08f4b46350273b9e15fcb7e1ebd1dc..d144bcf865bae1f146de66ad8c6d681339c59274 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties @@ -28,7 +28,7 @@ gas d0 3e-3; p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-6; } @@ -51,9 +51,9 @@ blending { type linear; minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.5; + minPartlyContinuousAlpha.gas 0.3; minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.5; + minPartlyContinuousAlpha.liquid 0.3; } heatTransfer @@ -141,7 +141,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( H2O ); Le 1.0; saturationPressure @@ -200,6 +200,10 @@ massTransfer.liquid ( ); +phaseTransfer +( +); + lift ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/thermophysicalProperties.liquid index 0ae771ef59f5035ab458b1a258d5d98a3394c812..69e17541fc045d089b9ed6316c9b124d35b84674 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/thermophysicalProperties.liquid @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -48,7 +48,7 @@ inertSpecie H2O; thermodynamics { Hf -1.5879e+07; - Cp 4195; + Cv 4195; } transport { @@ -71,7 +71,7 @@ AIR thermodynamics { Hf 0; - Cp 4195; + Cv 4195; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.air new file mode 100644 index 0000000000000000000000000000000000000000..0a372e6175b859be3c01d7c596c280dcb31d5adc --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.air @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + walls + { + type zeroGradient; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + inlet + { + type fixedValue; + value $internalField; + } + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.water new file mode 100644 index 0000000000000000000000000000000000000000..26f3e79683eb05a9e66dda8d4ca982006e5bc1fd --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/T.water @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField +{ + walls + { + type zeroGradient; + } + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + inlet + { + type fixedValue; + value $internalField; + } + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/Theta b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/Theta new file mode 100644 index 0000000000000000000000000000000000000000..377979b98850daf76868af2b3c97fca86b7d3632 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/Theta @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object Theta; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1.0e-7; + } + + outlet + { + type inletOutlet; + inletValue uniform 1.0e-7; + value uniform 1.0e-7; + } + + walls + { + type zeroGradient; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.air new file mode 100644 index 0000000000000000000000000000000000000000..6738552ad8943a4e1edc32468190f849a0c101a2 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.air @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + object U.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0.1 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type pressureInletOutletVelocity; + phi phi.air; + value $internalField; + } + walls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.water new file mode 100644 index 0000000000000000000000000000000000000000..edafc657f1a7f2430c76c21fca5f6ca9c4ea650b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/U.water @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + object U.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type pressureInletOutletVelocity; + phi phi.water; + value $internalField; + } + walls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air new file mode 100644 index 0000000000000000000000000000000000000000..d336a0ceb59e794f3b3623a5769811757218b265 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air @@ -0,0 +1,1927 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + + +internalField nonuniform List<scalar> +1875 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.5; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue uniform 1; + value uniform 1; + } + walls + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air.orig b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air.orig new file mode 100644 index 0000000000000000000000000000000000000000..ddbf5788cc2f9e43a8642ad657935dd2c0c9103e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alpha.air.orig @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.5; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue uniform 1; + value uniform 1; + } + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.air new file mode 100644 index 0000000000000000000000000000000000000000..91661525abb6f12926b7e8d799a9babe4de7c57d --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type compressible::alphatWallFunction; + Prt 0.85; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.water new file mode 100644 index 0000000000000000000000000000000000000000..d71c6f334c7dfc88e1a4c6778d9263c28046cd67 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/alphat.water @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type compressible::alphatWallFunction; + Prt 0.85; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.air new file mode 100644 index 0000000000000000000000000000000000000000..9eb8e5eb390d840cc972b49f73a4bf42863a82c5 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type epsilonWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.water new file mode 100644 index 0000000000000000000000000000000000000000..b2c0cd7d216298aa05b0d32d786e80e2d1a5cbf4 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilon.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + walls + { + type epsilonWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilonm b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilonm new file mode 100644 index 0000000000000000000000000000000000000000..fc18e67dbc8b0ffb3a3b4230ef8d9ff06be86f66 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/epsilonm @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilonm; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phim; + inletValue $internalField; + value $internalField; + } + + walls + { + type zeroGradient; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/f.air.bubbles b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/f.air.bubbles new file mode 100644 index 0000000000000000000000000000000000000000..6cc1178cc9bda291bf45f77f5fde87ff0f867e9d --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/f.air.bubbles @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object f.air.bubbles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.air new file mode 100644 index 0000000000000000000000000000000000000000..6dcf851a8e8812b3c563b9dc54b9e64b25f000cf --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.water new file mode 100644 index 0000000000000000000000000000000000000000..0c7cc3d01b3ca192c610813e1e8429ff7f0c1214 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/k.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/km b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/km new file mode 100644 index 0000000000000000000000000000000000000000..1db01cbce9893771bf0d77eb25f0d90920ead885 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/km @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object km; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phim; + inletValue $internalField; + value $internalField; + } + + walls + { + type zeroGradient; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.air new file mode 100644 index 0000000000000000000000000000000000000000..b2bbd25a14537d0d8e06aa7164e7603e28d802b3 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.air @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.water new file mode 100644 index 0000000000000000000000000000000000000000..4f22baf76ec3d3d7e63e3bf8cd5d4e85f7773f70 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/nut.water @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p new file mode 100644 index 0000000000000000000000000000000000000000..334c4205ed564ce6499d842fba3bff1c32cf316b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + outlet + { + type calculated; + value $internalField; + } + walls + { + type calculated; + value $internalField; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p_rgh b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..f3becb1f990ce2acd039205f57d86b18f6905358 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/0/p_rgh @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value $internalField; + } + outlet + { + type prghPressure; + p $internalField; + value $internalField; + } + walls + { + type fixedFluxPressure; + value $internalField; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..955b55176021afbbc911e4f5d648ebf0eed843ba --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application=$(getApplication) + +runApplication blockMesh +runApplication topoSet +runApplication setFields +runApplication $application + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/g b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..e75aeb5349b458419c9e3ef12494947037e134c3 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..a8f180584c829d3d8401895a54ccbaa5bc0fd3b4 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/phaseProperties @@ -0,0 +1,239 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type populationBalanceTwoPhaseSystem; + +phases (air water); + +populationBalances (bubbles); + +air +{ + type purePhaseModel; + diameterModel velocityGroup; + velocityGroupCoeffs + { + populationBalance bubbles; + + formFactor 0.5235987756; + + sizeGroups + ( + f0{d 1.00e-3; value 0;} + f1{d 1.08e-3; value 0;} + f2{d 1.16e-3; value 0;} + f3{d 1.25e-3; value 0;} + f4{d 1.36e-3; value 0;} + f5{d 1.46e-3; value 0;} + f6{d 1.58e-3; value 0;} + f7{d 1.71e-3; value 0;} + f8{d 1.85e-3; value 0;} + f9{d 2.00e-3; value 0;} + f10{d 2.16e-3; value 0;} + f11{d 2.33e-3; value 0;} + f12{d 2.51e-3; value 0;} + f13{d 2.72e-3; value 0.25;} + f14{d 2.93e-3; value 0.5;} + f15{d 3.17e-3; value 0.25 ;} + f16{d 3.42e-3; value 0;} + f17{d 3.70e-3; value 0;} + f18{d 4.00e-3; value 0;} + f19{d 4.32e-3; value 0;} + f20{d 4.66e-3; value 0;} + f21{d 5.03e-3; value 0;} + ); + } + + residualAlpha 1e-6; +} + +water +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 1e-4; + } + + residualAlpha 1e-6; +} + +populationBalanceCoeffs +{ + bubbles + { + continuousPhase water; + + coalescenceModels + ( + CoulaloglouTavlarides{} + ); + + binaryBreakupModels + (); + + breakupModels + ( + exponential + { + C 10.0; + exponent 1.0; + daughterSizeDistributionModel uniformBinary; + } + ); + + driftModels + ( + densityChange{} + ); + + nucleationModels + (); + } +} + +blending +{ + default + { + type linear; + minFullyContinuousAlpha.air 0.7; + minPartlyContinuousAlpha.air 0.3; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.3; + } + + drag + { + type linear; + minFullyContinuousAlpha.air 0.7; + minPartlyContinuousAlpha.air 0.5; + minFullyContinuousAlpha.water 0.7; + minPartlyContinuousAlpha.water 0.5; + } +} + +surfaceTension +( + (air and water) + { + type constant; + sigma 0.07; + } +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); + +drag +( + (air in water) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); + +heatTransfer +( + (air in water) + { + type RanzMarshall; + residualAlpha 1e-4; + } + + (water in air) + { + type RanzMarshall; + residualAlpha 1e-4; + } +); + +phaseTransfer +( +); + +lift +( +); + +wallLubrication +( +); + +turbulentDispersion +( +); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.air new file mode 100644 index 0000000000000000000000000000000000000000..aca85e96f42f2144d5951c4007100e0d189b90c7 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.water new file mode 100644 index 0000000000000000000000000000000000000000..4578d356dff34fe58fdb7e49ef11b06172d22f13 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/thermophysicalProperties.water @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState perfectFluid; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18; + } + equationOfState + { + R 3000; + rho0 1027; + } + thermodynamics + { + Cv 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.air new file mode 100644 index 0000000000000000000000000000000000000000..45cb891c83ee6be7454d74975ca39fa0e9d11646 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.air @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel mixtureKEpsilon; // continuousGasKEpsilon; + + turbulence on; + printCoeffs on; + + // mixtureKEpsilonCoeffs + // { + // Cp 1; + // C3 1; + // } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.water new file mode 100644 index 0000000000000000000000000000000000000000..28d94897c5b18c198bc967b86dd5dece1c7ad783 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/constant/turbulenceProperties.water @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel mixtureKEpsilon; // LaheyKEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..2aaa8f88ec130fe9b00e0515c6f2b2d8f13a640f --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/blockMeshDict @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (0.15 0 0) + (0.15 1 0) + (0 1 0) + (0 0 0.1) + (0.15 0 0.1) + (0.15 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (25 75 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch inlet + ( + (1 5 4 0) + ) + patch outlet + ( + (3 7 6 2) + ) + wall walls + ( + (0 4 7 3) + (2 6 5 1) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/controlDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..dd6db887e9b81f3d31c4af03e90e0cd22fc674cc --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/controlDict @@ -0,0 +1,112 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingTwoPhaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 0.005; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + fieldAverage1 + { + type fieldAverage; + libs ("libfieldFunctionObjects.so"); + writeControl writeTime; + fields + ( + U.air + { + mean on; + prime2Mean off; + base time; + } + + U.water + { + mean on; + prime2Mean off; + base time; + } + + alpha.air + { + mean on; + prime2Mean off; + base time; + } + + p + { + mean on; + prime2Mean off; + base time; + } + ); + } + + numberDensity.diameter.bubbles + { + type sizeDistribution; + libs ("libreactingEulerFoamFunctionObjects.so"); + + writeControl runTime; + writeInterval 5; + + log true; + + functionType numberDensity; + abszissaType diameter; + selectionMode cellZone; + cellZone zone; + populationBalance bubbles; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSchemes b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..62a988503104df5194cae9c8e9d1d37a4b1eec5a --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,alpha.air) Gauss vanLeer; + div(phir,alpha.air) Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,(h|e|f).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss limitedLinear 1; + "div\(phim,(k|epsilon)m\)" Gauss limitedLinear 1; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..d0f30d0a4e172de3203bc7dcffee064dacacd5ff --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/fvSolution @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 2; + } + + bubbles + { + nCorr 1; + tolerance 1e-4; + renormalize false; + solveOnFinalIterOnly true; + } + + p_rgh + { + solver GAMG; + smoother DIC; + tolerance 1e-8; + relTol 0; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0; + minIter 1; + } + + "e.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0; + minIter 1; + } + + "(k|epsilon|Theta).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0; + minIter 1; + } + + "f.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/setFieldsDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..58c188396f36cf97b008c4b4c1f247b8e5be25b7 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/setFieldsDict @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.air 1 +); + +regions +( + boxToCell + { + box (0 0 -0.1) (0.15 0.701 0.1); + fieldValues + ( + volScalarFieldValue alpha.air 0 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/topoSetDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..9cb2253ee40dad02db527426053c9f0ddb96e406 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/system/topoSetDict @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name zone; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + boxes + ( + (0 0.4 0) (0.15 0.5 0.1) + ); + } + } + + { + name zone; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set zone; + } + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties index 998b9b683f40bd2bdd88462e867f2e56d96c2831..aed1aefe0279c3bfc6b88f1aececcb87f9af4c24 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (particles air); @@ -99,6 +99,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/T.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/T.gas index 3ea7c62e0b3fceb9582e9a32549c0051c90c9331..e29461cc42a5c3e9f5c7b89a616afd5caf3d97c9 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/T.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/T.gas @@ -40,7 +40,7 @@ boundaryField wall2 { type copiedFixedValue; - sourceField T.liquid; + sourceFieldName T.liquid; value uniform 368; } defaultFaces diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.gas index ce3a78d25a55c5e102d04d5f394dc0956998d1a4..4cb4c39ca60f7d85e8efaf49003e01787a3d0766 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.gas @@ -44,6 +44,7 @@ boundaryField { type compressible::alphatWallBoilingWallFunction; phaseType vapor; + otherPhase liquid; Prt 0.85; Cmu 0.09; kappa 0.41; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.liquid index 233c9861ab8a2eaface4be250da8ecb545fce430..90e07ed6f7a6a73ad1bcaebf33b735f026f75f24 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/0/alphat.liquid @@ -44,6 +44,7 @@ boundaryField wall2 { type compressible::alphatWallBoilingWallFunction; + otherPhase gas; phaseType liquid; Prt 0.85; Cmu 0.09; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun index 63508b91f8a6871168689148f52bc7320425b7b3..58bff92e2dcff32c0780917754a5e72e6b8b501c 100755 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun @@ -7,7 +7,7 @@ runApplication $(getApplication) if notTest $@ then - foamDictionary system/controlDict -entry endTime -set 5 + foamDictionary system/controlDict -entry endTime -set 4 foamDictionary 2/T.liquid -entry boundaryField/wall2/q -set 'uniform 1e5' runApplication -a $(getApplication) fi diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Tsat_water_1_2bar.csv b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Tsat_water_1_2bar.csv new file mode 100644 index 0000000000000000000000000000000000000000..bdab8b9ab17c06be63834f9e2372d22c6ad27b4e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Tsat_water_1_2bar.csv @@ -0,0 +1,66 @@ +p,Tsat +99083.3,372.499 +100667,372.942 +102250,373.379 +103833,373.811 +105417,374.237 +107000,374.658 +108583,375.074 +110167,375.485 +111750,375.891 +113333,376.293 +114917,376.689 +116500,377.082 +118083,377.47 +119667,377.853 +121250,378.233 +122833,378.608 +124417,378.98 +126000,379.347 +127583,379.711 +129167,380.071 +130750,380.427 +132333,380.78 +133917,381.13 +135500,381.476 +137083,381.819 +138667,382.158 +140250,382.494 +141833,382.828 +143417,383.158 +145000,383.485 +146583,383.809 +148167,384.131 +149750,384.449 +151333,384.765 +152917,385.078 +154500,385.389 +156083,385.697 +157667,386.002 +159250,386.305 +160833,386.605 +162417,386.903 +164000,387.199 +165583,387.492 +167167,387.783 +168750,388.072 +170333,388.358 +171917,388.642 +173500,388.925 +175083,389.205 +176667,389.483 +178250,389.759 +179833,390.033 +181417,390.305 +183000,390.575 +184583,390.843 +186167,391.109 +187750,391.374 +189333,391.636 +190917,391.897 +192500,392.156 +194083,392.413 +195667,392.669 +197250,392.923 +198833,393.175 +200417,393.426 diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/phaseProperties index 9a137fccd54be1aee602c02bb870c6c67a07257c..f87d3a058edb2cdca7edad4f348d09ddcbde8da9 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/phaseProperties @@ -19,13 +19,11 @@ type thermalPhaseChangeTwoPhaseSystem; phases (gas liquid); -volatile "water"; - -massTransfer on; +phaseChange on; gas { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel isothermal; constantCoeffs { @@ -37,20 +35,20 @@ gas d0 0.00045; p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-4; } liquid { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel constant; constantCoeffs { d 0.00045; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-4; } @@ -59,74 +57,34 @@ blending { default { - type linear; - continuousPhase liquid; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.5; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.5; - } - - heatTransfer - { - type linear; - continuousPhase liquid; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - - massTransfer - { - type linear; + type none; continuousPhase liquid; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; } } surfaceTension -( - (gas and liquid) - { - type constant; - sigma 0.07; - } -); +(); saturationModel { - type polynomial; - C<8> - ( - 308.0422 - 0.0015096 - -1.61589e-8 - 1.114106e-13 - -4.52216e-19 - 1.05192e-24 - -1.2953e-30 - 6.5365e-37 - ); + type function1; + + function csvFile; + functionCoeffs + { + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator ","; + mergeSeparators no; + file "Tsat_water_1_2bar.csv"; + outOfBounds clamp; + interpolationScheme linear; + }; }; aspectRatio -( - (gas in liquid) - { - type constant; - E0 1.0; - } - - (liquid in gas) - { - type constant; - E0 1.0; - } -); +(); drag ( @@ -139,16 +97,6 @@ drag type none; } } - - (liquid in gas) - { - type SchillerNaumann; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } ); virtualMass @@ -158,17 +106,8 @@ virtualMass type constantCoefficient; Cvm 0.5; } - - (liquid in gas) - { - type constantCoefficient; - Cvm 0.5; - } ); -interfaceComposition -(); - heatTransfer.gas ( (gas in liquid) @@ -176,12 +115,6 @@ heatTransfer.gas type spherical; residualAlpha 1e-3; } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-3; - } ); heatTransfer.liquid @@ -191,35 +124,17 @@ heatTransfer.liquid type RanzMarshall; residualAlpha 1e-3; } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-3; - } ); -massTransfer.gas +phaseTransfer (); -massTransfer.liquid -(); lift (); wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - Cwc 10.0; - Cwd 6.8; - p 1.7; - } -); +(); turbulentDispersion ( diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.gas index bdc719b028709a025b131b32bb1636b16563b247..1994994f4c54f5e5de599781faeef19fdc3ad85c 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.gas @@ -18,28 +18,16 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; - thermo hRefConst; + thermo eRefConst; equationOfState perfectGas; specie specie; - energy sensibleEnthalpy; + energy sensibleInternalEnergy; } -dpdt no; -species -( - water -); - -inertSpecie water; - -chemistryReader foamChemistryReader; - -foamChemistryFile "<constant>/reactions.gas"; - -water +mixture { specie { @@ -53,9 +41,9 @@ water thermodynamics { Hf 0; - Cp 12078.4; + Cv 12078.4; Tref 373.55; - Href 2675500; + Eref 2675500; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.liquid index b6d1d08280649ad8eb46660015f7241e8c968f0a..efe40ccb869062c41d2ff85b4f6a43bc42a98c15 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.liquid @@ -18,24 +18,15 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; - thermo hRefConst; + thermo eRefConst; equationOfState rhoConst; specie specie; - energy sensibleEnthalpy; + energy sensibleInternalEnergy; } -dpdt no; - -species -( - water -); - -inertSpecie water; - -"(mixture|H2O|water)" +mixture { specie { @@ -50,9 +41,9 @@ inertSpecie water; thermodynamics { Hf 0; - Cp 4195; + Cv 4195; Tref 373.55; - Href 417500; + Eref 417500; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/fvSolution index de2c01ef96b943317391b327401183582517cda6..168778ed1bcbecff9dc2cb18d396ad5dce43a422 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/fvSolution @@ -67,7 +67,7 @@ solvers minIter 1; } - Yi + "Yi.*" { solver smoothSolver; smoother symGaussSeidel; @@ -97,7 +97,6 @@ relaxationFactors equations { ".*" 1; - "h.*" 0.3; } } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.gas new file mode 100644 index 0000000000000000000000000000000000000000..835f14915f64f7fc9054abf35f07bb2d125a0893 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.gas @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + wall2 + { + type copiedFixedValue; + sourceFieldName T.liquid; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.liquid new file mode 100644 index 0000000000000000000000000000000000000000..0025a47da871546c42ebd1110c9a5311c55d50b0 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/T.liquid @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object T.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 368; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 368; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 368; + value uniform 368; + } + wall1 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + wall2 + { + type fixedMultiPhaseHeatFlux; + relax 0.5; + q uniform 0; + phase "liquid"; + value uniform 368; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas2 b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas2 new file mode 100644 index 0000000000000000000000000000000000000000..16808898ed4090f6006f530a37e5f3d2d384ff1d --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.gas2 @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.gas; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value uniform (0 1 0); + } + wall1 + { + type slip; + } + wall2 + { + type slip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e29917dc0f4be4984874d05beaee2f07a845cf23 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/U.liquid @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 1 0); + +boundaryField +{ + inlet + { + type mapped; + field U.liquid; + setAverage 1; + average (0 1 0); + interpolationScheme cell; + value uniform (0 1 0); + } + outlet + { + type pressureInletOutletVelocity; + phi phi.liquid; + value uniform (0 1 0); + } + wall1 + { + type noSlip; + } + wall2 + { + type noSlip; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.gas new file mode 100644 index 0000000000000000000000000000000000000000..c60002360ff3534a34eb2753370be06b4145240e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.gas @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0; + value uniform 0; + } + wall1 + { + type zeroGradient; + } + wall2 + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.liquid new file mode 100644 index 0000000000000000000000000000000000000000..5d799f75264cf14e3fe229914bff8d9c69512e11 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alpha.liquid @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1; + } + outlet + { + type calculated; + value uniform 1; + } + wall1 + { + type calculated; + value uniform 1; + } + wall2 + { + type calculated; + value uniform 1; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.gas new file mode 100644 index 0000000000000000000000000000000000000000..76b810b72cc7a2797f56bf78ad2a9cff2a45c5c7 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.gas @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + alphaCrit 0.2; + } + value uniform 0; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase liquid; + phaseType vapor; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + partitioningModel + { + type phaseFraction; + alphaCrit 0.2; + } + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.liquid new file mode 100644 index 0000000000000000000000000000000000000000..de529d16587feeee38400d56d4f74c95b76ae589 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/alphat.liquid @@ -0,0 +1,101 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value uniform 1e-8; + } + outlet + { + type calculated; + value uniform 1e-8; + } + wall1 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction;//Lavieville; + alphaCrit 0.2; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + wall2 + { + type compressible::alphatWallBoilingWallFunction; + otherPhase gas; + phaseType liquid; + Prt 0.85; + Cmu 0.09; + kappa 0.41; + E 9.8; + relax 0.01; + dmdt uniform 0; + partitioningModel + { + type phaseFraction;//Lavieville; + alphaCrit 0.2; + } + nucleationSiteModel + { + type LemmertChawla; + } + departureDiamModel + { + type TolubinskiKostanchuk; + } + departureFreqModel + { + type Cole; + } + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.gas new file mode 100644 index 0000000000000000000000000000000000000000..72ab457033402c99f578a2a27c7e306fbbaa7c73 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.gas @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.liquid new file mode 100644 index 0000000000000000000000000000000000000000..2b70ecaa0534327f8a9ed0a6c106391171dc2268 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/epsilon.liquid @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.001; + +boundaryField +{ + inlet + { + type mapped; + field epsilon.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.001; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 0.00015; + value uniform 0.001; + } + wall1 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + wall2 + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.gas new file mode 100644 index 0000000000000000000000000000000000000000..106fb50b0404e6ce611e20f7afdcda271f7e0e7d --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.gas; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 0.01; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.liquid new file mode 100644 index 0000000000000000000000000000000000000000..09b9fd20f6db414bff7c18ac1ed7718f266a8393 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/k.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + inlet + { + type mapped; + field k.liquid; + setAverage 0; + average 0; + interpolationScheme cell; + value uniform 0.01; + } + outlet + { + type inletOutlet; + phi phi.liquid; + inletValue uniform 3.75e-05; + value uniform 0.01; + } + wall1 + { + type kqRWallFunction; + value uniform 0.01; + } + wall2 + { + type kqRWallFunction; + value uniform 0.01; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.gas new file mode 100644 index 0000000000000000000000000000000000000000..014fc171535e8a4bb440c8946d0a671594d39264 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.gas @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.liquid new file mode 100644 index 0000000000000000000000000000000000000000..e5fb6061d08cee36651ebd319a9dc00fc99ac196 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/nut.liquid @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0.0001; + } + outlet + { + type calculated; + value uniform 0.0001; + } + wall1 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + wall2 + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.0001; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p new file mode 100644 index 0000000000000000000000000000000000000000..b2458fb471c585e9107552080ce0428cba3b1d3b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type calculated; + value uniform 100000; + } + outlet + { + type calculated; + value uniform 100000; + } + wall1 + { + type calculated; + value uniform 100000; + } + wall2 + { + type calculated; + value uniform 100000; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p_rgh b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..6935a7293bee83402d8c9d785ee55c42d4e0cb7e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/0/p_rgh @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "5"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + } + outlet + { + type prghPressure; + p uniform 100000; + value uniform 100000; + } + wall1 + { + type fixedFluxPressure; + } + wall2 + { + type fixedFluxPressure; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..84094579771dbf39255a890a29b848048389c10b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase +cp system/controlDict.org system/controlDict + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e2b33f6cea5a2e278082ebda12d066f15073a0c7 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun @@ -0,0 +1,22 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=$(getApplication) + +runApplication blockMesh +runApplication $application + +if ! isTest $@ +then + foamDictionary system/controlDict -entry endTime -set 4 + foamDictionary system/controlDict -entry startTime -set 0.5 + foamDictionary 0.5/T.liquid -entry boundaryField.wall2.q -set 'uniform 500000' + foamDictionary 0.5/T.liquid -entry boundaryField.wall1.q -set 'uniform 500000' + foamDictionary 0.5/U.liquid -entry boundaryField.inlet.type -set 'fixedValue' + runApplication -a $application +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/g b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..825f0a08cbd62f1224f19eff670a783c2973c2ff --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..50a2dce95179970ff2845ebc5b3e962b67f5bb65 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/phaseProperties @@ -0,0 +1,138 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type thermalPhaseChangeTwoPhaseSystem; + +phases (gas liquid); + +phaseChange on; + +gas +{ + type purePhaseModel; + diameterModel constant; + + constantCoeffs + { + d 0.00045; + } + + Sct 0.7; + + residualAlpha 1e-4; +} + +liquid +{ + type purePhaseModel; + diameterModel constant; + constantCoeffs + { + d 0.00045; + } + Sct 0.7; + + residualAlpha 1e-4; +} + +blending +{ + default + { + type none; + continuousPhase liquid; + } +} + +surfaceTension +(); + +saturationModel +{ + type constant; + + Tsat 373; + pSat 1e5; +}; + +aspectRatio +( + (gas in liquid) + { + type constant; + E0 1.0; + } +); + +drag +( + (gas in liquid) + { + type SchillerNaumann; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (gas in liquid) + { + type constantCoefficient; + Cvm 0.5; + } +); + +heatTransfer.gas +( + (gas in liquid) + { + type spherical; + residualAlpha 1e-3; + } +); + +heatTransfer.liquid +( + (gas in liquid) + { + type RanzMarshall; + residualAlpha 1e-3; + } +); + +phaseTransfer +( +); + +lift +(); + +wallLubrication +(); + +turbulentDispersion +(); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..908b7bec188a6b9bf6eb1ac24dddb418d5d11253 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.gas @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 1; + } + thermodynamics + { + Hf 0; + Cv 12078.4; + Tref 373.55; + Eref 2675500; + } + transport + { + mu 1.2256e-5; + Pr 2.289; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..7768d06337d0309cd51ff2e94c15574afe50534b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.liquid @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eRefConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0153; + } + equationOfState + { + rho 959; + } + thermodynamics + { + Hf 0; + Cv 4195; + Tref 373.55; + Eref 417500; + } + transport + { + mu 2.8291e-4; + Pr 2.289; + } +} + + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.gas new file mode 100644 index 0000000000000000000000000000000000000000..baf6ade451ebc44da76a8c6979a8f887821e74d4 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.gas @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar;//RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.liquid new file mode 100644 index 0000000000000000000000000000000000000000..844aa58c28fd2282ad0548e0400942249321daf3 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/turbulenceProperties.liquid @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..45671cd7a86c86bb311ce50425b39698a54f5ba9 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/blockMeshDict @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (0.05 0 0) + (0.05 2 0) + (0 2 0) + (0 0 0.1) + (0.05 0 0.1) + (0.05 2 0.1) + (0 2 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 75 1) simpleGrading (1 1 1) +); + +boundary +( + inlet + { + type mappedPatch; + offset (0 0.1 0); + sampleRegion region0; + sampleMode nearestCell; + samplePatch none; + + faces + ( + (1 5 4 0) + ); + } + + outlet + { + type patch; + faces + ( + (3 7 6 2) + ); + } + + wall1 + { + type wall; + faces + ( + (0 4 7 3) + ); + } + + wall2 + { + type wall; + faces + ( + (2 6 5 1) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..afa9f85028dc741e9c38e9c4597d2cd2478acd83 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingTwoPhaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict.org b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict.org new file mode 100644 index 0000000000000000000000000000000000000000..afa9f85028dc741e9c38e9c4597d2cd2478acd83 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/controlDict.org @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingTwoPhaseEulerFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.05; + +maxDeltaT 0.001; + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSchemes b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..454b27e383d9fd8f73fef24151cb999065dd4863 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss upwind; + "div\(phim,(k|epsilon)m\)" Gauss upwind; + + "div\(\(\(\(alpha.*\*thermo:rho.*\)\*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + default no; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..3cdf78c21bfdda2e697825334a50e7b35ec9002b --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/system/fvSolution @@ -0,0 +1,105 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + } + + p_rgh + { + solver GAMG; + smoother DIC; + tolerance 1e-8; + relTol 0.01; + maxIter 100; + minIter 2; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + } + + "(e|h).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0.001; + minIter 1; + maxIter 20; + } + + "(k|epsilon|Theta).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + minIter 1; + } + + "Yi.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0; + minIter 1; + residualAlpha 1e-8; + } +} + +PIMPLE +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + nEnergyCorrectors 2; + faceMomentum yes; +} + +relaxationFactors +{ + fields + { + iDmdt 0.1; + } + + equations + { + ".*" 1; + "e.*" 0.5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/T.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/T.gas index 3ea7c62e0b3fceb9582e9a32549c0051c90c9331..e29461cc42a5c3e9f5c7b89a616afd5caf3d97c9 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/T.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/T.gas @@ -40,7 +40,7 @@ boundaryField wall2 { type copiedFixedValue; - sourceField T.liquid; + sourceFieldName T.liquid; value uniform 368; } defaultFaces diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.gas index ce3a78d25a55c5e102d04d5f394dc0956998d1a4..4cb4c39ca60f7d85e8efaf49003e01787a3d0766 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.gas @@ -44,6 +44,7 @@ boundaryField { type compressible::alphatWallBoilingWallFunction; phaseType vapor; + otherPhase liquid; Prt 0.85; Cmu 0.09; kappa 0.41; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.liquid index 233c9861ab8a2eaface4be250da8ecb545fce430..945cbca68b2d3eb2bcd8931947fa07d658c3cedf 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/0/alphat.liquid @@ -45,6 +45,7 @@ boundaryField { type compressible::alphatWallBoilingWallFunction; phaseType liquid; + otherPhase gas; Prt 0.85; Cmu 0.09; kappa 0.41; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Tsat_water_1_2bar.csv b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Tsat_water_1_2bar.csv new file mode 100644 index 0000000000000000000000000000000000000000..bdab8b9ab17c06be63834f9e2372d22c6ad27b4e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Tsat_water_1_2bar.csv @@ -0,0 +1,66 @@ +p,Tsat +99083.3,372.499 +100667,372.942 +102250,373.379 +103833,373.811 +105417,374.237 +107000,374.658 +108583,375.074 +110167,375.485 +111750,375.891 +113333,376.293 +114917,376.689 +116500,377.082 +118083,377.47 +119667,377.853 +121250,378.233 +122833,378.608 +124417,378.98 +126000,379.347 +127583,379.711 +129167,380.071 +130750,380.427 +132333,380.78 +133917,381.13 +135500,381.476 +137083,381.819 +138667,382.158 +140250,382.494 +141833,382.828 +143417,383.158 +145000,383.485 +146583,383.809 +148167,384.131 +149750,384.449 +151333,384.765 +152917,385.078 +154500,385.389 +156083,385.697 +157667,386.002 +159250,386.305 +160833,386.605 +162417,386.903 +164000,387.199 +165583,387.492 +167167,387.783 +168750,388.072 +170333,388.358 +171917,388.642 +173500,388.925 +175083,389.205 +176667,389.483 +178250,389.759 +179833,390.033 +181417,390.305 +183000,390.575 +184583,390.843 +186167,391.109 +187750,391.374 +189333,391.636 +190917,391.897 +192500,392.156 +194083,392.413 +195667,392.669 +197250,392.923 +198833,393.175 +200417,393.426 diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties index 529dbe7b9747f55195481bdd20cd01152a109519..b088a45c96ec2e514587cf5350c4ce1c19c2b59e 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties @@ -19,13 +19,12 @@ type thermalPhaseChangeTwoPhaseSystem; phases (gas liquid); -volatile "water"; -massTransfer on; +phaseChange on; gas { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel IATE; IATECoeffs @@ -55,7 +54,9 @@ gas } phaseChange - {} + { + pairName gasAndLiquid; + } wallBoiling {} @@ -73,20 +74,20 @@ gas p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-4; } liquid { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel constant; constantCoeffs { d 0.00045; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-4; } @@ -95,32 +96,8 @@ blending { default { - type linear; - continuousPhase liquid; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.5; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.5; - } - - heatTransfer - { - type linear; - continuousPhase liquid; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - - massTransfer - { - type linear; + type none; continuousPhase liquid; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; } } @@ -135,18 +112,20 @@ surfaceTension saturationModel { - type polynomial; - C<8> - ( - 308.0422 - 0.0015096 - -1.61589e-8 - 1.114106e-13 - -4.52216e-19 - 1.05192e-24 - -1.2953e-30 - 6.5365e-37 - ); + type function1; + + function csvFile; + functionCoeffs + { + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator ","; + mergeSeparators no; + file "Tsat_water_1_2bar.csv"; + outOfBounds clamp; + interpolationScheme linear; + }; }; aspectRatio @@ -156,12 +135,6 @@ aspectRatio type constant; E0 1.0; } - - (liquid in gas) - { - type constant; - E0 1.0; - } ); drag @@ -175,16 +148,6 @@ drag type none; } } - - (liquid in gas) - { - type SchillerNaumann; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } ); virtualMass @@ -194,12 +157,6 @@ virtualMass type constantCoefficient; Cvm 0.5; } - - (liquid in gas) - { - type constantCoefficient; - Cvm 0.5; - } ); interfaceComposition @@ -212,12 +169,6 @@ heatTransfer.gas type spherical; residualAlpha 1e-3; } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-3; - } ); heatTransfer.liquid @@ -227,35 +178,17 @@ heatTransfer.liquid type RanzMarshall; residualAlpha 1e-3; } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-3; - } ); -massTransfer.gas +phaseTransfer (); -massTransfer.liquid -(); lift (); wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - Cwc 10.0; - Cwd 6.8; - p 1.7; - } -); +(); turbulentDispersion ( diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.gas index bdc719b028709a025b131b32bb1636b16563b247..1994994f4c54f5e5de599781faeef19fdc3ad85c 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.gas @@ -18,28 +18,16 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; - thermo hRefConst; + thermo eRefConst; equationOfState perfectGas; specie specie; - energy sensibleEnthalpy; + energy sensibleInternalEnergy; } -dpdt no; -species -( - water -); - -inertSpecie water; - -chemistryReader foamChemistryReader; - -foamChemistryFile "<constant>/reactions.gas"; - -water +mixture { specie { @@ -53,9 +41,9 @@ water thermodynamics { Hf 0; - Cp 12078.4; + Cv 12078.4; Tref 373.55; - Href 2675500; + Eref 2675500; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.liquid index b6d1d08280649ad8eb46660015f7241e8c968f0a..450c6fc1a7acbd9debfe512313b35b9cdea40c42 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.liquid @@ -18,12 +18,12 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; - thermo hRefConst; + thermo eRefConst; equationOfState rhoConst; specie specie; - energy sensibleEnthalpy; + energy sensibleInternalEnergy; } dpdt no; @@ -35,7 +35,7 @@ species inertSpecie water; -"(mixture|H2O|water)" +mixture { specie { @@ -50,9 +50,9 @@ inertSpecie water; thermodynamics { Hf 0; - Cp 4195; + Cv 4195; Tref 373.55; - Href 417500; + Eref 417500; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution index e06e4b9933a12e5e0791f828a652c496ec484a63..4587cba7c111890ef47dcecadc262d0a6c4d713c 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution @@ -75,7 +75,7 @@ solvers relTol 0; } - Yi + "Yi.*" { solver smoothSolver; smoother symGaussSeidel; @@ -104,8 +104,8 @@ relaxationFactors equations { - ".*" 1; - "h.*" 0.3; + ".*" 1; + "e.*" 0.1; } } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air index 0dee22f1f6edf64f5dfc8de5a3c6f96bb2ca4baa..d336a0ceb59e794f3b3623a5769811757218b265 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1812 | +| \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -17,7 +17,8 @@ FoamFile dimensions [0 0 0 0 0 0 0]; -internalField nonuniform List<scalar> + +internalField nonuniform List<scalar> 1875 ( 0 diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..ed61ac543538db7d3679847d004086dd7fe3952f --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication setFields +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties index aacc94ea39133cea4111d095b4d109d50f14e1ef..94efa8337461168c0d6e4f3b9968b1300ad8b939 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -159,6 +159,10 @@ turbulentDispersion ( ); +phaseTransfer +( +); + // Minimum allowable pressure pMin 10000; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution index f1d9267bcd28a3211791575d0895322d3ca3069d..e1f4de0af9d6f20eee7ed73fdc4ba06d6f2eafed 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties index 61ea99ca8751de19fa989e8d5c2d269fe2211853..930b0a1c5ccb68a5101f43c463056dd7744a1c4d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties @@ -28,7 +28,7 @@ gas d0 3e-3; p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-6; } @@ -56,7 +56,7 @@ blending minFullyContinuousAlpha.liquid 0.7; } - heatTransferModel + heatTransfer { type linear; minPartlyContinuousAlpha.gas 0; @@ -65,7 +65,7 @@ blending minFullyContinuousAlpha.liquid 1; } - massTransferModel + massTransfer { type linear; minPartlyContinuousAlpha.gas 0; @@ -141,7 +141,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( H2O ); Le 1.0; saturationPressure @@ -211,6 +211,10 @@ massTransfer.liquid } ); +phaseTransfer +( +); + lift ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/thermophysicalProperties.liquid index ed3eb82f7a26ab271d413c6399d46b919dd1d0ef..517d3f16cf8fa8e89a1b469f7e3984cc977ce910 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/thermophysicalProperties.liquid @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -48,7 +48,7 @@ inertSpecie H2O; thermodynamics { Hf -1.5879e+07; - Cp 4195; + Cv 4195; } transport { @@ -71,7 +71,7 @@ air thermodynamics { Hf 0; - Cp 4195; + Cv 4195; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions index ed2ea2a68d2163a0e92b007215de229a41ea3710..13f7cf8c2d48ed679195dd884b6a1df98199ae67 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions @@ -70,8 +70,6 @@ totalMass const volScalarField& rhoLiquid = mesh().lookupObject<volScalarField>("thermo:rho.liquid"); - const volScalarField& dmdt = - mesh().lookupObject<volScalarField>("dmdt.gasAndLiquid"); const scalarField& v = mesh().V(); @@ -79,10 +77,7 @@ totalMass << " volIntegrate(all) for alpha.gas*rho.gas = " << gSum(alphaGas*rhoGas*v) << endl << " volIntegrate(all) for alpha.liquid*rho.liquid = " - << gSum(alphaLiquid*rhoLiquid*v) << endl - << " volIntegrate(all) for dmdt = " - << gSum(dmdt*v) << endl - << endl; + << gSum(alphaLiquid*rhoLiquid*v) << endl; #}; } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution index 06454b596918d2e51e454a1d4336f3a164bd9a7a..e3ead3770a6d5a600e4173ac5d6e3772251b8d76 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution @@ -55,7 +55,7 @@ solvers minIter 1; } - Yi + "Yi.*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties index 99f9d460043427a0d3a15c1cd85952adcaffe871..a7b328077e3a818ff3a39d3a0ae6643b4997d03c 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties @@ -28,7 +28,7 @@ gas d0 3e-3; p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-6; } @@ -41,7 +41,7 @@ liquid { d 1e-4; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-6; } @@ -57,7 +57,7 @@ blending minPartlyContinuousAlpha.liquid 0.5; } - heatTransferModel + heatTransfer { type linear; minFullyContinuousAlpha.gas 1; @@ -66,7 +66,7 @@ blending minPartlyContinuousAlpha.liquid 0; } - massTransferModel + massTransfer { type linear; minFullyContinuousAlpha.gas 1; @@ -142,7 +142,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( water ); Le 1.0; saturationPressure @@ -220,6 +220,10 @@ massTransfer.liquid } ); +phaseTransfer +( +); + lift ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.gas index b0d97626ba26718c0b501b7247936a9a9bce5785..768e642f5fd6fd0ef4de802a67fd275d6a03257e 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.gas +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.gas @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture multiComponentMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; @@ -43,7 +43,7 @@ inertSpecie air; thermodynamics { Hf 0; - Cp 1012.5; + Cv 724.8; } transport { @@ -61,7 +61,7 @@ water thermodynamics { Hf -1.3435e+07; - Cp 1857.8; + Cv 1396.3; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.liquid b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.liquid index 8e4c989fe7e7a3625446a8ddf608bf2b454f78bf..14ef6a22c05ac478db5c5ba42600809c2832f7ae 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/thermophysicalProperties.liquid @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture multiComponentMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -48,7 +48,7 @@ inertSpecie water; thermodynamics { Hf -1.5879e+07; - Cp 4195; + Cv 4195; } transport { @@ -71,7 +71,7 @@ air thermodynamics { Hf 0; - Cp 4195; + Cv 4195; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution index f693fa0ed5a3c15b023891e44903f96b1661c1d6..34ba7b769f425680a078dcbcfabb8b7f3fba0da5 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution @@ -55,7 +55,7 @@ solvers minIter 1; } - Yi + "Yi.*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties index c06dca6a1526fcefd2ecf4e873760be8647d84d1..dff67c5ea6f3da2c98f4d1a8d7c3bff3c5118995 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -171,6 +171,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution index 5266b1aa6ea6b86e00f436a99cda732eb13367ad..9dcd342a1ea3e69878d26941d25b1ab6e6536c9e 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties index 37b73dce73ec916ff6eecd6aff7c4a4e249da754..c007cd4de981b07d4dd3c3714f52ce973ebc8b24 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (particles air); @@ -101,6 +101,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/phaseProperties index 9cdda6ca7aa6cf61ae95f997b5d2c01bab12ac53..bbe873a56f1c13bd093a727611ff5917129d80d8 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -149,6 +149,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/fvSolution index f1d9267bcd28a3211791575d0895322d3ca3069d..e1f4de0af9d6f20eee7ed73fdc4ba06d6f2eafed 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties index a98a2755439b73a5d96fed41d15a984adae2a04d..dea8efb8c384a40da52c67004589feb6cd8b2b47 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -type heatAndMomentumTransferTwoPhaseSystem; +type basicTwoPhaseSystem; phases (air water); @@ -148,6 +148,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution index 02e7d17546f2c8e7c0033e1648c8d7adaddbd2fc..7d78bbe112eda8615f4f6ec084642959135b3ab5 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha.air + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/phaseProperties index 9c09cd97880c197aff0ed07b00455774da74a674..d8f78f6598549ee284a623b895bcaf890d6b04e6 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/phaseProperties @@ -19,33 +19,32 @@ type thermalPhaseChangeTwoPhaseSystem; phases (steam water); -volatile "water"; +phaseChange on; -massTransfer on; steam { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel isothermal; isothermalCoeffs { d0 3e-3; p0 1e5; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-3; } water { - type multiComponentPhaseModel; + type purePhaseModel; diameterModel constant; constantCoeffs { d 1e-4; } - Sc 0.7; + Sct 0.7; residualAlpha 1e-3; } @@ -110,14 +109,6 @@ virtualMass interfaceComposition (); -heatTransfer -( - (steam in water) - { - type spherical; - residualAlpha 1e-4; - } -); heatTransfer.steam ( @@ -137,10 +128,7 @@ heatTransfer.water } ); -massTransfer.steam -(); - -massTransfer.water +phaseTransfer (); lift diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.steam b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.steam index e0b9603a49272b8702a4536718ac970a7ee9cf0a..bcf49fed8ff565b0aca42bdb1e8f5ee3242ddfda 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.steam +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.steam @@ -18,7 +18,7 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; thermo hRefConst; equationOfState perfectGas; @@ -30,14 +30,8 @@ dpdt yes; pressureWorkAlphaLimit 0; -species -( - water -); -inertSpecie water; - -water +mixture { specie { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.water b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.water index 5e8b3568cbf35cac240b3ee85771771818a688fb..9fb4d2a6317c3c2975949becda61eac49d8edf7e 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.water @@ -18,26 +18,17 @@ FoamFile thermoType { type heRhoThermo; - mixture multiComponentMixture; + mixture pureMixture; transport const; - thermo hRefConst; + thermo eRefConst; equationOfState perfectFluid; specie specie; - energy sensibleEnthalpy; + energy sensibleInternalEnergy; } -dpdt yes; - pressureWorkAlphaLimit 0; -species -( - water -); - -inertSpecie water; - -water +mixture { specie { @@ -53,9 +44,9 @@ water thermodynamics { Hf 0; - Cp 4195; + Cv 4195; Tref 372.76; - Href 417500; + Eref 417500; } transport diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution index faf8736b695ae52bb299a4f52a4514ebc4f13143..209ddf7393123b5f30ab2f32f2bd93757080407a 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution @@ -65,7 +65,7 @@ solvers minIter 1; } - Yi + "Yi.*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties index 1738da539c876040c9728143fa9dbbf08e3e39dd..586af8622bc3ecb8f69079b5133ba6cf0432b275 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties @@ -92,6 +92,10 @@ lift ( ); +phaseTransfer +( +); + wallLubrication ( ); diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water index 90b537bf7b6aae3b3b6ecceb1c035ade54cc48ab..c2ae043df338f4b8c9003b1dfc16b72df36d415d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture pureMixture; transport const; - thermo hConst; + thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; @@ -39,7 +39,7 @@ mixture } thermodynamics { - Cp 4195; + Cv 4195; Hf 0; } transport