fvPatchFields: Constructors from dictionary now call the corresponding constructor of the fvPatchField base-class

to ensure 'patchType' is set as specified.

Required substantial change to the organization of the reading of the
'value' entry requiring careful testing and there may be some residual
issues remaining.  Please report any problems with the reading and
initialization of patch fields.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2266
This commit is contained in:
Henry Weller 2016-09-25 09:11:53 +01:00
parent 93530f1747
commit b6feaea53b
56 changed files with 161 additions and 193 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,13 +63,8 @@ adjointOutletPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF)
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
fixedValueFvPatchScalarField(p, iF, dict)
{}
Foam::adjointOutletPressureFvPatchScalarField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,10 +50,8 @@ adjointOutletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(p, iF, dict)
{}
Foam::adjointOutletVelocityFvPatchVectorField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
scalarField::operator=(epsilon(patch().Cf()));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ atmBoundaryLayerInletKFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
scalarField::operator=(k(patch().Cf()));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
vectorField::operator=(U(patch().Cf()));

View File

@ -50,7 +50,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
tau0_(dict.lookupOrDefault<vector>("tau", Zero))
{
fvPatchField<vector>::operator=(patchInternalField());

View File

@ -64,12 +64,10 @@ Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
relative_(dict.lookup("relative")),
inletValue_("inletValue", dict, p.size())
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField

View File

@ -60,10 +60,8 @@ Foam::SRFWallVelocityFvPatchVectorField::SRFWallVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(p, iF, dict)
{}
Foam::SRFWallVelocityFvPatchVectorField::SRFWallVelocityFvPatchVectorField

View File

@ -71,11 +71,12 @@ Foam::coupledFvPatchField<Type>::coupledFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
const dictionary& dict,
const bool valueRequired
)
:
LduInterfaceField<Type>(refCast<const lduInterface>(p)),
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, valueRequired)
{}

View File

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

View File

@ -46,12 +46,13 @@ extrapolatedCalculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict,
const bool valueRequired
const dictionary& dict
)
:
calculatedFvPatchField<Type>(p, iF, dict, valueRequired)
{}
calculatedFvPatchField<Type>(p, iF, dict, false)
{
evaluate();
}
template<class Type>

View File

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

View File

@ -48,7 +48,7 @@ Foam::fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict),
fvPatchField<Type>(p, iF, dict, false),
gradient_("gradient", dict, p.size())
{
evaluate();

View File

@ -55,10 +55,11 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
const dictionary& dict,
const bool valueRequired
)
:
fvPatchField<Type>(p, iF, dict, true)
fvPatchField<Type>(p, iF, dict, valueRequired)
{}

View File

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

View File

@ -49,7 +49,7 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict),
fvPatchField<Type>(p, iF, dict, false),
refValue_("refValue", dict, p.size()),
refGrad_("refGradient", dict, p.size()),
valueFraction_("valueFraction", dict, p.size())

View File

@ -61,7 +61,7 @@ Foam::slicedFvPatchField<Type>::slicedFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{
NotImplemented;
}

View File

@ -61,7 +61,7 @@ Foam::transformFvPatchField<Type>::transformFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{}

View File

@ -47,7 +47,7 @@ Foam::zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{
fvPatchField<Type>::operator=(this->patchInternalField());
}

View File

