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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -71,11 +71,12 @@ Foam::coupledFvPatchField<Type>::coupledFvPatchField
( (
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
) )
: :
LduInterfaceField<Type>(refCast<const lduInterface>(p)), 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 fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const dictionary& const dictionary&,
const bool valueRequired=true
); );
//- Construct by mapping the given coupledFvPatchField onto a new patch //- Construct by mapping the given coupledFvPatchField onto a new patch

View File

@ -46,12 +46,13 @@ extrapolatedCalculatedFvPatchField
( (
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
) )
: :
calculatedFvPatchField<Type>(p, iF, dict, valueRequired) calculatedFvPatchField<Type>(p, iF, dict, false)
{} {
evaluate();
}
template<class Type> template<class Type>

View File

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

View File

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

View File

@ -55,10 +55,11 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
( (
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
) )
: :
fvPatchField<Type>(p, iF, dict, true) fvPatchField<Type>(p, iF, dict, valueRequired)
{} {}

View File

@ -99,7 +99,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 the given fixedValueFvPatchField<Type> //- Construct by mapping the given fixedValueFvPatchField<Type>

View File

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

View File

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

View File

@ -61,7 +61,7 @@ Foam::transformFvPatchField<Type>::transformFvPatchField
const dictionary& dict 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 const dictionary& dict
) )
: :
fvPatchField<Type>(p, iF, dict) fvPatchField<Type>(p, iF, dict, false)
{ {
fvPatchField<Type>::operator=(this->patchInternalField()); fvPatchField<Type>::operator=(this->patchInternalField());
} }

View File

@ -48,7 +48,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
coupledFvPatchField<Type>(p, iF, dict), coupledFvPatchField<Type>(p, iF, dict, false),
cyclicPatch_(refCast<const cyclicFvPatch>(p)) cyclicPatch_(refCast<const cyclicFvPatch>(p))
{ {
if (!isA<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> template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField 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> template<class Type>
Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField 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> template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
( (
@ -72,7 +47,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
) )
: :
cyclicAMILduInterfaceField(), cyclicAMILduInterfaceField(),
coupledFvPatchField<Type>(p, iF, dict), coupledFvPatchField<Type>(p, iF, dict, dict.found("value")),
cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p)) cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
{ {
if (!isA<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> template<class Type>
Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
( (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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