derived bcs: consistent treatment of "phi" and "rho" lookups, etc

This commit is contained in:
Mark Olesen 2008-09-19 11:13:44 +02:00
parent 7f0b671aba
commit 84d30b99d7
23 changed files with 309 additions and 288 deletions

View File

@ -47,8 +47,8 @@ advectiveFvPatchField<Type>::advectiveFvPatchField
)
:
mixedFvPatchField<Type>(p, iF),
phiName_("Undefined"),
rhoName_("Undefined"),
phiName_("phi"),
rhoName_("rho"),
fieldInf_(pTraits<Type>::zero),
lInf_(0.0)
{
@ -84,8 +84,8 @@ advectiveFvPatchField<Type>::advectiveFvPatchField
)
:
mixedFvPatchField<Type>(p, iF),
phiName_(dict.lookup("phi")),
rhoName_("Undefined"),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
fieldInf_(pTraits<Type>::zero),
lInf_(0.0)
{
@ -105,15 +105,9 @@ advectiveFvPatchField<Type>::advectiveFvPatchField
this->refGrad() = pTraits<Type>::zero;
this->valueFraction() = 0.0;
if (dict.found("rho"))
{
dict.lookup("rho") >> rhoName_;
}
if (dict.found("lInf"))
if (dict.readIfPresent("lInf", lInf_))
{
dict.lookup("fieldInf") >> fieldInf_;
dict.lookup("lInf") >> lInf_;
if (lInf_ < 0.0)
{
@ -123,8 +117,8 @@ advectiveFvPatchField<Type>::advectiveFvPatchField
"advectiveFvPatchField"
"(const fvPatch&, const Field<Type>&, const dictionary&)",
dict
) << "unphysical lInf_ specified (lInf_ < 0)"
<< "\n on patch " << this->patch().name()
) << "unphysical lInf specified (lInf < 0)\n"
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalIOError);
@ -167,7 +161,7 @@ advectiveFvPatchField<Type>::advectiveFvPatchField
template<class Type>
tmp<scalarField> advectiveFvPatchField<Type>::advectionSpeed() const
{
const surfaceScalarField& phi =
const surfaceScalarField& phi =
this->db().objectRegistry::lookupObject<surfaceScalarField>(phiName_);
fvsPatchField<scalar> phip = this->patch().lookupPatchField
@ -210,7 +204,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
);
scalar deltaT = this->db().time().deltaT().value();
const GeometricField<Type, fvPatchField, volMesh>& field =
const GeometricField<Type, fvPatchField, volMesh>& field =
this->db().objectRegistry::
lookupObject<GeometricField<Type, fvPatchField, volMesh> >
(
@ -239,7 +233,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
|| ddtScheme == fv::CrankNicholsonDdtScheme<scalar>::typeName
)
{
this->refValue() =
this->refValue() =
(
field.oldTime().boundaryField()[patchi] + k*fieldInf_
)/(1.0 + k);
@ -314,9 +308,12 @@ template<class Type>
void advectiveFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
if (rhoName_ != "Undefined")
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
@ -324,9 +321,9 @@ void advectiveFvPatchField<Type>::write(Ostream& os) const
if (lInf_ > SMALL)
{
os.writeKeyword("fieldInf") << fieldInf_
<< token::END_STATEMENT << endl;
<< token::END_STATEMENT << nl;
os.writeKeyword("lInf") << lInf_
<< token::END_STATEMENT << endl;
<< token::END_STATEMENT << nl;
}
this->writeEntry("value", os);

View File

@ -238,11 +238,11 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
const word& fieldName = dimensionedInternalField().name();
const volVectorField& UField = db().lookupObject<volVectorField>(fieldName);
surfaceScalarField& phiField =
const_cast<surfaceScalarField&>
(
db().lookupObject<surfaceScalarField>(phiName_)
);
surfaceScalarField& phiField = const_cast<surfaceScalarField&>
(
db().lookupObject<surfaceScalarField>(phiName_)
);
switch (mpp.mode())
{

View File

@ -52,11 +52,9 @@ void fanFvPatchField<scalar>::updateCoeffs()
if (f_.size() > 1)
{
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
(
"phi"
);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>("phi");
const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi);

View File

@ -30,28 +30,23 @@ License
#include "surfaceFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
UName_("Undefined"),
phiName_("Undefined"),
rhoName_("Undefined"),
UName_("U"),
phiName_("phi"),
rhoName_("rho"),
adjoint_(false)
{}
fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
(
const fixedFluxPressureFvPatchScalarField& ptf,
const fvPatch& p,
@ -67,7 +62,7 @@ fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
{}
fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
@ -75,9 +70,9 @@ fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
)
:
fixedGradientFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
rhoName_(dict.lookup("rho")),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
adjoint_(dict.lookup("adjoint"))
{
if (dict.found("gradient"))
@ -94,7 +89,7 @@ fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
}
fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
(
const fixedFluxPressureFvPatchScalarField& wbppsf
)
@ -107,7 +102,7 @@ fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
{}
fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
(
const fixedFluxPressureFvPatchScalarField& wbppsf,
const DimensionedField<scalar, volMesh>& iF
@ -123,7 +118,7 @@ fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void fixedFluxPressureFvPatchScalarField::updateCoeffs()
void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
@ -133,8 +128,9 @@ void fixedFluxPressureFvPatchScalarField::updateCoeffs()
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
const surfaceScalarField& phi =
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
fvsPatchField<scalar> phip =
patch().patchField<surfaceScalarField, scalar>(phi);
@ -162,12 +158,21 @@ void fixedFluxPressureFvPatchScalarField::updateCoeffs()
}
void fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
if (UName_ != "U")
{
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("adjoint") << adjoint_ << token::END_STATEMENT << nl;
gradient().writeEntry("gradient", os);
}
@ -175,10 +180,13 @@ void fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, fixedFluxPressureFvPatchScalarField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
fixedFluxPressureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -75,19 +75,9 @@ flowRateInletVelocityFvPatchVectorField
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(readScalar(dict.lookup("flowRate"))),
phiName_("phi"),
rhoName_("rho")
{
if (dict.found("phi"))
{
dict.lookup("phi") >> phiName_;
}
if (dict.found("rho"))
{
dict.lookup("rho") >> rhoName_;
}
}
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{}
Foam::
@ -133,10 +123,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
(
phiName_
);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
{
@ -170,20 +158,15 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
os.writeKeyword("flowRate") << flowRate_
<< token::END_STATEMENT << nl;
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntry("value", os);
}

View File

@ -32,12 +32,9 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
fluxCorrectedVelocityFvPatchVectorField::
Foam::fluxCorrectedVelocityFvPatchVectorField::
fluxCorrectedVelocityFvPatchVectorField
(
const fvPatch& p,
@ -50,7 +47,7 @@ fluxCorrectedVelocityFvPatchVectorField
{}
fluxCorrectedVelocityFvPatchVectorField::
Foam::fluxCorrectedVelocityFvPatchVectorField::
fluxCorrectedVelocityFvPatchVectorField
(
const fluxCorrectedVelocityFvPatchVectorField& ptf,
@ -65,7 +62,7 @@ fluxCorrectedVelocityFvPatchVectorField
{}
fluxCorrectedVelocityFvPatchVectorField::
Foam::fluxCorrectedVelocityFvPatchVectorField::
fluxCorrectedVelocityFvPatchVectorField
(
const fvPatch& p,
@ -81,7 +78,7 @@ fluxCorrectedVelocityFvPatchVectorField
}
fluxCorrectedVelocityFvPatchVectorField::
Foam::fluxCorrectedVelocityFvPatchVectorField::
fluxCorrectedVelocityFvPatchVectorField
(
const fluxCorrectedVelocityFvPatchVectorField& fcvpvf,
@ -96,7 +93,7 @@ fluxCorrectedVelocityFvPatchVectorField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void fluxCorrectedVelocityFvPatchVectorField::evaluate
void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate
(
const Pstream::commsTypes
)
@ -130,9 +127,12 @@ void fluxCorrectedVelocityFvPatchVectorField::evaluate
}
else
{
FatalErrorIn("fluxCorrectedVelocityFvPatchVectorField::evaluate()")
<< "dimensions of phi are not correct"
<< "\n on patch " << this->patch().name()
FatalErrorIn
(
"fluxCorrectedVelocityFvPatchVectorField::evaluate()"
)
<< "dimensions of phi are incorrect\n"
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalError);
@ -140,25 +140,30 @@ void fluxCorrectedVelocityFvPatchVectorField::evaluate
}
void fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const
void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchVectorField,
fluxCorrectedVelocityFvPatchVectorField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
fluxCorrectedVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -72,7 +72,7 @@ inletOutletFvPatchField<Type>::inletOutletFvPatchField
)
:
mixedFvPatchField<Type>(p, iF),
phiName_("phi")
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
{
this->refValue() = Field<Type>("inletValue", dict, p.size());
@ -90,11 +90,6 @@ inletOutletFvPatchField<Type>::inletOutletFvPatchField
this->refGrad() = pTraits<Type>::zero;
this->valueFraction() = 0.0;
if (dict.found("phi"))
{
dict.lookup("phi") >> phiName_;
}
}
@ -150,8 +145,7 @@ void inletOutletFvPatchField<Type>::write(Ostream& os) const
fvPatchField<Type>::write(os);
if (phiName_ != "phi")
{
os.writeKeyword("phi")
<< phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
this->refValue().writeEntry("inletValue", os);
this->writeEntry("value", os);

View File

@ -32,12 +32,9 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inletOutletTotalTemperatureFvPatchScalarField::
Foam::inletOutletTotalTemperatureFvPatchScalarField::
inletOutletTotalTemperatureFvPatchScalarField
(
const fvPatch& p,
@ -45,9 +42,9 @@ inletOutletTotalTemperatureFvPatchScalarField
)
:
mixedFvPatchScalarField(p, iF),
UName_(),
phiName_(),
psiName_(),
UName_("U"),
phiName_("phi"),
psiName_("psi"),
gamma_(0.0),
T0_(p.size(), 0.0)
{
@ -57,7 +54,7 @@ inletOutletTotalTemperatureFvPatchScalarField
}
inletOutletTotalTemperatureFvPatchScalarField::
Foam::inletOutletTotalTemperatureFvPatchScalarField::
inletOutletTotalTemperatureFvPatchScalarField
(
const inletOutletTotalTemperatureFvPatchScalarField& ptf,
@ -75,7 +72,7 @@ inletOutletTotalTemperatureFvPatchScalarField
{}
inletOutletTotalTemperatureFvPatchScalarField::
Foam::inletOutletTotalTemperatureFvPatchScalarField::
inletOutletTotalTemperatureFvPatchScalarField
(
const fvPatch& p,
@ -84,9 +81,9 @@ inletOutletTotalTemperatureFvPatchScalarField
)
:
mixedFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
psiName_(dict.lookup("psi")),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
psiName_(dict.lookupOrDefault<word>("psi", "psi")),
gamma_(readScalar(dict.lookup("gamma"))),
T0_("T0", dict, p.size())
{
@ -108,7 +105,7 @@ inletOutletTotalTemperatureFvPatchScalarField
}
inletOutletTotalTemperatureFvPatchScalarField::
Foam::inletOutletTotalTemperatureFvPatchScalarField::
inletOutletTotalTemperatureFvPatchScalarField
(
const inletOutletTotalTemperatureFvPatchScalarField& tppsf
@ -123,7 +120,7 @@ inletOutletTotalTemperatureFvPatchScalarField
{}
inletOutletTotalTemperatureFvPatchScalarField::
Foam::inletOutletTotalTemperatureFvPatchScalarField::
inletOutletTotalTemperatureFvPatchScalarField
(
const inletOutletTotalTemperatureFvPatchScalarField& tppsf,
@ -141,7 +138,7 @@ inletOutletTotalTemperatureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void inletOutletTotalTemperatureFvPatchScalarField::autoMap
void Foam::inletOutletTotalTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
@ -151,7 +148,7 @@ void inletOutletTotalTemperatureFvPatchScalarField::autoMap
}
void inletOutletTotalTemperatureFvPatchScalarField::rmap
void Foam::inletOutletTotalTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
@ -166,7 +163,7 @@ void inletOutletTotalTemperatureFvPatchScalarField::rmap
}
void inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
@ -192,13 +189,22 @@ void inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
}
void inletOutletTotalTemperatureFvPatchScalarField::write(Ostream& os) const
void Foam::inletOutletTotalTemperatureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << endl;
if (UName_ != "U")
{
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "psi")
{
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
T0_.writeEntry("T0", os);
writeEntry("value", os);
}
@ -206,14 +212,13 @@ void inletOutletTotalTemperatureFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
inletOutletTotalTemperatureFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
inletOutletTotalTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -128,10 +128,8 @@ void Foam::massFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
(
phiName_
);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
if (phi.dimensions() == dimVelocity*dimArea)
{

View File

@ -115,7 +115,7 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs()
vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaT().value();
const volVectorField& U = db().lookupObject<volVectorField>("U");
scalarField phip =
scalarField phip =
p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U));
vectorField n = p.nf();

View File

@ -196,8 +196,14 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::
write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
inletDir_.writeEntry("inletDirection", os);
writeEntry("value", os);
}

View File

@ -184,8 +184,14 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
void pressureDirectedInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
inletDir_.writeEntry("inletDirection", os);
writeEntry("value", os);
}

