mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: fan/jump BCs - updated construction
This commit is contained in:
@ -48,10 +48,11 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const bool valueRequired
|
||||
)
|
||||
:
|
||||
coupledFvPatchField<Type>(p, iF, dict, false),
|
||||
coupledFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired
|
||||
cyclicPatch_(refCast<const cyclicFvPatch>(p, dict))
|
||||
{
|
||||
if (!isA<cyclicFvPatch>(p))
|
||||
@ -65,7 +66,10 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
if (valueRequired)
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -111,7 +111,8 @@ public:
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const bool valueRequired = true
|
||||
);
|
||||
|
||||
//- Construct by mapping given cyclicFvPatchField onto a new patch
|
||||
|
||||
@ -59,10 +59,11 @@ Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const bool valueRequired
|
||||
)
|
||||
:
|
||||
cyclicFvPatchField<Type>(p, iF, dict)
|
||||
cyclicFvPatchField<Type>(p, iF, dict, false) // Pass no valueRequired
|
||||
{
|
||||
// Call this evaluation in derived classes
|
||||
//this->evaluate(Pstream::commsTypes::blocking);
|
||||
|
||||
@ -82,7 +82,8 @@ public:
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const bool valueRequired = true
|
||||
);
|
||||
|
||||
//- Construct by mapping given jumpCyclicFvPatchField onto a new patch
|
||||
|
||||
@ -240,14 +240,6 @@ public:
|
||||
template<>
|
||||
void fanFvPatchField<scalar>::calcFanJump();
|
||||
|
||||
template<>
|
||||
fanFvPatchField<scalar>::fanFvPatchField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -86,49 +86,6 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
uniformJumpFvPatchField<scalar>(p, iF, dict),
|
||||
phiName_(dict.getOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.getOrDefault<word>("rho", "rho")),
|
||||
uniformJump_(dict.getOrDefault("uniformJump", false)),
|
||||
nonDimensional_(dict.getOrDefault("nonDimensional", false)),
|
||||
rpm_(0),
|
||||
dm_(0)
|
||||
{
|
||||
if (nonDimensional_)
|
||||
{
|
||||
dict.readEntry("rpm", rpm_);
|
||||
dict.readEntry("dm", dm_);
|
||||
}
|
||||
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
this->jumpTable_ = Function1<scalar>::New("jumpTable", dict);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchScalarField::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -69,10 +69,11 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const bool valueRequired
|
||||
)
|
||||
:
|
||||
jumpCyclicFvPatchField<Type>(p, iF, dict),
|
||||
jumpCyclicFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired
|
||||
jump_(p.size(), Zero),
|
||||
jump0_(p.size(), Zero),
|
||||
minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)),
|
||||
@ -81,7 +82,10 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
jump_ = Field<Type>("jump", dict, p.size());
|
||||
if (valueRequired)
|
||||
{
|
||||
jump_ = Field<Type>("jump", dict, p.size());
|
||||
}
|
||||
|
||||
if (dict.found("jump0"))
|
||||
{
|
||||
@ -89,16 +93,19 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
if (valueRequired)
|
||||
{
|
||||
fvPatchField<Type>::operator=
|
||||
(
|
||||
Field<Type>("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchField<Type>::operator=
|
||||
(
|
||||
Field<Type>("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,7 +127,8 @@ public:
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const bool valueRequired = true
|
||||
);
|
||||
|
||||
//- Construct by mapping given fixedJumpFvPatchField onto a
|
||||
|
||||
@ -60,27 +60,31 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const bool valueRequired
|
||||
)
|
||||
:
|
||||
fixedJumpFvPatchField<Type>(p, iF, dict),
|
||||
fixedJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired
|
||||
jumpTable_()
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
if (valueRequired)
|
||||
{
|
||||
jumpTable_ = Function1<Type>::New("jumpTable", dict);
|
||||
}
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
jumpTable_ = Function1<Type>::New("jumpTable", dict);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchField<Type>::operator=
|
||||
(
|
||||
Field<Type>("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchField<Type>::operator=
|
||||
(
|
||||
Field<Type>("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,8 @@ public:
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<Type, volMesh>&,
|
||||
const dictionary&
|
||||
const dictionary&,
|
||||
const bool valueRequired = true
|
||||
);
|
||||
|
||||
//- Construct by mapping given uniformJumpFvPatchField onto a
|
||||
|
||||
Reference in New Issue
Block a user