INT: Additional integration updates/clean-up

This commit is contained in:
Andrew Heather
2018-05-14 13:21:22 +01:00
parent 2d238139b3
commit dcad66f7d3
32 changed files with 186 additions and 144 deletions

View File

@ -10,8 +10,8 @@ tmp<fv::convectionScheme<scalar>> mvConvection
);
{
combustion->correct();
Qdot = combustion->Qdot();
reaction->correct();
Qdot = reaction->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
@ -26,7 +26,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
- fvm::laplacian(turbulence->muEff(), Yi)
==
parcels.SYi(i, Yi)
+ combustion->R(Yi)
+ reaction->R(Yi)
+ fvOptions(rho, Yi)
);

View File

@ -1,13 +1,9 @@
#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 +87,11 @@ autoPtr<compressible::turbulenceModel> turbulence
)
);
// Set the turbulence into the combustion model
combustion->setTurbulence(turbulence());
Info<< "Creating reaction model\n" << endl;
autoPtr<CombustionModel<rhoReactionThermo>> reaction
(
CombustionModel<rhoReactionThermo>::New(thermo, turbulence())
);
Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;

View File

@ -36,7 +36,8 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "coalCloud.H"
#include "rhoCombustionModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvOptions.H"

View File

@ -0,0 +1,11 @@
Info<< "Total cylinder mass: " << fvc::domainIntegrate(rho).value() << endl;
//Info<< "Total fuel mass: "
// << fvc::domainIntegrate(rho*compostion.ft()).value() << endl;
OFstream logSummaryFile
(
runTime.path()/("logSummary." + runTime.timeName() + ".dat")
);
logSummaryFile
<< "# CA" << " p" << " T" << " u'" << endl;

View File