View File

@ -80,15 +80,10 @@ pressureInletOutletVelocityFvPatchVectorField
)
:
directionMixedFvPatchVectorField(p, iF),
phiName_("phi")
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
if (dict.found("phi"))
{
dict.lookup("phi") >> phiName_;
}
if (dict.found("tangentialVelocity"))
{
setTangentialVelocity
@ -193,7 +188,10 @@ void pressureInletOutletVelocityFvPatchVectorField::updateCoeffs()
void pressureInletOutletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (tangentialVelocity_.size())
{
tangentialVelocity_.writeEntry("tangentialVelocity", os);

View File

@ -109,10 +109,8 @@ void pressureInletVelocityFvPatchVectorField::updateCoeffs()
return;
}
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
(
phiName_
);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi);
@ -148,8 +146,14 @@ void pressureInletVelocityFvPatchVectorField::updateCoeffs()
void pressureInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntry("value", os);
}

View File

@ -123,7 +123,7 @@ void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
}
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
db().lookupObject<surfaceScalarField>(phiName_);
const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi);

View File

@ -198,10 +198,8 @@ void syringePressureFvPatchScalarField::updateCoeffs()
scalar t = db().time().value();
scalar deltaT = db().time().deltaT().value();
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
(
"phi"
);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>("phi");
const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi);

