mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: Integrated foundation code
This commit is contained in:
@ -41,6 +41,7 @@ FSD<CombThermoType, ThermoType>::FSD
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
@ -48,6 +49,7 @@ FSD<CombThermoType, ThermoType>::FSD
|
||||
(
|
||||
modelType,
|
||||
mesh,
|
||||
combustionProperties,
|
||||
phaseName
|
||||
),
|
||||
reactionRateFlameArea_
|
||||
|
||||
@ -139,21 +139,24 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
FSD(const word& modelType, const fvMesh& mesh, const word& phaseName);
|
||||
FSD
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
virtual ~FSD();
|
||||
//- Destructor
|
||||
virtual ~FSD();
|
||||
|
||||
|
||||
// Evolution
|
||||
// Member Functions
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
@ -29,6 +29,8 @@ FSD/FSDs.C
|
||||
|
||||
diffusionMulticomponent/diffusionMulticomponents.C
|
||||
|
||||
zoneCombustion/zoneCombustions.C
|
||||
|
||||
noCombustion/noCombustions.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcombustionModels
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,10 +33,11 @@ Foam::combustionModels::PaSR<Type>::PaSR
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
laminar<Type>(modelType, mesh, phaseName),
|
||||
laminar<Type>(modelType, mesh, combustionProperties, phaseName),
|
||||
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
|
||||
turbulentReaction_(this->coeffs().lookup("turbulentReaction")),
|
||||
kappa_
|
||||
|
||||
@ -89,7 +89,13 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
PaSR(const word& modelType, const fvMesh& mesh, const word& phaseName);
|
||||
PaSR
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -98,25 +104,20 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,12 +32,19 @@ namespace Foam
|
||||
defineTypeNameAndDebug(combustionModel, 0);
|
||||
}
|
||||
|
||||
const Foam::word Foam::combustionModel::combustionPropertiesName
|
||||
(
|
||||
"combustionProperties"
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModel::combustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
@ -45,7 +52,7 @@ Foam::combustionModel::combustionModel
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("combustionProperties", phaseName),
|
||||
IOobject::groupName(combustionProperties, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
|
||||
@ -91,6 +91,9 @@ public:
|
||||
//- Runtime type information
|
||||
TypeName("combustionModel");
|
||||
|
||||
//- Default combustionProperties dictionary name
|
||||
static const word combustionPropertiesName;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -99,6 +102,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties=combustionPropertiesName,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
@ -109,31 +113,26 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
//- Return const access to the mesh database
|
||||
inline const fvMesh& mesh() const;
|
||||
|
||||
//- Return const access to the mesh database
|
||||
inline const fvMesh& mesh() const;
|
||||
//- Set turbulence
|
||||
inline void setTurbulence(compressibleTurbulenceModel& turbModel);
|
||||
|
||||
//- Set turbulence
|
||||
inline void setTurbulence(compressibleTurbulenceModel& turbModel);
|
||||
//- Return access to turbulence
|
||||
inline const compressibleTurbulenceModel& turbulence() const;
|
||||
|
||||
//- Return access to turbulence
|
||||
inline const compressibleTurbulenceModel& turbulence() const;
|
||||
//- Return const access to rho
|
||||
inline const volScalarField& rho() const;
|
||||
|
||||
//- Return const access to rho
|
||||
inline const volScalarField& rho() const;
|
||||
//- Return const access to phi
|
||||
inline tmp<surfaceScalarField> phi() const;
|
||||
|
||||
//- Return const access to phi
|
||||
inline tmp<surfaceScalarField> phi() const;
|
||||
//- Is combustion active?
|
||||
inline const Switch& active() const;
|
||||
|
||||
//- Is combustion active?
|
||||
inline const Switch& active() const;
|
||||
|
||||
//- Return const dictionary of the model
|
||||
inline const dictionary& coeffs() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
//- Return const dictionary of the model
|
||||
inline const dictionary& coeffs() const;
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct() = 0;
|
||||
@ -147,9 +146,6 @@ public:
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,6 +38,7 @@ diffusion<CombThermoType, ThermoType>::diffusion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
@ -45,6 +46,7 @@ diffusion<CombThermoType, ThermoType>::diffusion
|
||||
(
|
||||
modelType,
|
||||
mesh,
|
||||
combustionProperties,
|
||||
phaseName
|
||||
),
|
||||
C_(readScalar(this->coeffs().lookup("C"))),
|
||||
|
||||
@ -89,6 +89,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -99,16 +100,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,7 +65,8 @@ makeCombustionTypesThermo
|
||||
rhoCombustionModel
|
||||
);
|
||||
|
||||
// Combustion models based on sensibleInternalEnergy
|
||||
|
||||
// Combustion models based on sensibleInternalEnergy
|
||||
|
||||
makeCombustionTypesThermo
|
||||
(
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,7 @@ infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
@ -44,6 +45,7 @@ infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
|
||||
(
|
||||
modelType,
|
||||
mesh,
|
||||
combustionProperties,
|
||||
phaseName
|
||||
),
|
||||
C_(readScalar(this->coeffs().lookup("C")))
|
||||
|
||||
@ -86,6 +86,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -96,16 +97,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
//- Update properties
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -34,10 +34,11 @@ Foam::combustionModels::laminar<Type>::laminar
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
Type(modelType, mesh, phaseName),
|
||||
Type(modelType, mesh, combustionProperties, phaseName),
|
||||
integrateReactionRate_
|
||||
(
|
||||
this->coeffs().lookupOrDefault("integrateReactionRate", true)
|
||||
|
||||
@ -91,6 +91,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -101,25 +102,20 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::noCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
|
||||
@ -75,6 +75,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -85,24 +86,20 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
//- Fuel consumption rate matrix
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
|
||||
//- Fuel consumption rate matrix
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -31,10 +31,11 @@ Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
psiCombustionModel(modelType, mesh, phaseName),
|
||||
psiCombustionModel(modelType, mesh, combustionProperties, phaseName),
|
||||
chemistryPtr_(psiChemistryModel::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,10 +42,11 @@ Foam::combustionModels::psiCombustionModel::psiCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh, phaseName)
|
||||
combustionModel(modelType, mesh, combustionProperties, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,6 @@ class psiCombustionModel
|
||||
:
|
||||
public combustionModel
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
@ -69,6 +68,9 @@ class psiCombustionModel
|
||||
|
||||
public:
|
||||
|
||||
typedef psiReactionThermo ReactionThermo;
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("psiCombustionModel");
|
||||
|
||||
@ -82,9 +84,10 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
),
|
||||
(modelType, mesh, phaseName)
|
||||
(modelType, mesh, combustionProperties, phaseName)
|
||||
);
|
||||
|
||||
|
||||
@ -95,17 +98,18 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<psiCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
//- Selector
|
||||
static autoPtr<psiCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties=combustionPropertiesName,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,6 +31,7 @@ Foam::autoPtr<Foam::combustionModels::psiCombustionModel>
|
||||
Foam::combustionModels::psiCombustionModel::New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
@ -40,7 +41,7 @@ Foam::combustionModels::psiCombustionModel::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("combustionProperties", phaseName),
|
||||
IOobject::groupName(combustionProperties, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -65,11 +66,12 @@ Foam::combustionModels::psiCombustionModel::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const label tempOpen = combModelName.find('<');
|
||||
const word className = combModelName(0, combModelName.find('<'));
|
||||
|
||||
const word className = combModelName(0, tempOpen);
|
||||
|
||||
return autoPtr<psiCombustionModel>(cstrIter()(className, mesh, phaseName));
|
||||
return autoPtr<psiCombustionModel>
|
||||
(
|
||||
cstrIter()(className, mesh, combustionProperties, phaseName)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ Foam::combustionModels::psiThermoCombustion::psiThermoCombustion
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
psiCombustionModel(modelType, mesh, phaseName),
|
||||
psiCombustionModel(modelType, mesh, combustionPropertiesName, phaseName),
|
||||
thermoPtr_(psiReactionThermo::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -31,10 +31,11 @@ Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
rhoCombustionModel(modelType, mesh, phaseName),
|
||||
rhoCombustionModel(modelType, mesh, combustionProperties, phaseName),
|
||||
chemistryPtr_(rhoChemistryModel::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,10 +42,11 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
combustionModel(modelType, mesh, phaseName)
|
||||
combustionModel(modelType, mesh, combustionProperties, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -69,6 +69,9 @@ class rhoCombustionModel
|
||||
|
||||
public:
|
||||
|
||||
typedef rhoReactionThermo ReactionThermo;
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("rhoCombustionModel");
|
||||
|
||||
@ -82,9 +85,10 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
),
|
||||
(modelType, mesh, phaseName)
|
||||
(modelType, mesh, combustionProperties, phaseName)
|
||||
);
|
||||
|
||||
|
||||
@ -96,6 +100,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -105,6 +110,7 @@ public:
|
||||
static autoPtr<rhoCombustionModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties=combustionPropertiesName,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
@ -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-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,6 +31,7 @@ Foam::autoPtr<Foam::combustionModels::rhoCombustionModel>
|
||||
Foam::combustionModels::rhoCombustionModel::New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
@ -40,7 +41,7 @@ Foam::combustionModels::rhoCombustionModel::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("combustionProperties", phaseName),
|
||||
IOobject::groupName(combustionProperties, phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -69,7 +70,10 @@ Foam::combustionModels::rhoCombustionModel::New
|
||||
|
||||
const word className = combTypeName(0, tempOpen);
|
||||
|
||||
return autoPtr<rhoCombustionModel> (cstrIter()(className, mesh, phaseName));
|
||||
return autoPtr<rhoCombustionModel>
|
||||
(
|
||||
cstrIter()(className, mesh, combustionProperties, phaseName)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
rhoCombustionModel(modelType, mesh, phaseName),
|
||||
rhoCombustionModel(modelType, mesh, combustionPropertiesName, phaseName),
|
||||
thermoPtr_(rhoReactionThermo::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
|
||||
@ -88,6 +88,7 @@ public:
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
@ -98,22 +99,17 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
//- Fuel consumption rate matrix
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
|
||||
//- Fuel consumption rate matrix
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
//- Sensible enthalpy source term
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
//- Sensible enthalpy source term
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
|
||||
// IO
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
197
src/combustionModels/zoneCombustion/zoneCombustion.C
Normal file
197
src/combustionModels/zoneCombustion/zoneCombustion.C
Normal file
@ -0,0 +1,197 @@
|
||||
/*---------------------------------------------------------------------------* \
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 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 "zoneCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModels::zoneCombustion<Type>::filter
|
||||
(
|
||||
const tmp<fvScalarMatrix>& tR
|
||||
) const
|
||||
{
|
||||
fvScalarMatrix& R = tR.ref();
|
||||
scalarField& Su = R.source();
|
||||
scalarField filteredField(Su.size(), 0);
|
||||
|
||||
forAll(zoneNames_, zonei)
|
||||
{
|
||||
const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
filteredField[cells[i]] = Su[cells[i]];
|
||||
}
|
||||
}
|
||||
|
||||
Su = filteredField;
|
||||
|
||||
if (R.hasDiag())
|
||||
{
|
||||
scalarField& Sp = R.diag();
|
||||
|
||||
forAll(zoneNames_, zonei)
|
||||
{
|
||||
const labelList& cells =
|
||||
this->mesh().cellZones()[zoneNames_[zonei]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
filteredField[cells[i]] = Sp[cells[i]];
|
||||
}
|
||||
}
|
||||
|
||||
Sp = filteredField;
|
||||
}
|
||||
|
||||
return tR;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::zoneCombustion<Type>::filter
|
||||
(
|
||||
const tmp<volScalarField>& tS
|
||||
) const
|
||||
{
|
||||
scalarField& S = tS.ref();
|
||||
scalarField filteredField(S.size(), 0);
|
||||
|
||||
forAll(zoneNames_, zonei)
|
||||
{
|
||||
const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
filteredField[cells[i]] = S[cells[i]];
|
||||
}
|
||||
}
|
||||
|
||||
S = filteredField;
|
||||
|
||||
return tS;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::combustionModels::zoneCombustion<Type>::zoneCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
Type(modelType, mesh, combustionProperties, phaseName),
|
||||
combustionModelPtr_
|
||||
(
|
||||
Type::New
|
||||
(
|
||||
mesh,
|
||||
"zoneCombustionProperties",
|
||||
phaseName
|
||||
)
|
||||
),
|
||||
zoneNames_(this->coeffs().lookup("zones"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::combustionModels::zoneCombustion<Type>::~zoneCombustion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
typename Type::ReactionThermo&
|
||||
Foam::combustionModels::zoneCombustion<Type>::thermo()
|
||||
{
|
||||
return combustionModelPtr_->thermo();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const typename Type::ReactionThermo&
|
||||
Foam::combustionModels::zoneCombustion<Type>::thermo() const
|
||||
{
|
||||
return combustionModelPtr_->thermo();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::combustionModels::zoneCombustion<Type>::correct()
|
||||
{
|
||||
combustionModelPtr_->correct();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModels::zoneCombustion<Type>::R(volScalarField& Y) const
|
||||
{
|
||||
return filter(combustionModelPtr_->R(Y));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::zoneCombustion<Type>::dQ() const
|
||||
{
|
||||
return filter(combustionModelPtr_->dQ());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::zoneCombustion<Type>::Sh() const
|
||||
{
|
||||
return filter(combustionModelPtr_->Sh());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool Foam::combustionModels::zoneCombustion<Type>::read()
|
||||
{
|
||||
if (Type::read())
|
||||
{
|
||||
combustionModelPtr_->read();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
143
src/combustionModels/zoneCombustion/zoneCombustion.H
Normal file
143
src/combustionModels/zoneCombustion/zoneCombustion.H
Normal file
@ -0,0 +1,143 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 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::combustionModels::zoneCombustion
|
||||
|
||||
Description
|
||||
Zone-filtered combustion model.
|
||||
|
||||
Enable the reactions within the specified list of cell-zones and set
|
||||
to zero elsewhere.
|
||||
|
||||
SourceFiles
|
||||
zoneCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef zoneCombustion_H
|
||||
#define zoneCombustion_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zoneCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zoneCombustion
|
||||
:
|
||||
public Type
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- The combustion model to be zone-filtered
|
||||
autoPtr<Type> combustionModelPtr_;
|
||||
|
||||
//- List of zone names in which the reactions are active
|
||||
wordList zoneNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Filter the reaction-rate matrix on the cellZones
|
||||
tmp<fvScalarMatrix> filter(const tmp<fvScalarMatrix>& tR) const;
|
||||
|
||||
//- Filter the given field on the cellZones
|
||||
tmp<volScalarField> filter(const tmp<volScalarField>& tS) const;
|
||||
|
||||
//- Disallow copy construct
|
||||
zoneCombustion(const zoneCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const zoneCombustion&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zoneCombustion");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
zoneCombustion
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const word& combustionProperties,
|
||||
const word& phaseName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~zoneCombustion();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return access to the thermo package
|
||||
virtual typename Type::ReactionThermo& thermo();
|
||||
|
||||
//- Return const access to the thermo package
|
||||
virtual const typename Type::ReactionThermo& thermo() const;
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Fuel consumption rate matrix.
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
|
||||
|
||||
//- Heat release rate calculated from fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ() const;
|
||||
|
||||
//- Return source for enthalpy equation [kg/m/s3]
|
||||
virtual tmp<volScalarField> Sh() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "zoneCombustion.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
37
src/combustionModels/zoneCombustion/zoneCombustions.C
Normal file
37
src/combustionModels/zoneCombustion/zoneCombustions.C
Normal file
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 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 "makeCombustionTypes.H"
|
||||
|
||||
#include "psiCombustionModel.H"
|
||||
#include "rhoCombustionModel.H"
|
||||
#include "zoneCombustion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeCombustionTypes(zoneCombustion, psiCombustionModel, psiCombustionModel);
|
||||
makeCombustionTypes(zoneCombustion, rhoCombustionModel, rhoCombustionModel);
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user