@ -48,7 +48,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
const dictionary& dict
)
:
coupledFvPatchField<Type>(p, iF, dict),
coupledFvPatchField<Type>(p, iF, dict, false),
cyclicPatch_(refCast<const cyclicFvPatch>(p))
{
if (!isA<cyclicFvPatch>(p))

View File

@ -41,6 +41,38 @@ Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
{}
template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicACMILduInterfaceField(),
coupledFvPatchField<Type>(p, iF, dict, dict.found("value")),
cyclicACMIPatch_(refCast<const cyclicACMIFvPatch>(p))
{
if (!isA<cyclicACMIFvPatch>(p))
{
FatalIOErrorInFunction
(
dict
) << " patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
if (!dict.found("value") && this->coupled())
{
this->evaluate(Pstream::blocking);
}
}
template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
(
@ -66,37 +98,6 @@ Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
}
template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicACMILduInterfaceField(),
coupledFvPatchField<Type>(p, iF, dict),
cyclicACMIPatch_(refCast<const cyclicACMIFvPatch>(p))
{
if (!isA<cyclicACMIFvPatch>(p))
{
FatalIOErrorInFunction
(
dict
) << " patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
if (!dict.found("value") && this->coupled())
{
this->evaluate(Pstream::blocking);
}
}
template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField

View File

@ -38,31 +38,6 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
{}
template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
(
const cyclicAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicAMILduInterfaceField(),
coupledFvPatchField<Type>(ptf, p, iF, mapper),
cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
{
if (!isA<cyclicAMIFvPatch>(this->patch()))
{
FatalErrorInFunction
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
(
@ -72,7 +47,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
)
:
cyclicAMILduInterfaceField(),
coupledFvPatchField<Type>(p, iF, dict),
coupledFvPatchField<Type>(p, iF, dict, dict.found("value")),
cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
{
if (!isA<cyclicAMIFvPatch>(p))
@ -95,6 +70,31 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
}
template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
(
const cyclicAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicAMILduInterfaceField(),
coupledFvPatchField<Type>(ptf, p, iF, mapper),
cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
{
if (!isA<cyclicAMIFvPatch>(this->patch()))
{
FatalErrorInFunction
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
(

View File

@ -85,7 +85,7 @@ activeBaffleVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
pName_(dict.lookupOrDefault<word>("p", "p")),
cyclicPatchName_(dict.lookup("cyclicPatch")),
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),

View File

@ -91,7 +91,7 @@ activePressureForceBaffleVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
pName_(dict.lookupOrDefault<word>("p", "p")),
cyclicPatchName_(dict.lookup("cyclicPatch")),
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),

View File

@ -64,7 +64,7 @@ Foam::fixedProfileFvPatchField<Type>::fixedProfileFvPatchField
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF),
fixedValueFvPatchField<Type>(p, iF, dict, false),
profile_(Function1<Type>::New("profile", dict)),
dir_(dict.lookup("direction")),
origin_(readScalar(dict.lookup("origin")))

View File

@ -54,7 +54,7 @@ flowRateInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF),
fixedValueFvPatchField<vector>(p, iF, dict, false),
rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT)),
extrapolateProfile_
(

View File

@ -50,10 +50,8 @@ movingWallVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(p, iF, dict)
{}
Foam::movingWallVelocityFvPatchVectorField::

View File

@ -65,7 +65,7 @@ Foam::plenumPressureFvPatchScalarField::plenumPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict),
gamma_(readScalar(dict.lookup("gamma"))),
R_(readScalar(dict.lookup("R"))),
supplyMassFlowRate_(readScalar(dict.lookup("supplyMassFlowRate"))),
@ -87,8 +87,6 @@ Foam::plenumPressureFvPatchScalarField::plenumPressureFvPatchScalarField
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
UName_(dict.lookupOrDefault<word>("U", "U"))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("rho"))
{
rho_ = readScalar(dict.lookup("rho"));

View File

@ -70,13 +70,11 @@ pressureDirectedInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
inletDir_("inletDirection", dict, p.size())
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::pressureDirectedInletVelocityFvPatchVectorField::

View File

@ -66,12 +66,10 @@ pressureInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::pressureInletVelocityFvPatchVectorField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,7 @@ prghPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
p_("p", dict, p.size())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ prghTotalPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),

View File

@ -52,7 +52,7 @@ rotatingWallVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF),
fixedValueFvPatchField<vector>(p, iF, dict, false),
origin_(dict.lookup("origin")),
axis_(dict.lookup("axis")),
omega_(Function1<scalar>::New("omega", dict))

View File

@ -50,7 +50,7 @@ surfaceNormalFixedValueFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
refValue_("refValue", dict, p.size())
{
fvPatchVectorField::operator=(refValue_*patch().nf());

View File

@ -50,7 +50,7 @@ Foam::syringePressureFvPatchScalarField::syringePressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
Ap_(readScalar(dict.lookup("Ap"))),
Sp_(readScalar(dict.lookup("Sp"))),
VsI_(readScalar(dict.lookup("VsI"))),

View File

@ -63,7 +63,7 @@ timeVaryingMappedFixedValueFvPatchField
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF),
fixedValueFvPatchField<Type>(p, iF, dict, false),
fieldTableName_(iF.name()),
setAverage_(dict.lookupOrDefault("setAverage", false)),
perturb_(dict.lookupOrDefault("perturb", 1e-5)),

View File

@ -55,7 +55,7 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,7 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),

View File

@ -49,7 +49,7 @@ translatingWallVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchField<vector>(p, iF),
fixedValueFvPatchField<vector>(p, iF, dict, false),
U_(Function1<vector>::New("U", dict))
{
// Evaluate the wall velocity

View File

@ -51,7 +51,7 @@ Foam::turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF),
fixedValueFvPatchField<Type>(p, iF, dict, false),
ranGen_(label(0)),
fluctuationScale_(pTraits<Type>(dict.lookup("fluctuationScale"))),
referenceField_("referenceField", dict, p.size()),

View File

@ -54,7 +54,7 @@ uniformDensityHydrostaticPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
rho_(readScalar(dict.lookup("rho"))),
pRefValue_(readScalar(dict.lookup("pRefValue"))),
pRefPoint_(dict.lookup("pRefPoint"))

View File

@ -60,7 +60,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF),
fixedValueFvPatchField<Type>(p, iF, dict, false),
uniformValue_(Function1<Type>::New("uniformValue", dict))
{
this->evaluate();

View File

@ -56,7 +56,7 @@ uniformTotalPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),