View File

@ -95,7 +95,7 @@ timeVaryingMappedFixedValueFvPatchField
{
if (debug)
{
Pout<< "timeVarying<appedFixedValue"
Pout<< "timeVaryingMappedFixedValue"
<< " : construct from mappedFixedValue and mapper" << endl;
}
}

View File

@ -40,13 +40,13 @@ timeVaryingUniformTotalPressureFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("undefined"),
phiName_("undefined"),
rhoName_("undefined"),
psiName_("undefined"),
UName_("U"),
phiName_("phi"),
rhoName_("none"),
psiName_("none"),
gamma_(0.0),
p0_(0.0),
totalPressureTimeSeries_()
timeSeries_()
{}
@ -59,13 +59,13 @@ timeVaryingUniformTotalPressureFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
rhoName_(dict.lookup("rho")),
psiName_(dict.lookup("psi")),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "none")),
psiName_(dict.lookupOrDefault<word>("psi", "none")),
gamma_(readScalar(dict.lookup("gamma"))),
p0_(readScalar(dict.lookup("p0"))),
totalPressureTimeSeries_(dict)
timeSeries_(dict)
{
if (dict.found("value"))
{
@ -97,7 +97,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
psiName_(ptf.psiName_),
gamma_(ptf.gamma_),
p0_(ptf.p0_),
totalPressureTimeSeries_(ptf.totalPressureTimeSeries_)
timeSeries_(ptf.timeSeries_)
{}
@ -114,7 +114,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
psiName_(tppsf.psiName_),
gamma_(tppsf.gamma_),
p0_(tppsf.p0_),
totalPressureTimeSeries_(tppsf.totalPressureTimeSeries_)
timeSeries_(tppsf.timeSeries_)
{}
@ -132,7 +132,7 @@ timeVaryingUniformTotalPressureFvPatchScalarField
psiName_(tppsf.psiName_),
gamma_(tppsf.gamma_),
p0_(tppsf.p0_),
totalPressureTimeSeries_(tppsf.totalPressureTimeSeries_)
timeSeries_(tppsf.timeSeries_)
{}
@ -148,7 +148,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
return;
}
p0_ = totalPressureTimeSeries_(this->db().time().timeOutputValue());
p0_ = timeSeries_(this->db().time().timeOutputValue());
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
@ -194,11 +194,11 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
(
"timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs()"
) << " rho or psi set inconsitently, rho = " << rhoName_
<< ", psi = " << psiName_ << '.' << nl
<< ", psi = " << psiName_ << ".\n"
<< " Set either rho or psi or neither depending on the "
"definition of total pressure." << nl
<< " Set the unused variables to 'none'."
<< "\n on patch " << this->patch().name()
"definition of total pressure.\n"
<< " Set the unused variables to 'none'.\n"
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalError);
@ -218,13 +218,19 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::
write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
if (UName_ != "U")
{
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
os.writeKeyword("p0") << p0_ << token::END_STATEMENT << endl;
totalPressureTimeSeries_.write(os);
os.writeKeyword("p0") << p0_ << token::END_STATEMENT << nl;
timeSeries_.write(os);
writeEntry("value", os);
}

