ENH: fan bc: more logical initialisation. See #2138.

This commit is contained in:
mattijs
2021-06-24 12:03:13 +01:00
parent 3b10cd84c6
commit aaa5469261
2 changed files with 22 additions and 4 deletions

View File

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

View File

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