reactionThermo: Single component mixture

This mixture allows a reacting solver to be used with a single component
fluid without the additional case files usually required for reacting
thermodynamics.
This commit is contained in:
Will Bainbridge
2017-12-01 11:12:05 +00:00
parent ea51d79c0d
commit 476cbcaac8
4 changed files with 373 additions and 5 deletions

View File

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 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/>.
\*---------------------------------------------------------------------------*/
#include "singleComponentMixture.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::singleComponentMixture<ThermoType>::singleComponentMixture
(
const dictionary& thermoDict,
const fvMesh& mesh,
const word& phaseName
)
:
basicSpecieMixture(thermoDict, wordList::null(), mesh, phaseName),
thermo_(thermoDict.subDict("mixture"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::singleComponentMixture<ThermoType>::~singleComponentMixture()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class ThermoType>
void Foam::singleComponentMixture<ThermoType>::read
(
const dictionary& thermoDict
)
{
thermo_ = ThermoType(thermoDict.subDict("mixture"));
}
// ************************************************************************* //

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 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/>.
Class
Foam::singleComponentMixture
Description
Single component mixture
SourceFiles
singleComponentMixture.C
\*---------------------------------------------------------------------------*/
#ifndef singleComponentMixture_H
#define singleComponentMixture_H
#include "basicSpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class singleComponentMixture Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class singleComponentMixture
:
public basicSpecieMixture
{
// Private data
//- Thermo model
ThermoType thermo_;
public:
//- The type of thermodynamics this mixture is instantiated for
typedef ThermoType thermoType;
// Constructors
//- Construct from dictionary, mesh and phase name
singleComponentMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor
virtual ~singleComponentMixture();
// Member Functions
//- Get the mixture for the given cell
const ThermoType& cellMixture(const label celli) const
{
return thermo_;
}
//- Get the mixture for the given patch face
const ThermoType& patchFaceMixture
(
const label patchi,
const label facei
) const
{
return thermo_;
}
//- Get the volumetric mixture for the given cell
const ThermoType& cellVolMixture
(
const scalar p,
const scalar T,
const label celli
)
{
return thermo_;
}
//- Get the volumetric mixture for the given patch face
const ThermoType& patchFaceVolMixture
(
const scalar p,
const scalar T,
const label patchi,
const label facei
) const
{
return thermo_;
}
//- Read dictionary
void read(const dictionary&);
//- Return thermo based on index
inline const ThermoType& getLocalThermo(const label speciei) const
{
#ifdef FULLDEBUG
if (speciei != 0)
{
FatalErrorInFunction
<< "Specie index must be zero for a single component "
<< "mixture" << exit(FatalError);
}
#endif
return thermo_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "singleComponentMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,7 @@ License
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
#include "singleComponentMixture.H"
#include "thermoPhysicsTypes.H"
@ -178,6 +179,7 @@ makeReactionThermo
specie
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Multi-component thermo for sensible enthalpy
@ -221,7 +223,7 @@ makeReactionMixtureThermo
);
// Multi-component reaction thermo for sensible enthalpy
// Reaction thermo for sensible enthalpy
makeReactionMixtureThermo
(
@ -241,6 +243,9 @@ makeReactionMixtureThermo
gasHThermoPhysics
);
// Single-step reaction thermo for sensible enthalpy
makeReactionMixtureThermo
(
psiThermo,
@ -251,7 +256,7 @@ makeReactionMixtureThermo
);
// Multi-component reaction thermo for internal energy
// Reaction thermo for internal energy
makeReactionMixtureThermo
(
@ -271,6 +276,9 @@ makeReactionMixtureThermo
gasEThermoPhysics
);
// Single-step reaction thermo for internal energy
makeReactionMixtureThermo
(
psiThermo,
@ -280,6 +288,48 @@ makeReactionMixtureThermo
gasEThermoPhysics
);
// Single-component thermo for sensible enthalpy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleComponentMixture,
constGasHThermoPhysics
);
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleComponentMixture,
gasHThermoPhysics
);
// Single-component thermo for internal energy
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleComponentMixture,
constGasEThermoPhysics
);
makeReactionMixtureThermo
(
psiThermo,
psiReactionThermo,
hePsiThermo,
singleComponentMixture,
gasEThermoPhysics
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -45,6 +45,7 @@ License
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
#include "singleComponentMixture.H"
#include "thermoPhysicsTypes.H"
@ -212,6 +213,7 @@ makeReactionThermo
specie
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Multi-component thermo for internal energy
@ -261,7 +263,7 @@ makeReactionMixtureThermo
);
// Multi-component reaction thermo
// Reaction thermo for internal energy
makeReactionMixtureThermo
(
@ -308,6 +310,9 @@ makeReactionMixtureThermo
icoPoly8EThermoPhysics
);
// Single-step reaction thermo for internal energy
makeReactionMixtureThermo
(
rhoThermo,
@ -318,6 +323,54 @@ makeReactionMixtureThermo
);
// Single-component thermo for internal energy
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
constGasEThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
gasEThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
constIncompressibleGasEThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
incompressibleGasEThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
icoPoly8EThermoPhysics
);
// Multi-component thermo for sensible enthalpy
makeReactionMixtureThermo
@ -366,7 +419,7 @@ makeReactionMixtureThermo
);
// Multi-component reaction thermo
// Reaction thermo for sensible enthalpy
makeReactionMixtureThermo
(
@ -413,6 +466,9 @@ makeReactionMixtureThermo
icoPoly8HThermoPhysics
);
// Single-step reaction thermo for sensible enthalpy
makeReactionMixtureThermo
(
rhoThermo,
@ -423,6 +479,53 @@ makeReactionMixtureThermo
);
// Single-component thermo for sensible enthalpy
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
constGasHThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
gasHThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
constIncompressibleGasHThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
incompressibleGasHThermoPhysics
);
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
singleComponentMixture,
icoPoly8HThermoPhysics
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam