mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
freestreamPressureFvPatchScalarField: Added support for supersonic freestream
Set the new optional switch "supersonic" to true if the freestream flow is supersonic.
This commit is contained in:
@ -37,7 +37,8 @@ freestreamPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
UName_("U")
|
||||
UName_("U"),
|
||||
supersonic_(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -50,7 +51,11 @@ freestreamPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
UName_(dict.lookupOrDefault<word>("U", "U"))
|
||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||
supersonic_
|
||||
(
|
||||
dict.lookupOrDefault<Switch>("supersonic", false)
|
||||
)
|
||||
{
|
||||
freestreamValue() = scalarField("freestreamValue", dict, p.size());
|
||||
|
||||
@ -74,37 +79,40 @@ freestreamPressureFvPatchScalarField
|
||||
Foam::freestreamPressureFvPatchScalarField::
|
||||
freestreamPressureFvPatchScalarField
|
||||
(
|
||||
const freestreamPressureFvPatchScalarField& ptf,
|
||||
const freestreamPressureFvPatchScalarField& psf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||
UName_(ptf.UName_)
|
||||
mixedFvPatchScalarField(psf, p, iF, mapper),
|
||||
UName_(psf.UName_),
|
||||
supersonic_(psf.supersonic_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::freestreamPressureFvPatchScalarField::
|
||||
freestreamPressureFvPatchScalarField
|
||||
(
|
||||
const freestreamPressureFvPatchScalarField& wbppsf
|
||||
const freestreamPressureFvPatchScalarField& psf
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(wbppsf),
|
||||
UName_(wbppsf.UName_)
|
||||
mixedFvPatchScalarField(psf),
|
||||
UName_(psf.UName_),
|
||||
supersonic_(psf.supersonic_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::freestreamPressureFvPatchScalarField::
|
||||
freestreamPressureFvPatchScalarField
|
||||
(
|
||||
const freestreamPressureFvPatchScalarField& wbppsf,
|
||||
const freestreamPressureFvPatchScalarField& psf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(wbppsf, iF),
|
||||
UName_(wbppsf.UName_)
|
||||
mixedFvPatchScalarField(psf, iF),
|
||||
UName_(psf.UName_),
|
||||
supersonic_(psf.supersonic_)
|
||||
{}
|
||||
|
||||
|
||||
@ -123,7 +131,14 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
|
||||
UName_
|
||||
);
|
||||
|
||||
if (supersonic_)
|
||||
{
|
||||
valueFraction() = 0.5 - 0.5*(Up & patch().nf())/mag(Up);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueFraction() = 0.5 + 0.5*(Up & patch().nf())/mag(Up);
|
||||
}
|
||||
|
||||
mixedFvPatchField<scalar>::updateCoeffs();
|
||||
}
|
||||
@ -134,6 +149,7 @@ void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const
|
||||
fvPatchScalarField::write(os);
|
||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||
freestreamValue().writeEntry("freestreamValue", os);
|
||||
os.writeKeyword("supersonic") << supersonic_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
U | velocity field name | no | U
|
||||
freestreamValue | freestream pressure | yes |
|
||||
supersonic | Switch for supersonic flow | no | false
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -86,6 +87,9 @@ class freestreamPressureFvPatchScalarField
|
||||
//- Name of the velocity field
|
||||
word UName_;
|
||||
|
||||
//- Set true for supersonic freestream
|
||||
Switch supersonic_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user