View File

@ -82,16 +82,11 @@ waveSurfacePressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
zetaName_(dict.lookupOrDefault<word>("zeta", "zeta")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
{}
Foam::waveSurfacePressureFvPatchScalarField::

View File

@ -114,24 +114,23 @@ Foam::fvPatchField<Type>::fvPatchField
manipulatedMatrix_(false),
patchType_(dict.lookupOrDefault<word>("patchType", word::null))
{
if (dict.found("value"))
if (valueRequired)
{
Field<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
else if (!valueRequired)
{
Field<Type>::operator=(Zero);
}
else
{
FatalIOErrorInFunction
(
dict
) << "Essential entry 'value' missing"
<< exit(FatalIOError);
if (dict.found("value"))
{
Field<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
else
{
FatalIOErrorInFunction
(
dict
) << "Essential entry 'value' missing"
<< exit(FatalIOError);
}
}
}

View File

@ -200,7 +200,7 @@ public:
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&,
const bool valueRequired=false
const bool valueRequired=true
);
//- Construct by mapping the given fvPatchField onto a new patch

View File

@ -63,10 +63,8 @@ Foam::cellMotionFvPatchField<Type>::cellMotionFvPatchField
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF)
{
fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size()));
}
fixedValueFvPatchField<Type>(p, iF, dict)
{}
template<class Type>

View File

@ -63,7 +63,7 @@ timeVaryingMappedFixedValuePointPatchField
const dictionary& dict
)
:
fixedValuePointPatchField<Type>(p, iF),
fixedValuePointPatchField<Type>(p, iF, dict, false),
fieldTableName_(iF.name()),
setAverage_(dict.lookupOrDefault("setAverage", false)),
perturb_(dict.lookupOrDefault("perturb", 1e-5)),

View File

@ -53,7 +53,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
const dictionary& dict
)
:
calculatedFvPatchField<Type>(p, iF, dict, false),
calculatedFvPatchField<Type>(p, iF, dict),
actualTypeName_(dict.lookup("type")),
dict_(dict)
{

View File

@ -71,7 +71,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict),
filmRegionName_
(
dict.lookupOrDefault<word>("filmRegion", "surfaceFilmProperties")
@ -82,9 +82,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
}
{}
Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::

View File

@ -71,7 +71,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
filmRegionName_
(
dict.lookupOrDefault<word>("filmRegion", "surfaceFilmProperties")
@ -82,9 +82,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,13 +68,11 @@ filmHeightInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
deltafName_(dict.lookupOrDefault<word>("deltaf", "deltaf"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::filmHeightInletVelocityFvPatchVectorField::

View File

@ -68,13 +68,11 @@ inclinedFilmNusseltHeightFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict),
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
a_(Function1<scalar>::New("a", dict)),
omega_(Function1<scalar>::New("omega", dict))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
}
{}
Foam::inclinedFilmNusseltHeightFvPatchScalarField::

View File

@ -68,13 +68,11 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
a_(Function1<scalar>::New("a", dict)),
omega_(Function1<scalar>::New("omega", dict))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::

View File

@ -72,7 +72,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
radiationCoupledBase(p, dict),
Qro_("Qro", dict, p.size())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,7 +66,7 @@ alphaFixedPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
p_("p", dict, p.size())
{
if (dict.found("value"))