Commit 13b14177 authored by sergio's avatar sergio Committed by Andrew Heather
Browse files

ENH: Adding new access to basic thermo for rho and Cp

parent b18dd0cb
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -203,6 +204,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
......@@ -214,6 +227,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -318,6 +318,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
......@@ -329,6 +341,18 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -173,6 +173,18 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Return Cv of the mixture
virtual tmp<volScalarField> Cv() const;
......@@ -184,6 +196,18 @@ public:
const label patchI
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return tmp<scalarField>::New(p);
}
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -455,6 +455,18 @@ Foam::tmp<Foam::scalarField> Foam::phaseSystem::Cp
}
Foam::tmp<Foam::scalarField> Foam::phaseSystem::CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::Cv() const
{
auto iter = phaseModels_.cbegin();
......@@ -496,6 +508,18 @@ Foam::tmp<Foam::scalarField> Foam::phaseSystem::Cv
}
Foam::tmp<Foam::scalarField> Foam::phaseSystem::rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volScalarField> Foam::phaseSystem::gamma() const
{
auto iter = phaseModels_.cbegin();
......
......@@ -351,6 +351,14 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const;
//- Return Cv of the mixture
virtual tmp<volScalarField> Cv() const;
......@@ -362,6 +370,14 @@ public:
const label patchI
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const;
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
......
......@@ -443,6 +443,14 @@ public:
const label patchi
) const = 0;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const = 0;
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const = 0;
......@@ -454,6 +462,14 @@ public:
const label patchi
) const = 0;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const = 0;
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const = 0;
......
......@@ -376,6 +376,28 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
auto tCp = tmp<scalarField>::New(T.size());
auto& Cp = tCp.ref();
forAll(cells, i)
{
const label celli = cells[i];
Cp[i] = this->cellMixture(celli).Cp(p[i], T[i]);
}
return tCp;
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::Cp() const
......@@ -449,6 +471,28 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const
{
auto tRho = tmp<scalarField>::New(T.size());
auto& rho = tRho.ref();
forAll(cells, i)
{
const label celli = cells[i];
rho[i] = this->cellMixture(celli).rho(p[i], T[i]);
}
return tRho;
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::Cv() const
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2017 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -228,6 +228,14 @@ public:
const label patchi
) const;
//- Heat capacity using pressure and temperature
virtual tmp<scalarField> CpThermo
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const;
//- Heat capacity at constant pressure [J/kg/K]
virtual tmp<volScalarField> Cp() const;
......@@ -239,6 +247,14 @@ public:
const label patchi
) const;
//- Density from pressure and temperature
virtual tmp<scalarField> rhoEoS
(
const scalarField& T,
const scalarField& p,
const labelList& cells
) const;
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment