mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: adding total isentropic pressure option
This commit is contained in:
@ -27,6 +27,7 @@ License
|
|||||||
|
|
||||||
#include "pressure.H"
|
#include "pressure.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "fluidThermo.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -51,6 +52,10 @@ Foam::word Foam::functionObjects::pressure::resultName() const
|
|||||||
{
|
{
|
||||||
rName = "total(" + fieldName_ + ")";
|
rName = "total(" + fieldName_ + ")";
|
||||||
}
|
}
|
||||||
|
else if (calcIsen_)
|
||||||
|
{
|
||||||
|
rName = "totalIsen(" + fieldName_ + ")";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rName = "static(" + fieldName_ + ")";
|
rName = "static(" + fieldName_ + ")";
|
||||||
@ -145,6 +150,21 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::pDyn
|
|||||||
tp
|
tp
|
||||||
+ rhoScale(p, 0.5*magSqr(lookupObject<volVectorField>(UName_)));
|
+ rhoScale(p, 0.5*magSqr(lookupObject<volVectorField>(UName_)));
|
||||||
}
|
}
|
||||||
|
else if (calcIsen_)
|
||||||
|
{
|
||||||
|
const fluidThermo* thermoPtr =
|
||||||
|
p.mesh().lookupObjectPtr<fluidThermo>(basicThermo::dictName);
|
||||||
|
|
||||||
|
const volScalarField gamma(thermoPtr->gamma());
|
||||||
|
|
||||||
|
const volScalarField Mb
|
||||||
|
(
|
||||||
|
mag(lookupObject<volVectorField>(UName_))
|
||||||
|
/sqrt(gamma*tp.ref()/thermoPtr->rho())
|
||||||
|
);
|
||||||
|
|
||||||
|
return tp.ref()*(pow(1 + (gamma-1)/2*sqr(Mb), gamma/(gamma-1)));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return std::move(tp);
|
return std::move(tp);
|
||||||
@ -220,6 +240,7 @@ Foam::functionObjects::pressure::pressure
|
|||||||
UName_("U"),
|
UName_("U"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
calcTotal_(false),
|
calcTotal_(false),
|
||||||
|
calcIsen_(false),
|
||||||
pRef_(0),
|
pRef_(0),
|
||||||
calcCoeff_(false),
|
calcCoeff_(false),
|
||||||
pInf_(0),
|
pInf_(0),
|
||||||
@ -252,6 +273,8 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
|
|||||||
rhoInfInitialised_ = true;
|
rhoInfInitialised_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
calcIsen_ = dict.lookupOrDefault<bool>("calcIsen", false);
|
||||||
|
|
||||||
dict.readEntry("calcTotal", calcTotal_);
|
dict.readEntry("calcTotal", calcTotal_);
|
||||||
if (calcTotal_)
|
if (calcTotal_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2012-2016 OpenFOAM Foundation
|
| Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
@ -41,6 +41,10 @@ Description
|
|||||||
\f[
|
\f[
|
||||||
p_0 = p_{ref} + p + 0.5 \rho |U|^2
|
p_0 = p_{ref} + p + 0.5 \rho |U|^2
|
||||||
\f]
|
\f]
|
||||||
|
- isentropic pressure
|
||||||
|
\f[
|
||||||
|
p_iso = p*(1 + ((gamma-1)*M^2)/2)^(gamma/(gamma - 1))
|
||||||
|
\f]
|
||||||
- static pressure coefficient
|
- static pressure coefficient
|
||||||
\f[
|
\f[
|
||||||
Cp = \frac{p - p_{\inf}}{0.5 \rho_{\inf} |U_{\inf}|^2}
|
Cp = \frac{p - p_{\inf}}{0.5 \rho_{\inf} |U_{\inf}|^2}
|
||||||
@ -61,6 +65,7 @@ Description
|
|||||||
p | Pressure [Pa]
|
p | Pressure [Pa]
|
||||||
p_0 | Total pressure [Pa]
|
p_0 | Total pressure [Pa]
|
||||||
p_{ref} | Reference pressure level [Pa]
|
p_{ref} | Reference pressure level [Pa]
|
||||||
|
p_iso | Total isentropic pressure
|
||||||
Cp | Pressure coefficient
|
Cp | Pressure coefficient
|
||||||
Cp_0 | Total pressure coefficient
|
Cp_0 | Total pressure coefficient
|
||||||
\endvartable
|
\endvartable
|
||||||
@ -71,11 +76,12 @@ Description
|
|||||||
|
|
||||||
The modes of operation are:
|
The modes of operation are:
|
||||||
\table
|
\table
|
||||||
Mode | calcTotal | calcCoeff
|
Mode | calcTotal | calcCoeff | calcIsen
|
||||||
Static pressure | no | no
|
Static pressure | no | no | no
|
||||||
Total pressure | yes | no
|
Total pressure | yes | no | no
|
||||||
Pressure coefficient | no | yes
|
Pressure coefficient | no | yes | no
|
||||||
Total pressure coefficient | yes | yes
|
Total pressure coefficient | yes | yes | no
|
||||||
|
Total isentropic pressure | no | no | yes
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
@ -100,6 +106,7 @@ Usage
|
|||||||
rho | Name of the density field | no | rho
|
rho | Name of the density field | no | rho
|
||||||
result | Name of the resulting field | no | derived from p
|
result | Name of the resulting field | no | derived from p
|
||||||
calcTotal | Calculate total coefficient | yes |
|
calcTotal | Calculate total coefficient | yes |
|
||||||
|
calcIsen | Calculate total isentropic | no | no
|
||||||
pRef | Reference pressure for total pressure | no | 0
|
pRef | Reference pressure for total pressure | no | 0
|
||||||
calcCoeff | Calculate pressure coefficient | yes |
|
calcCoeff | Calculate pressure coefficient | yes |
|
||||||
pInf | Freestream pressure for coefficient calculation | no |
|
pInf | Freestream pressure for coefficient calculation | no |
|
||||||
@ -152,6 +159,9 @@ class pressure
|
|||||||
//- Flag to calculate total pressure
|
//- Flag to calculate total pressure
|
||||||
bool calcTotal_;
|
bool calcTotal_;
|
||||||
|
|
||||||
|
//- Flag to calculate identropic total pressure
|
||||||
|
bool calcIsen_;
|
||||||
|
|
||||||
//- Reference pressure level
|
//- Reference pressure level
|
||||||
scalar pRef_;
|
scalar pRef_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user