@ -147,6 +147,13 @@ void Foam::twoPhaseMixtureEThermo::correct()
}
Foam::word Foam::twoPhaseMixtureEThermo::thermoName() const
{
NotImplemented;
return word::null;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::he
(
const volScalarField& p,

View File

@ -278,6 +278,9 @@ public:
//- Correct the thermo fields
virtual void correct();
//- Return the name of the thermo physics
virtual word thermoName() const;
//- Read properties
virtual bool read();

View File

@ -35,15 +35,12 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
{
IOobject combIO
(
IOobject
(
thermo.phasePropertyName(combustionProperties),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
thermo.phasePropertyName(combustionProperties),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
word combModelName("none");
@ -83,13 +80,11 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
combModelName + '<' + CombustionModel::reactionThermo::typeName + ','
+ thermo.thermoName() + '>';
typename cstrTableType::iterator compCstrIter =
cstrTable->find(compCombModelName);
auto compCstrIter = cstrTable->cfind(compCombModelName);
typename cstrTableType::iterator thermoCstrIter =
cstrTable->find(thermoCombModelName);
auto thermoCstrIter = cstrTable->cfind(thermoCombModelName);
if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end())
if (!compCstrIter.found() && !thermoCstrIter.found())
{
FatalErrorInFunction
<< "Unknown " << combustionModel::typeName << " type "
@ -170,7 +165,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
return autoPtr<CombustionModel>
(
thermoCstrIter != cstrTable->end()
thermoCstrIter.found()
? thermoCstrIter()(combModelName, thermo, turb, combustionProperties)
: compCstrIter()(combModelName, thermo, turb, combustionProperties)
);

View File

@ -31,9 +31,9 @@ License
// * * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
void Foam::combustionModels::
diffusionMulticomponent<CombThermoType, ThermoType>::init()
diffusionMulticomponent<ReactionThermo, ThermoType>::init()
{
// Load default values
this->coeffs().readIfPresent("Ci", Ci_);
@ -121,25 +121,31 @@ diffusionMulticomponent<CombThermoType, ThermoType>::init()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::
template<class ReactionThermo, class ThermoType>
Foam::combustionModels::diffusionMulticomponent<ReactionThermo, ThermoType>::
diffusionMulticomponent
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
CombThermoType(modelType, mesh, combustionProperties, phaseName),
ChemistryCombustion<ReactionThermo>
(
modelType,
thermo,
turb,
combustionProperties
),
reactions_
(
dynamic_cast<const reactingMixture<ThermoType>&>(this->thermo())
dynamic_cast<const reactingMixture<ThermoType>&>(thermo)
),
specieThermo_
(
dynamic_cast<const reactingMixture<ThermoType>&>
(this->thermo()).speciesData()
dynamic_cast<const reactingMixture<ThermoType>&>(thermo).
speciesData()
),
RijPtr_(reactions_.size()),
Ci_(reactions_.size(), 1.0),
@ -162,17 +168,17 @@ diffusionMulticomponent
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField> Foam::combustionModels::
diffusionMulticomponent<CombThermoType, ThermoType>::tc() const
diffusionMulticomponent<ReactionThermo, ThermoType>::tc() const
{
return this->chemistryPtr_->tc();
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
void Foam::combustionModels::
diffusionMulticomponent<CombThermoType, ThermoType>::correct()
diffusionMulticomponent<ReactionThermo, ThermoType>::correct()
{
if (this->active())
{
@ -359,9 +365,9 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::R
Foam::combustionModels::diffusionMulticomponent<ReactionThermo, ThermoType>::R
(
volScalarField& Y
) const
@ -382,10 +388,10 @@ Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::R
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::
Qdot() const
Foam::combustionModels::
diffusionMulticomponent<ReactionThermo, ThermoType>::Qdot() const
{
tmp<volScalarField> tQdot
(
@ -416,11 +422,11 @@ Qdot() const
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
bool Foam::combustionModels::
diffusionMulticomponent<CombThermoType, ThermoType>::read()
diffusionMulticomponent<ReactionThermo, ThermoType>::read()
{
if (CombThermoType::read())
if (ChemistryCombustion<ReactionThermo>::read())
{
this->coeffs().readIfPresent("Ci", Ci_);
this->coeffs().readIfPresent("sigma", sigma_);

View File

@ -72,6 +72,7 @@ SourceFiles
#ifndef diffusionMulticomponent_H
#define diffusionMulticomponent_H
#include "ChemistryCombustion.H"
#include "scalarList.H"
#include "tmp.H"
#include "Reaction.H"
@ -87,10 +88,10 @@ namespace combustionModels
Class diffusionMulticomponent Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class diffusionMulticomponent
:
public CombThermoType
public ChemistryCombustion<ReactionThermo>
{
// Private data
@ -170,9 +171,9 @@ public:
diffusionMulticomponent
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -25,37 +25,45 @@ License
#include "makeCombustionTypes.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "thermoPhysicsTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "diffusionMulticomponent.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Combustion models based on sensibleEnthalpy
namespace Foam
{
makeCombustionTypesThermo
(
diffusionMulticomponent,
psiChemistryCombustion,
gasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusionMulticomponent,
rhoChemistryCombustion,
gasHThermoPhysics,
rhoCombustionModel
psiReactionThermo,
constGasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusionMulticomponent,
rhoChemistryCombustion,
incompressibleGasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusionMulticomponent,
rhoReactionThermo,
constGasHThermoPhysics
);
}
// ************************************************************************* //

View File

@ -31,22 +31,22 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
template<class ReactionThermo, class ThermoType>
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::
eddyDissipationDiffusionModel
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
eddyDissipationModelBase<CombThermoType, ThermoType>
eddyDissipationModelBase<ReactionThermo, ThermoType>
(
modelType,
mesh,
combustionProperties,
phaseName
thermo,
turb,
combustionProperties
),
Cd_(readScalar(this->coeffs().lookup("Cd")))
{}
@ -54,8 +54,8 @@ eddyDissipationDiffusionModel
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
template<class ReactionThermo, class ThermoType>
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::
~eddyDissipationDiffusionModel()
{}
@ -63,17 +63,17 @@ eddyDissipationDiffusionModel<CombThermoType, ThermoType>::
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::timeScale()
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::timeScale()
{
return (max(this->rtTurb(), this->rtDiff()));
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
eddyDissipationDiffusionModel<CombThermoType, ThermoType>::rtDiff() const
eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::rtDiff() const
{
tmp<volScalarField> tdelta
(
@ -102,10 +102,10 @@ eddyDissipationDiffusionModel<CombThermoType, ThermoType>::rtDiff() const
}
template<class CombThermoType, class ThermoType>
bool eddyDissipationDiffusionModel<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::read()
{
if (eddyDissipationModelBase<CombThermoType, ThermoType>::read())
if (eddyDissipationModelBase<ReactionThermo, ThermoType>::read())
{
this->coeffs().lookup("Cd") >> Cd_;
return true;

View File

@ -55,10 +55,10 @@ namespace combustionModels
Class eddyDissipationDiffusionModel Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class eddyDissipationDiffusionModel
:
public eddyDissipationModelBase<CombThermoType, ThermoType>
public eddyDissipationModelBase<ReactionThermo, ThermoType>
{
// Private data
@ -87,9 +87,9 @@ public:
eddyDissipationDiffusionModel
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -26,8 +26,8 @@ License
#include "makeCombustionTypes.H"
#include "thermoPhysicsTypes.H"
#include "psiThermoCombustion.H"
#include "rhoThermoCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "eddyDissipationDiffusionModel.H"
#include "eddyDissipationModelBase.H"
@ -35,37 +35,37 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeCombustionTypesThermo
(
eddyDissipationDiffusionModel,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
eddyDissipationDiffusionModel,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasHThermoPhysics
);
makeCombustionTypesThermo
(
eddyDissipationDiffusionModel,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
eddyDissipationDiffusionModel,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasHThermoPhysics
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -32,21 +32,21 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
eddyDissipationModelBase<CombThermoType, ThermoType>::eddyDissipationModelBase
template<class ReactionThermo, class ThermoType>
eddyDissipationModelBase<ReactionThermo, ThermoType>::eddyDissipationModelBase
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
singleStepCombustion<CombThermoType, ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>
(
modelType,
mesh,
combustionProperties,
phaseName
thermo,
turb,
combustionProperties
),
CEDC_(readScalar(this->coeffs().lookup("CEDC")))
{}
@ -54,17 +54,17 @@ eddyDissipationModelBase<CombThermoType, ThermoType>::eddyDissipationModelBase
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
eddyDissipationModelBase<CombThermoType, ThermoType>::
template<class ReactionThermo, class ThermoType>
eddyDissipationModelBase<ReactionThermo, ThermoType>::
~eddyDissipationModelBase()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
eddyDissipationModelBase<CombThermoType, ThermoType>::rtTurb() const
eddyDissipationModelBase<ReactionThermo, ThermoType>::rtTurb() const
{
return
CEDC_*this->turbulence().epsilon()
@ -76,8 +76,8 @@ eddyDissipationModelBase<CombThermoType, ThermoType>::rtTurb() const
}
template<class CombThermoType, class ThermoType>
void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
template<class ReactionThermo, class ThermoType>
void eddyDissipationModelBase<ReactionThermo, ThermoType>::correct()
{
this->wFuel_ == dimensionedScalar(dimMass/dimVolume/dimTime, Zero);
@ -87,15 +87,13 @@ void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
const label fuelI = this->singleMixturePtr_->fuelIndex();
const volScalarField& YFuel =
this->thermoPtr_->composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo_.composition().Y()[fuelI];
const dimensionedScalar s = this->singleMixturePtr_->s();
if (this->thermoPtr_->composition().contains("O2"))
if (this->thermo_.composition().contains("O2"))
{
const volScalarField& YO2 =
this->thermoPtr_->composition().Y("O2");
const volScalarField& YO2 = this->thermo_.composition().Y("O2");
this->wFuel_ ==
this->rho()
@ -113,10 +111,10 @@ void eddyDissipationModelBase<CombThermoType, ThermoType>::correct()
}
template<class CombThermoType, class ThermoType>
bool eddyDissipationModelBase<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool eddyDissipationModelBase<ReactionThermo, ThermoType>::read()
{
if (singleStepCombustion<CombThermoType, ThermoType>::read())
if (singleStepCombustion<ReactionThermo, ThermoType>::read())
{
this->coeffs().lookup("CEDC") >> CEDC_;
return true;

View File

@ -51,10 +51,10 @@ namespace combustionModels
Class eddyDissipationModelBase Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class eddyDissipationModelBase
:
public singleStepCombustion<CombThermoType, ThermoType>
public singleStepCombustion<ReactionThermo, ThermoType>
{
// Private data
@ -79,9 +79,9 @@ public:
eddyDissipationModelBase
(
const word& modelType,
const fvMesh& mesh,
const word& combustionProperties,
const word& phaseName
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -24,8 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "reactionsSensitivityAnalysis.H"
#include "psiChemistryModel.H"
#include "rhoChemistryModel.H"
#include "BasicChemistryModel.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -33,7 +34,13 @@ License
namespace Foam
{
// Psi-based chemistry
typedef functionObjects::reactionsSensitivityAnalysis<psiChemistryModel>
typedef functionObjects::reactionsSensitivityAnalysis
<
BasicChemistryModel
<
psiReactionThermo
>
>
psiReactionsSensitivityAnalysisFunctionObject;
defineTemplateTypeNameAndDebugWithName
@ -44,7 +51,13 @@ defineTemplateTypeNameAndDebugWithName
);
// Rho-based chemistry
typedef functionObjects::reactionsSensitivityAnalysis<rhoChemistryModel>
typedef functionObjects::reactionsSensitivityAnalysis
<
BasicChemistryModel
<
rhoReactionThermo
>
>
rhoReactionsSensitivityAnalysisFunctionObject;
defineTemplateTypeNameAndDebugWithName

View File

@ -275,7 +275,7 @@ makeThermoPhysicsReactionThermos
icoPoly8TranspJanafEThermoPhysics
);
makeReactionMixtureThermos
makeThermoPhysicsReactionThermos
(
rhoThermo,
rhoReactionThermo,
@ -511,7 +511,7 @@ makeThermoPhysicsReactionThermos
icoPoly8TranspJanafHThermoPhysics
);
makeReactionMixtureThermos
makeThermoPhysicsReactionThermos
(
rhoThermo,
rhoReactionThermo,

View File

@ -15,11 +15,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
combustionModel eddyDissipationDiffusionModel<psiThermoCombustion,gasHThermoPhysics>;
combustionModel EDM;
active on;
eddyDissipationDiffusionModelCoeffs
EDMCoeffs
{
semiImplicit false;
CEDC 4;
@ -28,8 +28,8 @@ eddyDissipationDiffusionModelCoeffs
infinitelyFastChemistryCoeffs
{
semiImplicit no;
C 5.0;
semiImplicit no;
C 5.0;
}
// ************************************************************************* //

View File

@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pimpleDyMFoam;
application pimpleFoam;
startFrom latestTime;