View File

@ -77,8 +77,8 @@ class timeVaryingUniformTotalPressureFvPatchScalarField
//- Total pressure
scalar p0_;
//- Table of time vs total pressure
interpolationTable<scalar> totalPressureTimeSeries_;
//- Table of time vs total pressure, including the bounding treatment
interpolationTable<scalar> timeSeries_;
public:
@ -192,7 +192,7 @@ public:
//- Return the time series used
const interpolationTable<scalar>& totalPressureTimeSeries() const
{
return totalPressureTimeSeries_;
return timeSeries_;
}

View File

@ -32,28 +32,25 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("undefined"),
phiName_("undefined"),
rhoName_("undefined"),
psiName_("undefined"),
UName_("U"),
phiName_("phi"),
rhoName_("none"),
psiName_("none"),
gamma_(0.0),
p0_(p.size(), 0.0)
{}
totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
@ -61,10 +58,10 @@ totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
rhoName_(dict.lookup("rho")),
psiName_(dict.lookup("psi")),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "none")),
psiName_(dict.lookupOrDefault<word>("psi", "none")),
gamma_(readScalar(dict.lookup("gamma"))),
p0_("p0", dict, p.size())
{
@ -82,7 +79,7 @@ totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
}
totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
(
const totalPressureFvPatchScalarField& ptf,
const fvPatch& p,
@ -100,7 +97,7 @@ totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
{}
totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
(
const totalPressureFvPatchScalarField& tppsf
)
@ -115,7 +112,7 @@ totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
{}
totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
(
const totalPressureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
@ -133,7 +130,7 @@ totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void totalPressureFvPatchScalarField::autoMap
void Foam::totalPressureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
@ -143,7 +140,7 @@ void totalPressureFvPatchScalarField::autoMap
}
void totalPressureFvPatchScalarField::rmap
void Foam::totalPressureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
@ -158,7 +155,7 @@ void totalPressureFvPatchScalarField::rmap
}
void totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
{
if (updated())
{
@ -208,12 +205,12 @@ void totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
FatalErrorIn
(
"totalPressureFvPatchScalarField::updateCoeffs()"
) << " rho or psi set inconsitently, rho = " << rhoName_
<< ", psi = " << psiName_ << '.' << nl
) << " rho or psi set inconsistently, rho = " << rhoName_
<< ", psi = " << psiName_ << ".\n"
<< " Set either rho or psi or neither depending on the "
"definition of total pressure." << nl
<< " Set the unused variables to 'none'."
<< "\n on patch " << this->patch().name()
<< " Set the unused variable(s) to 'none'.\n"
<< " on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< exit(FatalError);
@ -223,20 +220,26 @@ void totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
}
void totalPressureFvPatchScalarField::updateCoeffs()
void Foam::totalPressureFvPatchScalarField::updateCoeffs()
{
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
}
void totalPressureFvPatchScalarField::write(Ostream& os) const
void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
if (UName_ != "U")
{
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << endl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
p0_.writeEntry("p0", os);
writeEntry("value", os);
}
@ -244,10 +247,13 @@ void totalPressureFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, totalPressureFvPatchScalarField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
totalPressureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -32,27 +32,24 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("Undefined"),
phiName_("Undefined"),
psiName_("Undefined"),
UName_("U"),
phiName_("phi"),
psiName_("psi"),
gamma_(0.0),
T0_(p.size(), 0.0)
{}
totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
(
const totalTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
@ -69,7 +66,7 @@ totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
{}
totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
@ -77,9 +74,9 @@ totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
psiName_(dict.lookup("psi")),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
psiName_(dict.lookupOrDefault<word>("psi", "psi")),
gamma_(readScalar(dict.lookup("gamma"))),
T0_("T0", dict, p.size())
{
@ -97,7 +94,7 @@ totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
}
totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
(
const totalTemperatureFvPatchScalarField& tppsf
)
@ -111,7 +108,7 @@ totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
{}
totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
(
const totalTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
@ -128,7 +125,7 @@ totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void totalTemperatureFvPatchScalarField::autoMap
void Foam::totalTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
@ -138,7 +135,7 @@ void totalTemperatureFvPatchScalarField::autoMap
}
void totalTemperatureFvPatchScalarField::rmap
void Foam::totalTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
@ -153,7 +150,7 @@ void totalTemperatureFvPatchScalarField::rmap
}
void totalTemperatureFvPatchScalarField::updateCoeffs()
void Foam::totalTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
@ -180,13 +177,22 @@ void totalTemperatureFvPatchScalarField::updateCoeffs()
}
void totalTemperatureFvPatchScalarField::write(Ostream& os) const
void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << endl;
if (UName_ != "U")
{
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "psi")
{
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
T0_.writeEntry("T0", os);
writeEntry("value", os);
}
@ -194,10 +200,13 @@ void totalTemperatureFvPatchScalarField::write(Ostream& os) const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, totalTemperatureFvPatchScalarField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
totalTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -30,14 +30,9 @@ License
#include "surfaceFields.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentIntensityKineticEnergyInletFvPatchScalarField::
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
turbulentIntensityKineticEnergyInletFvPatchScalarField
(
const fvPatch& p,
@ -48,7 +43,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
intensity_(0.05)
{}
turbulentIntensityKineticEnergyInletFvPatchScalarField::
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
turbulentIntensityKineticEnergyInletFvPatchScalarField
(
const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf,
@ -61,7 +56,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
intensity_(ptf.intensity_)
{}
turbulentIntensityKineticEnergyInletFvPatchScalarField::
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
turbulentIntensityKineticEnergyInletFvPatchScalarField
(
const fvPatch& p,
@ -90,7 +85,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
}
}
turbulentIntensityKineticEnergyInletFvPatchScalarField::
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
turbulentIntensityKineticEnergyInletFvPatchScalarField
(
const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf
@ -100,7 +95,8 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
intensity_(ptf.intensity_)
{}
turbulentIntensityKineticEnergyInletFvPatchScalarField::
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
turbulentIntensityKineticEnergyInletFvPatchScalarField
(
const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf,
@ -114,7 +110,8 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulentIntensityKineticEnergyInletFvPatchScalarField::updateCoeffs()
void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
updateCoeffs()
{
if (updated())
{
@ -130,7 +127,7 @@ void turbulentIntensityKineticEnergyInletFvPatchScalarField::updateCoeffs()
}
void turbulentIntensityKineticEnergyInletFvPatchScalarField::write
void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write
(
Ostream& os
) const
@ -143,15 +140,13 @@ void turbulentIntensityKineticEnergyInletFvPatchScalarField::write
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
turbulentIntensityKineticEnergyInletFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
turbulentIntensityKineticEnergyInletFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -47,7 +47,7 @@ waveTransmissiveFvPatchField<Type>::waveTransmissiveFvPatchField
)
:
advectiveFvPatchField<Type>(p, iF),
psiName_("Undefined"),
psiName_("psi"),
gamma_(0.0)
{}
@ -76,7 +76,7 @@ waveTransmissiveFvPatchField<Type>::waveTransmissiveFvPatchField
)
:
advectiveFvPatchField<Type>(p, iF, dict),
psiName_(dict.lookup("psi")),
psiName_(dict.lookupOrDefault<word>("psi", "psi")),
gamma_(readScalar(dict.lookup("gamma")))
{}
@ -119,7 +119,7 @@ tmp<scalarField> waveTransmissiveFvPatchField<Type>::advectionSpeed() const
reinterpret_cast<const scalar*>(NULL)
);
const surfaceScalarField& phi =
const surfaceScalarField& phi =
this->db().objectRegistry::lookupObject<surfaceScalarField>
(this->phiName_);
@ -153,22 +153,27 @@ template<class Type>
void waveTransmissiveFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl;
if (this->rhoName_ != "Undefined")
if (this->phiName_ != "phi")
{
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl;
}
if (this->rhoName_ != "rho")
{
os.writeKeyword("rho") << this->rhoName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << endl;
if (psiName_ != "psi")
{
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
}
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
if (this->lInf_ > SMALL)
{
os.writeKeyword("fieldInf") << this->fieldInf_
<< token::END_STATEMENT << endl;
os.writeKeyword("lInf") << this->lInf_
<< token::END_STATEMENT << endl;
<< token::END_STATEMENT << nl;
os.writeKeyword("lInf") << this->lInf_
<< token::END_STATEMENT << nl;
}
this->writeEntry("value", os);