mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merged reactingParcelFilmFoam into reactingParcelFoam
The combined solver includes the most advanced and general functionality from
each solver including:
Continuous phase
Lagrangian multiphase parcels
Optional film
Continuous and Lagrangian phase reactions
Radiation
Strong buoyancy force support by solving for p_rgh
The reactingParcelFoam and reactingParcelFilmFoam tutorials have been combined
and updated.
This commit is contained in:
committed by
Andrew Heather
parent
5cb3bb7bc6
commit
791e1ca2d2
@ -1,4 +1,4 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
filmModelType& surfaceFilm = tsurfaceFilm();
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
Info<< "\nConstructing surface film model" << endl;
|
||||
|
||||
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
||||
|
||||
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
||||
autoPtr<regionModels::surfaceFilmModel> tsurfaceFilm
|
||||
(
|
||||
regionModels::surfaceFilmModel::New(mesh, g)
|
||||
);
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
reactingParcelFilmFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/reactingParcelFilmFoam
|
||||
@ -1,47 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I. \
|
||||
-I../reactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/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/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lSLGThermo \
|
||||
-lchemistryModel \
|
||||
-lregionModels \
|
||||
-lradiationModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lsurfaceFilmDerivedFvPatchFields \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
-lODE \
|
||||
-lcombustionModels
|
||||
@ -1,34 +0,0 @@
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
parcels.SU(U)
|
||||
+ fvOptions(rho, U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
Info<< "\nConstructing reacting cloud" << endl;
|
||||
basicReactingCloud parcels
|
||||
(
|
||||
"reactingCloud1",
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
slgThermo
|
||||
);
|
||||
@ -1,143 +0,0 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> combustion
|
||||
(
|
||||
combustionModels::psiCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
psiReactionThermo& thermo = combustion->thermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
Info<< "Creating field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
#include "gh.H"
|
||||
|
||||
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Force p_rgh to be consistent with p
|
||||
p_rgh = p - rho*gh;
|
||||
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(thermo.he());
|
||||
|
||||
IOdictionary additionalControlsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"additionalControls",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
Switch solvePrimaryRegion
|
||||
(
|
||||
additionalControlsDict.lookup("solvePrimaryRegion")
|
||||
);
|
||||
|
||||
volScalarField Qdot
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Qdot",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
|
||||
);
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createClouds.H"
|
||||
#include "createRadiationModel.H"
|
||||
#include "createSurfaceFilmModel.H"
|
||||
@ -1,5 +0,0 @@
|
||||
Info<< "\nConstructing surface film model" << endl;
|
||||
|
||||
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
||||
|
||||
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
||||
@ -1,59 +0,0 @@
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
+ phig
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvc::ddt(psi, rho)*gh
|
||||
+ fvc::div(phiHbyA)
|
||||
+ fvm::ddt(psi, p_rgh)
|
||||
- fvm::laplacian(rhorAUf, p_rgh)
|
||||
==
|
||||
parcels.Srho()
|
||||
+ surfaceFilm.Srho()
|
||||
+ fvOptions(psi, p_rgh, rho.name())
|
||||
);
|
||||
|
||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA + p_rghEqn.flux();
|
||||
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
p = p_rgh + rho*gh;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
reactingParcelFilmFoam
|
||||
|
||||
Group
|
||||
grpLagrangianSolvers
|
||||
|
||||
Description
|
||||
Transient solver for compressible, turbulent flow with a reacting,
|
||||
multiphase particle cloud, and surface film modelling.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicReactingCloud.H"
|
||||
#include "surfaceFilmModel.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "fvOptions.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (!LTS)
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setMultiRegionDeltaT.H"
|
||||
#include "setDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
parcels.evolve();
|
||||
surfaceFilm.evolve();
|
||||
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
|
||||
if (solvePrimaryRegion)
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- PIMPLE loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,48 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
rhoEqn
|
||||
|
||||
Description
|
||||
Solve the continuity for density.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
{
|
||||
fvScalarMatrix rhoEqn
|
||||
(
|
||||
fvm::ddt(rho)
|
||||
+ fvc::div(phi)
|
||||
==
|
||||
parcels.Srho(rho)
|
||||
+ surfaceFilm.Srho()
|
||||
+ fvOptions(rho)
|
||||
);
|
||||
|
||||
rhoEqn.solve();
|
||||
|
||||
fvOptions.correct(rho);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -19,6 +19,7 @@
|
||||
==
|
||||
rho*(U&g)
|
||||
+ parcels.Sh(he)
|
||||
+ surfaceFilm.Sh()
|
||||
+ radiation->Sh(thermo, he)
|
||||
+ Qdot
|
||||
+ fvOptions(rho, he)
|
||||
@ -35,6 +36,6 @@
|
||||
thermo.correct();
|
||||
radiation->correct();
|
||||
|
||||
Info<< "T gas min/max " << min(T).value() << ", "
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I. \
|
||||
-I../reactingParcelFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I${LIB_SRC}/sampling/lnInclude \
|
||||
-I${LIB_SRC}/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
@ -17,33 +16,33 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
-lspecie \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lthermophysicalProperties \
|
||||
-lreactionThermophysicalModels \
|
||||
-lSLGThermo \
|
||||
-lchemistryModel \
|
||||
-lradiationModels \
|
||||
-lODE \
|
||||
-lregionModels \
|
||||
-lradiationModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lcombustionModels \
|
||||
-lfvOptions \
|
||||
-lsampling
|
||||
-lsurfaceFilmDerivedFvPatchFields \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-llagrangianTurbulence \
|
||||
-lODE \
|
||||
-lcombustionModels
|
||||
|
||||
@ -6,8 +6,7 @@
|
||||
+ MRF.DDt(rho, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
rho()*g
|
||||
+ parcels.SU(U)
|
||||
parcels.SU(U)
|
||||
+ fvOptions(rho, U)
|
||||
);
|
||||
|
||||
@ -17,7 +16,18 @@
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
@ -9,6 +9,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
Qdot = combustion->Qdot();
|
||||
@ -24,11 +25,12 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||
==
|
||||
- fvm::laplacian(turbulence->alphaEff(), Yi)
|
||||
==
|
||||
parcels.SYi(i, Yi)
|
||||
+ combustion->R(Yi)
|
||||
+ fvOptions(rho, Yi)
|
||||
+ combustion->R(Yi)
|
||||
+ surfaceFilm.Srho(i)
|
||||
);
|
||||
|
||||
YEqn.relax();
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||
@ -26,8 +24,7 @@ if (!composition.species().found(inertSpecie))
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "Creating field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
@ -41,6 +38,8 @@ volScalarField rho
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
@ -57,30 +56,6 @@ volVectorField U
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
dimensionedScalar rhoMax
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMax",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
GREAT
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar rhoMin
|
||||
(
|
||||
dimensionedScalar::lookupOrDefault
|
||||
(
|
||||
"rhoMin",
|
||||
pimple.dict(),
|
||||
dimDensity,
|
||||
0
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
@ -96,6 +71,31 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
#include "gh.H"
|
||||
|
||||
|
||||
volScalarField p_rgh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p_rgh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Force p_rgh to be consistent with p
|
||||
p_rgh = p - rho*gh;
|
||||
|
||||
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||
|
||||
mesh.setFluxRequired(p_rgh.name());
|
||||
|
||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
@ -105,6 +105,11 @@ forAll(Y, i)
|
||||
}
|
||||
fields.add(thermo.he());
|
||||
|
||||
Switch solvePrimaryRegion
|
||||
(
|
||||
pimple.dict().lookupOrDefault<Switch>("solvePrimaryRegion", true)
|
||||
);
|
||||
|
||||
volScalarField Qdot
|
||||
(
|
||||
IOobject
|
||||
@ -126,3 +131,4 @@ volScalarField Qdot
|
||||
#include "createMRF.H"
|
||||
#include "createRadiationModel.H"
|
||||
#include "createClouds.H"
|
||||
#include "createSurfaceFilmModel.H"
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
Info<< "\nConstructing surface film model" << endl;
|
||||
|
||||
autoPtr<regionModels::surfaceFilmModel> tsurfaceFilm
|
||||
(
|
||||
regionModels::surfaceFilmModel::New(mesh, g)
|
||||
);
|
||||
@ -1,4 +1,7 @@
|
||||
rho = thermo.rho();
|
||||
if (!pimple.SIMPLErho())
|
||||
{
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||
// pressure solution
|
||||
@ -7,6 +10,9 @@ const volScalarField psip0(psi*p);
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
@ -14,58 +20,68 @@ surfaceScalarField phiHbyA
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
+ phig
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
fvScalarMatrix pDDtEqn
|
||||
fvScalarMatrix p_rghDDtEqn
|
||||
(
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||
+ fvc::div(phiHbyA)
|
||||
==
|
||||
parcels.Srho()
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
+ surfaceFilm.Srho()
|
||||
+ fvOptions(psi, p_rgh, rho.name())
|
||||
);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
pDDtEqn
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
p_rghDDtEqn
|
||||
- fvm::laplacian(rhorAUf, p_rgh)
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA + pEqn.flux();
|
||||
phi = phiHbyA + p_rghEqn.flux();
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p_rgh.relax();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
}
|
||||
}
|
||||
|
||||
p.relax();
|
||||
p = p_rgh + rho*gh;
|
||||
|
||||
// Thermodynamic density update
|
||||
thermo.correctRho(psi*p - psip0);
|
||||
|
||||
#include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
if (pressureControl.limit(p))
|
||||
{
|
||||
p.correctBoundaryConditions();
|
||||
rho = thermo.rho();
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
else if (pimple.SIMPLErho())
|
||||
{
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p);
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
|
||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,18 +29,20 @@ Group
|
||||
|
||||
Description
|
||||
Transient solver for compressible, turbulent flow with a reacting,
|
||||
multiphase particle cloud, and optional sources/constraints.
|
||||
multiphase particle cloud, and surface film modelling.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicReactingMultiphaseCloud.H"
|
||||
#include "surfaceFilmModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "fvOptions.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "fvOptions.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "fvcSmooth.H"
|
||||
|
||||
@ -76,10 +78,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
|
||||
if (!LTS)
|
||||
if (LTS)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
#include "setMultiRegionDeltaT.H"
|
||||
}
|
||||
|
||||
runTime++;
|
||||
@ -87,34 +93,36 @@ int main(int argc, char *argv[])
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
parcels.evolve();
|
||||
surfaceFilm.evolve();
|
||||
|
||||
if (LTS)
|
||||
if (solvePrimaryRegion)
|
||||
{
|
||||
#include "setRDeltaT.H"
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
if (pimple.nCorrPIMPLE() <= 1)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
// --- PIMPLE loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
rho = thermo.rho();
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
@ -123,7 +131,7 @@ int main(int argc, char *argv[])
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
Info<< "End" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,15 +36,13 @@ Description
|
||||
+ fvc::div(phi)
|
||||
==
|
||||
parcels.Srho(rho)
|
||||
+ surfaceFilm.Srho()
|
||||
+ fvOptions(rho)
|
||||
);
|
||||
|
||||
rhoEqn.solve();
|
||||
|
||||
fvOptions.correct(rho);
|
||||
|
||||
Info<< "rho min/max = " << min(rho).value() << ", " << max(rho).value()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,25 +33,21 @@ Description
|
||||
|
||||
if (adjustTimeStep)
|
||||
{
|
||||
if (CoNum == -GREAT)
|
||||
{
|
||||
CoNum = SMALL;
|
||||
}
|
||||
|
||||
const scalar TFactorFluid = maxCo/(CoNum + SMALL);
|
||||
const scalar TFactorFilm = maxCo/(surfaceFilm.CourantNumber() + SMALL);
|
||||
|
||||
const scalar dt0 = runTime.deltaTValue();
|
||||
const scalar maxDeltaTFact =
|
||||
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
|
||||
const scalar deltaTFact =
|
||||
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
|
||||
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
(
|
||||
dt0*min(min(TFactorFluid, TFactorFilm), 1.2),
|
||||
deltaTFact*runTime.deltaTValue(),
|
||||
maxDeltaT
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,9 +24,6 @@ License
|
||||
Application
|
||||
simpleReactingParcelFoam
|
||||
|
||||
Group
|
||||
grpLagrangianSolvers
|
||||
|
||||
Description
|
||||
Steady state solver for compressible, turbulent flow with reacting,
|
||||
multiphase particle clouds and optional sources/constraints.
|
||||
@ -38,6 +35,7 @@ Description
|
||||
#include "basicReactingMultiphaseCloud.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "IOporosityModelList.H"
|
||||
#include "fvOptions.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
==
|
||||
rho*(U&g)
|
||||
+ parcels.Sh(he)
|
||||
+ surfaceFilm.Sh()
|
||||
+ radiation->Sh(thermo, he)
|
||||
+ Qdot
|
||||
+ fvOptions(rho, he)
|
||||
@ -36,6 +35,6 @@
|
||||
thermo.correct();
|
||||
radiation->correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
Info<< "T gas min/max " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
@ -9,7 +9,6 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
Qdot = combustion->Qdot();
|
||||
@ -25,12 +24,11 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(turbulence->alphaEff(), Yi)
|
||||
==
|
||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||
==
|
||||
parcels.SYi(i, Yi)
|
||||
+ fvOptions(rho, Yi)
|
||||
+ combustion->R(Yi)
|
||||
+ surfaceFilm.Srho(i)
|
||||
+ fvOptions(rho, Yi)
|
||||
);
|
||||
|
||||
YEqn.relax();
|
||||
@ -1,5 +1,3 @@
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
filmModelType& surfaceFilm = tsurfaceFilm();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
@ -45,7 +45,7 @@ addToRunTimeSelectionTable(transferModel, VoFPatchTransfer, dictionary);
|
||||
|
||||
VoFPatchTransfer::VoFPatchTransfer
|
||||
(
|
||||
surfaceFilmModel& film,
|
||||
surfaceFilmRegionModel& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
VoFPatchTransfer(surfaceFilmModel& film, const dictionary& dict);
|
||||
VoFPatchTransfer(surfaceFilmRegionModel& film, const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
||||
const volScalarField& psi1 = mixture.thermo1().psi();
|
||||
const volScalarField& psi2 = mixture.thermo2().psi();
|
||||
|
||||
filmModelType& surfaceFilm = tsurfaceFilm();
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
Info<< "\nConstructing surface film model" << endl;
|
||||
|
||||
typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType;
|
||||
|
||||
SLGThermo slgThermo(mesh, mixture.thermo1());
|
||||
autoPtr<filmModelType> tsurfaceFilm(filmModelType::New(mesh, g));
|
||||
autoPtr<regionModels::surfaceFilmModel> tsurfaceFilm
|
||||
(
|
||||
regionModels::surfaceFilmModel::New(mesh, g)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user