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),
|
mixedFvPatchScalarField(p, iF),
|
||||||
UName_("U")
|
UName_("U"),
|
||||||
|
supersonic_(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +51,11 @@ freestreamPressureFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
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());
|
freestreamValue() = scalarField("freestreamValue", dict, p.size());
|
||||||
|
|
||||||
@ -74,37 +79,40 @@ freestreamPressureFvPatchScalarField
|
|||||||
Foam::freestreamPressureFvPatchScalarField::
|
Foam::freestreamPressureFvPatchScalarField::
|
||||||
freestreamPressureFvPatchScalarField
|
freestreamPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const freestreamPressureFvPatchScalarField& ptf,
|
const freestreamPressureFvPatchScalarField& psf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
mixedFvPatchScalarField(psf, p, iF, mapper),
|
||||||
UName_(ptf.UName_)
|
UName_(psf.UName_),
|
||||||
|
supersonic_(psf.supersonic_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::freestreamPressureFvPatchScalarField::
|
Foam::freestreamPressureFvPatchScalarField::
|
||||||
freestreamPressureFvPatchScalarField
|
freestreamPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const freestreamPressureFvPatchScalarField& wbppsf
|
const freestreamPressureFvPatchScalarField& psf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(wbppsf),
|
mixedFvPatchScalarField(psf),
|
||||||
UName_(wbppsf.UName_)
|
UName_(psf.UName_),
|
||||||
|
supersonic_(psf.supersonic_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::freestreamPressureFvPatchScalarField::
|
Foam::freestreamPressureFvPatchScalarField::
|
||||||
freestreamPressureFvPatchScalarField
|
freestreamPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const freestreamPressureFvPatchScalarField& wbppsf,
|
const freestreamPressureFvPatchScalarField& psf,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(wbppsf, iF),
|
mixedFvPatchScalarField(psf, iF),
|
||||||
UName_(wbppsf.UName_)
|
UName_(psf.UName_),
|
||||||
|
supersonic_(psf.supersonic_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -123,7 +131,14 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
|
|||||||
UName_
|
UName_
|
||||||
);
|
);
|
||||||
|
|
||||||
valueFraction() = 0.5 + 0.5*(Up & patch().nf())/mag(Up);
|
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();
|
mixedFvPatchField<scalar>::updateCoeffs();
|
||||||
}
|
}
|
||||||
@ -134,6 +149,7 @@ void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const
|
|||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||||
freestreamValue().writeEntry("freestreamValue", os);
|
freestreamValue().writeEntry("freestreamValue", os);
|
||||||
|
os.writeKeyword("supersonic") << supersonic_ << token::END_STATEMENT << nl;
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,9 +36,10 @@ Description
|
|||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
U | velocity field name | no | U
|
U | velocity field name | no | U
|
||||||
freestreamValue | freestream pressure | yes |
|
freestreamValue | freestream pressure | yes |
|
||||||
|
supersonic | Switch for supersonic flow | no | false
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -86,6 +87,9 @@ class freestreamPressureFvPatchScalarField
|
|||||||
//- Name of the velocity field
|
//- Name of the velocity field
|
||||||
word UName_;
|
word UName_;
|
||||||
|
|
||||||
|
//- Set true for supersonic freestream
|
||||||
|
Switch supersonic_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user