Merge branch 'bugfix-fan' into 'develop'

Hot fixes for v2106

See merge request Development/openfoam!474
This commit is contained in:
Mattijs Janssens
2021-06-24 11:06:35 +00:00
12 changed files with 88 additions and 90 deletions

View File

@ -48,10 +48,11 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, 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)) cyclicPatch_(refCast<const cyclicFvPatch>(p, dict))
{ {
if (!isA<cyclicFvPatch>(p)) if (!isA<cyclicFvPatch>(p))
@ -65,8 +66,11 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
<< exit(FatalIOError); << exit(FatalIOError);
} }
if (valueRequired)
{
this->evaluate(Pstream::commsTypes::blocking); this->evaluate(Pstream::commsTypes::blocking);
} }
}
template<class Type> template<class Type>

View File

@ -111,7 +111,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary& const dictionary&,
const bool valueRequired = true
); );
//- Construct by mapping given cyclicFvPatchField onto a new patch //- Construct by mapping given cyclicFvPatchField onto a new patch

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -59,10 +59,11 @@ Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const dictionary& dict const dictionary& dict,
const bool valueRequired
) )
: :
cyclicFvPatchField<Type>(p, iF, dict) cyclicFvPatchField<Type>(p, iF, dict, valueRequired)
{ {
// Call this evaluation in derived classes // Call this evaluation in derived classes
//this->evaluate(Pstream::commsTypes::blocking); //this->evaluate(Pstream::commsTypes::blocking);

View File

@ -82,7 +82,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary& const dictionary&,
const bool valueRequired = true
); );
//- Construct by mapping given jumpCyclicFvPatchField onto a new patch //- Construct by mapping given jumpCyclicFvPatchField onto a new patch

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,7 +67,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
uniformJumpFvPatchField<Type>(p, iF, dict), uniformJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired
phiName_(dict.getOrDefault<word>("phi", "phi")), phiName_(dict.getOrDefault<word>("phi", "phi")),
rhoName_(dict.getOrDefault<word>("rho", "rho")), rhoName_(dict.getOrDefault<word>("rho", "rho")),
uniformJump_(dict.getOrDefault("uniformJump", false)), uniformJump_(dict.getOrDefault("uniformJump", false)),
@ -75,11 +75,29 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
rpm_(0), rpm_(0),
dm_(0) dm_(0)
{ {
// Note that we've not read jumpTable_ etc
if (nonDimensional_) if (nonDimensional_)
{ {
dict.readEntry("rpm", rpm_); dict.readEntry("rpm", rpm_);
dict.readEntry("dm", dm_); dict.readEntry("dm", dm_);
} }
if (this->cyclicPatch().owner())
{
this->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);
}
} }

View File

@ -240,14 +240,6 @@ public:
template<> template<>
void fanFvPatchField<scalar>::calcFanJump(); void fanFvPatchField<scalar>::calcFanJump();
template<>
fanFvPatchField<scalar>::fanFvPatchField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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 namespace Foam

View File

@ -69,10 +69,11 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, 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), jump_(p.size(), Zero),
jump0_(p.size(), Zero), jump0_(p.size(), Zero),
minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)), minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)),
@ -80,8 +81,11 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
timeIndex_(this->db().time().timeIndex()) timeIndex_(this->db().time().timeIndex())
{ {
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{
if (valueRequired)
{ {
jump_ = Field<Type>("jump", dict, p.size()); jump_ = Field<Type>("jump", dict, p.size());
}
if (dict.found("jump0")) if (dict.found("jump0"))
{ {
@ -89,6 +93,8 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
} }
} }
if (valueRequired)
{
if (dict.found("value")) if (dict.found("value"))
{ {
fvPatchField<Type>::operator= fvPatchField<Type>::operator=
@ -101,6 +107,7 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
this->evaluate(Pstream::commsTypes::blocking); this->evaluate(Pstream::commsTypes::blocking);
} }
} }
}
template<class Type> template<class Type>

View File

@ -127,7 +127,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary& const dictionary&,
const bool valueRequired = true
); );
//- Construct by mapping given fixedJumpFvPatchField onto a //- Construct by mapping given fixedJumpFvPatchField onto a

View File

@ -60,11 +60,14 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, 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_() jumpTable_()
{
if (valueRequired)
{ {
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
@ -83,6 +86,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
this->evaluate(Pstream::commsTypes::blocking); this->evaluate(Pstream::commsTypes::blocking);
} }
} }
}
template<class Type> template<class Type>

View File

@ -117,7 +117,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary& const dictionary&,
const bool valueRequired = true
); );
//- Construct by mapping given uniformJumpFvPatchField onto a //- Construct by mapping given uniformJumpFvPatchField onto a

View File

@ -38,6 +38,17 @@ namespace Foam
defineTypeNameAndDebug(faceAreaWeightAMI, 0); defineTypeNameAndDebug(faceAreaWeightAMI, 0);
addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, dict); addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, dict);
addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, component); addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, component);
// Backwards compatibility for pre v2106 versions
// - partialFaceAreaWeightAMI deprecated in v2106
addNamedToRunTimeSelectionTable
(
AMIInterpolation,
faceAreaWeightAMI,
dict,
partialFaceAreaWeightAMI
);
} }
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //