mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: combustionModels: Changed the construction order
The combustion and chemistry models no longer select and own the
thermodynamic model; they hold a reference instead. The construction of
the combustion and chemistry models has been changed to require a
reference to the thermodyanmics, rather than the mesh and a phase name.
At the solver-level the thermo, turbulence and combustion models are now
selected in sequence. The cyclic dependency between the three models has
been resolved, and the raw-pointer based post-construction step for the
combustion model has been removed.
The old solver-level construction sequence (typically in createFields.H)
was as follows:
autoPtr<combustionModels::psiCombustionModel> combustion
(
combustionModels::psiCombustionModel::New(mesh)
);
psiReactionThermo& thermo = combustion->thermo();
// Create rho, U, phi, etc...
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New(rho, U, phi, thermo)
);
combustion->setTurbulence(*turbulence);
The new sequence is:
autoPtr<psiReactionThermo> thermo(psiReactionThermo::New(mesh));
// Create rho, U, phi, etc...
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New(rho, U, phi, *thermo)
);
autoPtr<combustionModels::psiCombustionModel> combustion
(
combustionModels::psiCombustionModel::New(*thermo, *turbulence)
);
ENH: combustionModel, chemistryModel: Simplified model selection
The combustion and chemistry model selection has been simplified so
that the user does not have to specify the form of the thermodynamics.
Examples of new combustion and chemistry entries are as follows:
In constant/combustionProperties:
combustionModel PaSR;
combustionModel FSD;
In constant/chemistryProperties:
chemistryType
{
solver ode;
method TDAC;
}
All the angle bracket parts of the model names (e.g.,
<psiThermoCombustion,gasHThermoPhysics>) have been removed as well as
the chemistryThermo entry.
The changes are mostly backward compatible. Only support for the
angle bracket form of chemistry solver names has been removed. Warnings
will print if some of the old entries are used, as the parts relating to
thermodynamics are now ignored.
ENH: combustionModel, chemistryModel: Simplified model selection
Updated all tutorials to the new format
STYLE: combustionModel: Namespace changes
Wrapped combustion model make macros in the Foam namespace and removed
combustion model namespace from the base classes. This fixes a namespace
specialisation bug in gcc 4.8. It is also somewhat less verbose in the
solvers.
This resolves bug report https://bugs.openfoam.org/view.php?id=2787
ENH: combustionModels: Default to the "none" model
When the constant/combustionProperties dictionary is missing, the solver
will now default to the "none" model. This is consistent with how
radiation models are selected.
This commit is contained in:
committed by
Andrew Heather
parent
255ec7366b
commit
22aae2816d
@ -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
|
||||
@ -37,7 +37,8 @@ Description
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "psiChemistryModel.H"
|
||||
#include "BasicChemistryModel.H"
|
||||
#include "reactingMixture.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "OFstream.H"
|
||||
#include "thermoPhysicsTypes.H"
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
|
||||
BasicChemistryModel<psiReactionThermo>& chemistry = pChemistry();
|
||||
scalar dtChem = refCast<const BasicChemistryModel<psiReactionThermo>>
|
||||
(
|
||||
chemistry
|
||||
).deltaTChem()[0];
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
@ -23,14 +23,16 @@
|
||||
|
||||
#include "createBaseFields.H"
|
||||
|
||||
Info<< nl << "Reading thermophysicalProperties" << endl;
|
||||
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
|
||||
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
|
||||
psiReactionThermo& thermo = chemistry.thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h");
|
||||
|
||||
autoPtr<BasicChemistryModel<psiReactionThermo>> pChemistry
|
||||
(
|
||||
BasicChemistryModel<psiReactionThermo>::New(thermo)
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -1,16 +1,6 @@
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> combustion
|
||||
(
|
||||
combustionModels::psiCombustionModel::New
|
||||
(
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
psiReactionThermo& thermo = combustion->thermo();
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
@ -74,8 +64,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<psiReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<psiReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
@ -41,7 +41,8 @@ Description
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "solidChemistryModel.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> reaction
|
||||
(
|
||||
combustionModels::psiCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
psiReactionThermo& thermo = reaction->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
@ -18,8 +13,7 @@ if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo)
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
<< composition.species() << exit(FatalIOError);
|
||||
}
|
||||
|
||||
volScalarField rho
|
||||
@ -47,7 +41,6 @@ volVectorField U
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
@ -68,8 +61,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the reaction model
|
||||
reaction->setTurbulence(turbulence());
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
autoPtr<CombustionModel<psiReactionThermo>> reaction
|
||||
(
|
||||
CombustionModel<psiReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
|
||||
@ -34,7 +34,8 @@ Description
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "pressureControl.H"
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> reaction
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
rhoReactionThermo& thermo = reaction->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
@ -67,9 +62,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the reaction model
|
||||
reaction->setTurbulence(turbulence());
|
||||
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> reaction
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
|
||||
@ -34,7 +34,8 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> reaction
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
rhoReactionThermo& thermo = reaction->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
@ -69,8 +64,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the reaction model
|
||||
reaction->setTurbulence(turbulence());
|
||||
Info<< "Creating reaction model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> reaction
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
|
||||
@ -34,7 +34,8 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "multivariateScheme.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -37,7 +37,8 @@ Description
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicThermoCloud.H"
|
||||
#include "coalCloud.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "fvOptions.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
|
||||
@ -2,14 +2,9 @@
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> combustion
|
||||
(
|
||||
combustionModels::psiCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
psiReactionThermo& thermo = combustion->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
@ -112,8 +107,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<psiReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<psiReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
volScalarField Qdot
|
||||
(
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "createRDeltaT.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
rhoReactionThermo& thermo = combustion->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
@ -68,8 +63,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "readhRef.H"
|
||||
|
||||
@ -37,7 +37,8 @@ Description
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicReactingMultiphaseCloud.H"
|
||||
#include "surfaceFilmModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||
(
|
||||
combustionModels::rhoCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
rhoReactionThermo& thermo = combustion->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<rhoReactionThermo> pThermo(rhoReactionThermo::New(mesh));
|
||||
rhoReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
@ -91,8 +86,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<rhoReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
@ -33,7 +33,8 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicReactingMultiphaseCloud.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "IOporosityModelList.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
#include "readGravitationalAcceleration.H"
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
|
||||
autoPtr<combustionModels::psiCombustionModel> combustion
|
||||
(
|
||||
combustionModels::psiCombustionModel::New(mesh)
|
||||
);
|
||||
|
||||
psiReactionThermo& thermo = combustion->thermo();
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
@ -91,8 +86,11 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
// Set the turbulence into the combustion model
|
||||
combustion->setTurbulence(turbulence());
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<CombustionModel<psiReactionThermo>> combustion
|
||||
(
|
||||
CombustionModel<psiReactionThermo>::New(thermo, turbulence())
|
||||
);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
|
||||
@ -35,7 +35,8 @@ Description
|
||||
#include "engineMesh.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicSprayCloud.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -37,7 +37,8 @@ Description
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "basicSprayCloud.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -36,7 +36,8 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "basicSprayCloud.H"
|
||||
#include "psiCombustionModel.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "CombustionModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "SLGThermo.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
@ -98,6 +98,12 @@ void Foam::twoPhaseMixtureThermo::correct()
|
||||
}
|
||||
|
||||
|
||||
Foam::word Foam::twoPhaseMixtureThermo::thermoName() const
|
||||
{
|
||||
return thermo1_->thermoName() + ',' + thermo2_->thermoName();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::twoPhaseMixtureThermo::incompressible() const
|
||||
{
|
||||
return thermo1_->incompressible() && thermo2_->incompressible();
|
||||
|
||||
@ -113,6 +113,9 @@ public:
|
||||
//- Update mixture properties
|
||||
virtual void correct();
|
||||
|
||||
//- Return the name of the thermo physics
|
||||
virtual word thermoName() const;
|
||||
|
||||
//- Return true if the equation of state is incompressible
|
||||
// i.e. rho != f(p)
|
||||
virtual bool incompressible() const;
|
||||
|
||||
@ -150,6 +150,21 @@ void Foam::multiphaseMixtureThermo::correctRho(const volScalarField& dp)
|
||||
}
|
||||
|
||||
|
||||
Foam::word Foam::multiphaseMixtureThermo::thermoName() const
|
||||
{
|
||||
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
|
||||
|
||||
word name = phasei().thermo().thermoName();
|
||||
|
||||
for (++ phasei; phasei != phases_.end(); ++ phasei)
|
||||
{
|
||||
name += ',' + phasei().thermo().thermoName();
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::multiphaseMixtureThermo::incompressible() const
|
||||
{
|
||||
bool ico = true;
|
||||
|
||||
@ -227,6 +227,9 @@ public:
|
||||
//- Update densities for given pressure change
|
||||
void correctRho(const volScalarField& dp);
|
||||
|
||||
//- Return the name of the thermo physics
|
||||
virtual word thermoName() const;
|
||||
|
||||
//- Return true if the equation of state is incompressible
|
||||
// i.e. rho != f(p)
|
||||
virtual bool incompressible() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,7 +63,9 @@ class MovingPhaseModel
|
||||
:
|
||||
public BasePhaseModel
|
||||
{
|
||||
// Private data
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Velocity field
|
||||
volVectorField U_;
|
||||
@ -94,6 +96,8 @@ class MovingPhaseModel
|
||||
tmp<surfaceScalarField> DbyA_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private static member functions
|
||||
|
||||
//- Calculate and return the flux field
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,26 +37,9 @@ Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::ReactingPhaseModel
|
||||
const label index
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName, index, false),
|
||||
reaction_
|
||||
(
|
||||
ReactionType::New
|
||||
(
|
||||
fluid.mesh(),
|
||||
combustionModel::combustionPropertiesName,
|
||||
this->name()
|
||||
)
|
||||
)
|
||||
{
|
||||
this->thermo_ = &reaction_->thermo();
|
||||
|
||||
this->thermo_->validate
|
||||
(
|
||||
IOobject::groupName(phaseModel::typeName, this->name()),
|
||||
"h",
|
||||
"e"
|
||||
);
|
||||
}
|
||||
BasePhaseModel(fluid, phaseName, index),
|
||||
reaction_(ReactionType::New(this->thermo_(), this->turbulence_()))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -71,21 +54,6 @@ Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::~ReactingPhaseModel()
|
||||
template<class BasePhaseModel, class ReactionType>
|
||||
void Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::correctThermo()
|
||||
{
|
||||
reaction_->setTurbulence
|
||||
(
|
||||
const_cast<compressibleTurbulenceModel&>
|
||||
(
|
||||
this->mesh().template lookupObject<compressibleTurbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
this->name()
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
BasePhaseModel::correctThermo();
|
||||
|
||||
reaction_->correct();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,28 +41,18 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::ThermoPhaseModel
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName,
|
||||
const label index,
|
||||
const bool createThermo
|
||||
const label index
|
||||
)
|
||||
:
|
||||
BasePhaseModel(fluid, phaseName, index)
|
||||
BasePhaseModel(fluid, phaseName, index),
|
||||
thermo_(ThermoType::New(fluid.mesh(), this->name()))
|
||||
{
|
||||
if (createThermo)
|
||||
{
|
||||
thermoPtr_.reset
|
||||
(
|
||||
ThermoType::New(fluid.mesh(), this->name()).ptr()
|
||||
);
|
||||
|
||||
thermo_ = thermoPtr_.ptr();
|
||||
|
||||
thermo_->validate
|
||||
(
|
||||
IOobject::groupName(phaseModel::typeName, this->name()),
|
||||
"h",
|
||||
"e"
|
||||
);
|
||||
}
|
||||
thermo_->validate
|
||||
(
|
||||
IOobject::groupName(phaseModel::typeName, this->name()),
|
||||
"h",
|
||||
"e"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +69,7 @@ template<class BasePhaseModel, class ThermoType>
|
||||
const Foam::rhoThermo&
|
||||
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermo() const
|
||||
{
|
||||
return *thermo_;
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +77,7 @@ template<class BasePhaseModel, class ThermoType>
|
||||
Foam::rhoThermo&
|
||||
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::thermo()
|
||||
{
|
||||
return *thermo_;
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,10 +62,7 @@ protected:
|
||||
// Protected data
|
||||
|
||||
//- Thermophysical model
|
||||
autoPtr<ThermoType> thermoPtr_;
|
||||
|
||||
//- Thermophysical model
|
||||
ThermoType* thermo_;
|
||||
autoPtr<ThermoType> thermo_;
|
||||
|
||||
|
||||
public:
|
||||
@ -76,8 +73,7 @@ public:
|
||||
(
|
||||
const phaseSystem& fluid,
|
||||
const word& phaseName,
|
||||
const label index,
|
||||
const bool createThermo = true
|
||||
const label index
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,7 +28,7 @@ License
|
||||
#include "rhoThermo.H"
|
||||
#include "rhoReactionThermo.H"
|
||||
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "CombustionModel.H"
|
||||
|
||||
#include "phaseModel.H"
|
||||
#include "ThermoPhaseModel.H"
|
||||
@ -45,13 +45,13 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
typedef
|
||||
MovingPhaseModel
|
||||
AnisothermalPhaseModel
|
||||
<
|
||||
AnisothermalPhaseModel
|
||||
PurePhaseModel
|
||||
<
|
||||
PurePhaseModel
|
||||
InertPhaseModel
|
||||
<
|
||||
InertPhaseModel
|
||||
MovingPhaseModel
|
||||
<
|
||||
ThermoPhaseModel<phaseModel, rhoThermo>
|
||||
>
|
||||
@ -69,13 +69,13 @@ namespace Foam
|
||||
);
|
||||
|
||||
typedef
|
||||
MovingPhaseModel
|
||||
IsothermalPhaseModel
|
||||
<
|
||||
IsothermalPhaseModel
|
||||
PurePhaseModel
|
||||
<
|
||||
PurePhaseModel
|
||||
InertPhaseModel
|
||||
<
|
||||
InertPhaseModel
|
||||
MovingPhaseModel
|
||||
<
|
||||
ThermoPhaseModel<phaseModel, rhoThermo>
|
||||
>
|
||||
@ -93,13 +93,13 @@ namespace Foam
|
||||
);
|
||||
|
||||
typedef
|
||||
MovingPhaseModel
|
||||
AnisothermalPhaseModel
|
||||
<
|
||||
AnisothermalPhaseModel
|
||||
MultiComponentPhaseModel
|
||||
<
|
||||
MultiComponentPhaseModel
|
||||
InertPhaseModel
|
||||
<
|
||||
InertPhaseModel
|
||||
MovingPhaseModel
|
||||
<
|
||||
ThermoPhaseModel<phaseModel, rhoReactionThermo>
|
||||
>
|
||||
@ -117,17 +117,17 @@ namespace Foam
|
||||
);
|
||||
|
||||
typedef
|
||||
MovingPhaseModel
|
||||
AnisothermalPhaseModel
|
||||
<
|
||||
AnisothermalPhaseModel
|
||||
MultiComponentPhaseModel
|
||||
<
|
||||
MultiComponentPhaseModel
|
||||
ReactingPhaseModel
|
||||
<
|
||||
ReactingPhaseModel
|
||||
MovingPhaseModel
|
||||
<
|
||||
ThermoPhaseModel<phaseModel, rhoReactionThermo>,
|
||||
combustionModels::rhoCombustionModel
|
||||
>
|
||||
ThermoPhaseModel<phaseModel, rhoReactionThermo>
|
||||
>,
|
||||
CombustionModel<rhoReactionThermo>
|
||||
>
|
||||
>
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user