Skip to content

Commit

Permalink
Standardised naming of multicomponent thermophysical properties: mult…
Browse files Browse the repository at this point in the history
…iComponent -> multicomponent

Full backward-compatibility is provided which support for both multiComponentMixture and
multiComponentPhaseModel provided but all tutorials have been updated.
  • Loading branch information
Henry Weller committed Jul 29, 2022
1 parent 5196e09 commit 3efe097
Show file tree
Hide file tree
Showing 67 changed files with 248 additions and 229 deletions.
2 changes: 1 addition & 1 deletion applications/solvers/combustion/chemFoam/chemFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Description
#include "zeroDimensionalFvMesh.H"
#include "fluidMulticomponentThermo.H"
#include "basicChemistryModel.H"
#include "multiComponentMixture.H"
#include "multicomponentMixture.H"
#include "chemistrySolver.H"
#include "OFstream.H"
#include "basicSpecieMixture.H"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

fluid.correctReactions();

forAll(fluid.multiComponentPhases(), multiComponentPhasei)
forAll(fluid.multicomponentPhases(), multicomponentPhasei)
{
phaseModel& phase = fluid.multiComponentPhases()[multiComponentPhasei];
phaseModel& phase = fluid.multicomponentPhases()[multicomponentPhasei];

UPtrList<volScalarField>& Y = phase.YActiveRef();
const volScalarField& alpha = phase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/

#include "MultiComponentPhaseModel.H"
#include "MulticomponentPhaseModel.H"

#include "phaseSystem.H"

Expand All @@ -38,7 +38,7 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

template<class BasePhaseModel>
Foam::MultiComponentPhaseModel<BasePhaseModel>::MultiComponentPhaseModel
Foam::MulticomponentPhaseModel<BasePhaseModel>::MulticomponentPhaseModel
(
const phaseSystem& fluid,
const word& phaseName,
Expand All @@ -65,30 +65,30 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::MultiComponentPhaseModel
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

template<class BasePhaseModel>
Foam::MultiComponentPhaseModel<BasePhaseModel>::~MultiComponentPhaseModel()
Foam::MulticomponentPhaseModel<BasePhaseModel>::~MulticomponentPhaseModel()
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class BasePhaseModel>
void Foam::MultiComponentPhaseModel<BasePhaseModel>::correctSpecies()
void Foam::MulticomponentPhaseModel<BasePhaseModel>::correctSpecies()
{
this->thermo_->composition().normalise();
BasePhaseModel::correctSpecies();
}


template<class BasePhaseModel>
bool Foam::MultiComponentPhaseModel<BasePhaseModel>::pure() const
bool Foam::MulticomponentPhaseModel<BasePhaseModel>::pure() const
{
return false;
}


template<class BasePhaseModel>
Foam::tmp<Foam::fvScalarMatrix>
Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi)
Foam::MulticomponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi)
{
const volScalarField& alpha = *this;
const volScalarField& rho = this->thermo().rho();
Expand Down Expand Up @@ -119,39 +119,39 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi)

template<class BasePhaseModel>
const Foam::PtrList<Foam::volScalarField>&
Foam::MultiComponentPhaseModel<BasePhaseModel>::Y() const
Foam::MulticomponentPhaseModel<BasePhaseModel>::Y() const
{
return this->thermo_->composition().Y();
}


template<class BasePhaseModel>
const Foam::volScalarField&
Foam::MultiComponentPhaseModel<BasePhaseModel>::Y(const word& name) const
Foam::MulticomponentPhaseModel<BasePhaseModel>::Y(const word& name) const
{
return this->thermo_->composition().Y(name);
}


template<class BasePhaseModel>
Foam::PtrList<Foam::volScalarField>&
Foam::MultiComponentPhaseModel<BasePhaseModel>::YRef()
Foam::MulticomponentPhaseModel<BasePhaseModel>::YRef()
{
return this->thermo_->composition().Y();
}


template<class BasePhaseModel>
const Foam::UPtrList<Foam::volScalarField>&
Foam::MultiComponentPhaseModel<BasePhaseModel>::YActive() const
Foam::MulticomponentPhaseModel<BasePhaseModel>::YActive() const
{
return YActive_;
}


