Commit eeedf5a0 authored by Henry's avatar Henry
Browse files

Thermodyamics: Add support for multiphase

Pass the phase-name through hierarchy
Add phase-name to variables
Split basicCombustionMixture
Update applications accordingly
parent f86da345
......@@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition();
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
......
......@@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition();
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
......
......@@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition();
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
......
......@@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition();
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
......
......@@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition();
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
......
......@@ -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-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -85,7 +85,7 @@ const Foam::SLGThermo& Foam::CompositionModel<CloudType>::thermo() const
template<class CloudType>
const Foam::basicMultiComponentMixture&
const Foam::basicSpecieMixture&
Foam::CompositionModel<CloudType>::carrier() const
{
return thermo_.carrier();
......@@ -713,4 +713,3 @@ Foam::scalar Foam::CompositionModel<CloudType>::L
#include "CompositionModelNew.C"
// ************************************************************************* //
......@@ -138,7 +138,7 @@ public:
// Composition lists
//- Return the carrier components (wrapper function)
const basicMultiComponentMixture& carrier() const;
const basicSpecieMixture& carrier() const;
//- Return the global (additional) liquids
const liquidMixtureProperties& liquids() const;
......
......@@ -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-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -53,10 +53,10 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, fluidThermo& thermo)
{
Info<< "Creating component thermo properties:" << endl;
if (isA<basicMultiComponentMixture>(thermo))
if (isA<basicSpecieMixture>(thermo))
{
basicMultiComponentMixture& mcThermo =
dynamic_cast<basicMultiComponentMixture&>(thermo);
basicSpecieMixture& mcThermo =
dynamic_cast<basicSpecieMixture&>(thermo);
carrier_ = &mcThermo;
Info<< " multi-component carrier - " << mcThermo.species().size()
......@@ -105,13 +105,13 @@ const Foam::fluidThermo& Foam::SLGThermo::thermo() const
}
const Foam::basicMultiComponentMixture& Foam::SLGThermo::carrier() const
const Foam::basicSpecieMixture& Foam::SLGThermo::carrier() const
{
if (carrier_ == NULL)
{
FatalErrorIn
(
"const Foam::basicMultiComponentMixture& "
"const Foam::basicSpecieMixture& "
"Foam::SLGThermo::carrier() const"
) << "carrier requested, but object is not allocated"
<< abort(FatalError);
......
......@@ -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-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,7 +47,7 @@ SourceFiles
#include "regIOobject.H"
#include "fluidThermo.H"
#include "basicMultiComponentMixture.H"
#include "basicSpecieMixture.H"
#include "liquidMixtureProperties.H"
#include "solidMixtureProperties.H"
......@@ -70,7 +70,7 @@ class SLGThermo
fluidThermo& thermo_;
//- Reference to the multi-component carrier phase thermo
basicMultiComponentMixture* carrier_;
basicSpecieMixture* carrier_;
//- Additional liquid properties data
autoPtr<liquidMixtureProperties> liquids_;
......@@ -102,7 +102,7 @@ public:
const fluidThermo& thermo() const;
//- Return reference to the gaseous components
const basicMultiComponentMixture& carrier() const;
const basicSpecieMixture& carrier() const;
//- Return reference to the global (additional) liquids
const liquidMixtureProperties& liquids() const;
......
......@@ -89,7 +89,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
)
:
BasicThermo(mesh, phaseName),
MixtureType(*this, mesh),
MixtureType(*this, mesh, phaseName),
he_
(
......@@ -123,7 +123,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
)
:
BasicThermo(mesh, dict, phaseName),
MixtureType(*this, mesh),
MixtureType(*this, mesh, phaseName),
he_
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -58,8 +58,8 @@ public:
// Constructors
//- Construct from dictionary and mesh
basicMixture(const dictionary&, const fvMesh&)
//- Construct from dictionary, mesh and phase name
basicMixture(const dictionary&, const fvMesh&, const word&)
{}
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -26,21 +26,17 @@ License
#include "pureMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
pureMixture<ThermoType>::pureMixture
Foam::pureMixture<ThermoType>::pureMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
basicMixture(thermoDict, mesh),
basicMixture(thermoDict, mesh, phaseName),
mixture_(thermoDict.subDict("mixture"))
{}
......@@ -48,14 +44,10 @@ pureMixture<ThermoType>::pureMixture
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
void pureMixture<ThermoType>::read(const dictionary& thermoDict)
void Foam::pureMixture<ThermoType>::read(const dictionary& thermoDict)
{
mixture_ = ThermoType(thermoDict.subDict("mixture"));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -67,8 +67,8 @@ public:
// Constructors
//- Construct from dictionary and mesh
pureMixture(const dictionary&, const fvMesh&);
//- Construct from dictionary, mesh and phase name
pureMixture(const dictionary&, const fvMesh&, const word&);
// Member functions
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -44,13 +44,17 @@ void Foam::basicChemistryModel::correct()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
Foam::basicChemistryModel::basicChemistryModel
(
const fvMesh& mesh,
const word& phaseName
)
:
IOdictionary
(
IOobject
(
"chemistryProperties",
IOobject::groupName("chemistryProperties", phaseName),
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
......@@ -64,7 +68,7 @@ Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
(
IOobject
(
"deltaTChem",
IOobject::groupName("deltaTChem", phaseName),
mesh.time().constant(),
mesh,
IOobject::NO_READ,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -104,14 +104,14 @@ public:
// Constructors
//- Construct from mesh
basicChemistryModel(const fvMesh& mesh);
basicChemistryModel(const fvMesh& mesh, const word& phaseName);
// Selectors
//- Generic New for each of the related chemistry model
template<class Thermo>
static autoPtr<Thermo> New(const fvMesh&);
static autoPtr<Thermo> New(const fvMesh& mesh, const word& phaseName);
//- Destructor
......@@ -146,11 +146,11 @@ public:
const label i
) = 0;
//- Return reaction rate of the specieI in reactionI
//- Return reaction rate of the speciei in reactioni
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
(
const label reactionI,
const label specieI
const label reactioni,
const label speciei
) const = 0;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -31,14 +31,15 @@ License
template<class ChemistryModel>
Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
(
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
{
IOdictionary chemistryDict
(
IOobject
(
"chemistryProperties",
IOobject::groupName("chemistryProperties", phaseName),
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
......@@ -74,7 +75,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
(
IOobject
(
"thermophysicalProperties",
IOobject::groupName("thermophysicalProperties", phaseName),
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
......@@ -158,7 +159,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
FatalError<< exit(FatalError);
}
return autoPtr<ChemistryModel>(cstrIter()(mesh));
return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
}
else
{
......@@ -180,7 +181,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
<< exit(FatalError);
}
return autoPtr<ChemistryModel>(cstrIter()(mesh));
return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
}
}
......
......@@ -32,10 +32,11 @@ License
template<class CompType, class ThermoType>
Foam::chemistryModel<CompType, ThermoType>::chemistryModel
(
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
CompType(mesh),
CompType(mesh, phaseName),
ODESystem(),
Y_(this->thermo().composition().Y()),
reactions_
......@@ -632,7 +633,7 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::chemistryModel<CompType, ThermoType>::calculateRR
(
const label reactionI,
const label specieI
const label speciei
) const
{
scalar pf, cf, pr, cr;
......@@ -701,7 +702,7 @@ Foam::chemistryModel<CompType, ThermoType>::calculateRR
rRef
);
RR[celli] = w*specieThermo_[specieI].W();
RR[celli] = w*specieThermo_[speciei].W();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -117,7 +117,7 @@ public:
// Constructors
//- Construct from mesh
chemistryModel(const fvMesh& mesh);
chemistryModel(const fvMesh& mesh, const word& phaseName);
//- Destructor
......@@ -198,11 +198,11 @@ public:
const label i
);
//- Return reaction rate of the specieI in reactionI
//- Return reaction rate of the speciei in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
(
const label reactionI,
const label specieI
const label speciei
) const;
//- Solve the reaction system for the given time step
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -39,11 +39,12 @@ namespace Foam
Foam::psiChemistryModel::psiChemistryModel
(
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
basicChemistryModel(mesh),
thermo_(psiReactionThermo::New(mesh))
basicChemistryModel(mesh, phaseName),
thermo_(psiReactionThermo::New(mesh, phaseName))
{}
......@@ -51,10 +52,11 @@ Foam::psiChemistryModel::psiChemistryModel
Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
(
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
{
return basicChemistryModel::New<psiChemistryModel>(mesh);
return basicChemistryModel::New<psiChemistryModel>(mesh, phaseName);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -87,19 +87,23 @@ public:
autoPtr,
psiChemistryModel,
fvMesh,
(const fvMesh& mesh),
(mesh)
(const fvMesh& mesh, const word& phaseName),
(mesh, phaseName)
);
// Constructors
//- Construct from mesh
psiChemistryModel(const fvMesh& mesh);
//- Construct from mesh and phase name
psiChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Selector
static autoPtr<psiChemistryModel> New(const fvMesh& mesh);
static autoPtr<psiChemistryModel> New
(
const fvMesh& mesh,
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-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -39,11 +39,12 @@ namespace Foam
Foam::rhoChemistryModel::rhoChemistryModel
(
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
basicChemistryModel(mesh),
thermo_(rhoReactionThermo::New(mesh))
basicChemistryModel(mesh, phaseName),
thermo_(rhoReactionThermo::New(mesh, phaseName))
{}
......@@ -51,10 +52,11 @@ Foam::rhoChemistryModel::rhoChemistryModel
Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New