template<class BasePhaseModel>
Foam::UPtrList<Foam::volScalarField>&
Foam::MultiComponentPhaseModel<BasePhaseModel>::YActiveRef()
Foam::MulticomponentPhaseModel<BasePhaseModel>::YActiveRef()
{
return YActive_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::MultiComponentPhaseModel
Foam::MulticomponentPhaseModel
Description
Class which represents a phase with multiple species. Returns the species'
mass fractions, and their governing equations.
SourceFiles
MultiComponentPhaseModel.C
MulticomponentPhaseModel.C
\*---------------------------------------------------------------------------*/

#ifndef MultiComponentPhaseModel_H
#define MultiComponentPhaseModel_H
#ifndef MulticomponentPhaseModel_H
#define MulticomponentPhaseModel_H

#include "phaseModel.H"

Expand All @@ -44,11 +44,11 @@ namespace Foam
{

/*---------------------------------------------------------------------------*\
Class MultiComponentPhaseModel Declaration
Class MulticomponentPhaseModel Declaration
\*---------------------------------------------------------------------------*/

template<class BasePhaseModel>
class MultiComponentPhaseModel
class MulticomponentPhaseModel
:
public BasePhaseModel
{
Expand All @@ -64,7 +64,7 @@ public:

// Constructors

MultiComponentPhaseModel
MulticomponentPhaseModel
(
const phaseSystem& fluid,
const word& phaseName,
Expand All @@ -74,7 +74,7 @@ public:


//- Destructor
virtual ~MultiComponentPhaseModel();
virtual ~MulticomponentPhaseModel();


// Member Functions
Expand Down Expand Up @@ -114,7 +114,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#ifdef NoRepository
#include "MultiComponentPhaseModel.C"
#include "MulticomponentPhaseModel.C"
#endif

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ License
#include "IsothermalPhaseModel.H"
#include "AnisothermalPhaseModel.H"
#include "PurePhaseModel.H"
#include "MultiComponentPhaseModel.H"
#include "MulticomponentPhaseModel.H"
#include "InertPhaseModel.H"
#include "ReactingPhaseModel.H"
#include "MovingPhaseModel.H"
Expand Down Expand Up @@ -144,7 +144,7 @@ namespace Foam
typedef
AnisothermalPhaseModel
<
MultiComponentPhaseModel
MulticomponentPhaseModel
<
InertPhaseModel
<
Expand All @@ -155,20 +155,30 @@ namespace Foam
>
>
>
multiComponentPhaseModel;
multicomponentPhaseModel;

addNamedToRunTimeSelectionTable
(
phaseModel,
multiComponentPhaseModel,
multicomponentPhaseModel,
phaseSystem,
multicomponentPhaseModel
);

// Also add multicomponentPhaseModel with the name multiComponentPhaseModel
// for backward-compatibility
addNamedToRunTimeSelectionTable
(
phaseModel,
multicomponentPhaseModel,
phaseSystem,
multiComponentPhaseModel
);

typedef
IsothermalPhaseModel
<
MultiComponentPhaseModel
MulticomponentPhaseModel
<
InertPhaseModel
<
Expand All @@ -179,20 +189,20 @@ namespace Foam
>
>
>
multiComponentIsothermalPhaseModel;
multicomponentIsothermalPhaseModel;

addNamedToRunTimeSelectionTable
(
phaseModel,
multiComponentIsothermalPhaseModel,
multicomponentIsothermalPhaseModel,
phaseSystem,
multiComponentIsothermalPhaseModel
multicomponentIsothermalPhaseModel
);

typedef
AnisothermalPhaseModel
<
MultiComponentPhaseModel
MulticomponentPhaseModel
<
ReactingPhaseModel
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,24 @@ Foam::phaseSystem::phaseSystem
label movingPhasei = 0;
label stationaryPhasei = 0;
label anisothermalPhasei = 0;
label multiComponentPhasei = 0;
label multicomponentPhasei = 0;
forAll(phaseModels_, phasei)
{
phaseModel& phase = phaseModels_[phasei];
movingPhasei += !phase.stationary();
stationaryPhasei += phase.stationary();
anisothermalPhasei += !phase.isothermal();
multiComponentPhasei += !phase.pure();
multicomponentPhasei += !phase.pure();
}
movingPhaseModels_.resize(movingPhasei);
stationaryPhaseModels_.resize(stationaryPhasei);
anisothermalPhaseModels_.resize(anisothermalPhasei);
multiComponentPhaseModels_.resize(multiComponentPhasei);
multicomponentPhaseModels_.resize(multicomponentPhasei);

movingPhasei = 0;
stationaryPhasei = 0;
anisothermalPhasei = 0;
multiComponentPhasei = 0;
multicomponentPhasei = 0;
forAll(phaseModels_, phasei)
{
phaseModel& phase = phaseModels_[phasei];
Expand All @@ -296,7 +296,7 @@ Foam::phaseSystem::phaseSystem
}
if (!phase.pure())
{
multiComponentPhaseModels_.set(multiComponentPhasei++, &phase);
multicomponentPhaseModels_.set(multicomponentPhasei++, &phase);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected:
phaseModelPartialList anisothermalPhaseModels_;

//- Multi-component phase models
phaseModelPartialList multiComponentPhaseModels_;
phaseModelPartialList multicomponentPhaseModels_;

//- Total volumetric flux
surfaceScalarField phi_;
Expand Down Expand Up @@ -302,10 +302,10 @@ public:
inline phaseModelPartialList& anisothermalPhases();

//- Return the models for phases that have multiple species
inline const phaseModelPartialList& multiComponentPhases() const;
inline const phaseModelPartialList& multicomponentPhases() const;

//- Access the models for phases that have multiple species
inline phaseModelPartialList& multiComponentPhases();
inline phaseModelPartialList& multicomponentPhases();

//- Return the phase not given as an argument in a two-phase system
// An error is generated if the system is not two-phase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ Foam::phaseSystem::anisothermalPhases()


inline const Foam::phaseSystem::phaseModelPartialList&
Foam::phaseSystem::multiComponentPhases() const
Foam::phaseSystem::multicomponentPhases() const
{
return multiComponentPhaseModels_;
return multicomponentPhaseModels_;
}


inline Foam::phaseSystem::phaseModelPartialList&
Foam::phaseSystem::multiComponentPhases()
Foam::phaseSystem::multicomponentPhases()
{
return multiComponentPhaseModels_;
return multicomponentPhaseModels_;
}


Expand Down
8 changes: 4 additions & 4 deletions etc/codeTemplates/dynamicCode/fluidMulticomponentThermo
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ energy
mixture
(
pureMixture
multiComponentMixture
valueMultiComponentMixture
coefficientWilkeMultiComponentMixture
multicomponentMixture
valueMulticomponentMixture
coefficientWilkeMulticomponentMixture
);

mixtureRenamed
(
pureMixture singleComponentMixture
multiComponentMixture coefficientMultiComponentMixture
multicomponentMixture coefficientMulticomponentMixture
);

transport
Expand Down
Loading

0 comments on commit 3efe097

Please sign in to comment.