From b6feaea53be5088d3efd41490482e42ef090c8f2 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 25 Sep 2016 09:11:53 +0100 Subject: [PATCH] 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 --- .../adjointOutletPressureFvPatchScalarField.C | 11 +--- .../adjointOutletVelocityFvPatchVectorField.C | 8 +-- ...ndaryLayerInletEpsilonFvPatchScalarField.C | 4 +- ...atmBoundaryLayerInletKFvPatchScalarField.C | 4 +- ...daryLayerInletVelocityFvPatchVectorField.C | 4 +- .../fixedShearStressFvPatchVectorField.C | 2 +- .../SRFVelocityFvPatchVectorField.C | 6 +- .../SRFWallVelocityFvPatchVectorField.C | 6 +- .../basic/coupled/coupledFvPatchField.C | 5 +- .../basic/coupled/coupledFvPatchField.H | 3 +- .../extrapolatedCalculatedFvPatchField.C | 9 +-- .../extrapolatedCalculatedFvPatchField.H | 3 +- .../fixedGradient/fixedGradientFvPatchField.C | 2 +- .../basic/fixedValue/fixedValueFvPatchField.C | 5 +- .../basic/fixedValue/fixedValueFvPatchField.H | 3 +- .../basic/mixed/mixedFvPatchField.C | 2 +- .../basic/sliced/slicedFvPatchField.C | 2 +- .../basic/transform/transformFvPatchField.C | 2 +- .../zeroGradient/zeroGradientFvPatchField.C | 2 +- .../constraint/cyclic/cyclicFvPatchField.C | 2 +- .../cyclicACMI/cyclicACMIFvPatchField.C | 63 ++++++++++--------- .../cyclicAMI/cyclicAMIFvPatchField.C | 52 +++++++-------- .../activeBaffleVelocityFvPatchVectorField.C | 2 +- ...ureForceBaffleVelocityFvPatchVectorField.C | 2 +- .../fixedProfile/fixedProfileFvPatchField.C | 2 +- .../flowRateInletVelocityFvPatchVectorField.C | 2 +- .../movingWallVelocityFvPatchVectorField.C | 6 +- .../plenumPressureFvPatchScalarField.C | 4 +- ...eDirectedInletVelocityFvPatchVectorField.C | 6 +- .../pressureInletVelocityFvPatchVectorField.C | 6 +- .../prghPressureFvPatchScalarField.C | 4 +- .../prghTotalPressureFvPatchScalarField.C | 4 +- .../rotatingWallVelocityFvPatchVectorField.C | 2 +- ...urfaceNormalFixedValueFvPatchVectorField.C | 2 +- .../syringePressureFvPatchScalarField.C | 2 +- .../timeVaryingMappedFixedValueFvPatchField.C | 2 +- .../totalPressureFvPatchScalarField.C | 2 +- .../totalTemperatureFvPatchScalarField.C | 4 +- ...ranslatingWallVelocityFvPatchVectorField.C | 2 +- .../turbulentInletFvPatchField.C | 2 +- ...ityHydrostaticPressureFvPatchScalarField.C | 2 +- .../uniformFixedValueFvPatchField.C | 2 +- .../uniformTotalPressureFvPatchScalarField.C | 2 +- .../waveSurfacePressureFvPatchScalarField.C | 9 +-- .../fvPatchFields/fvPatchField/fvPatchField.C | 33 +++++----- .../fvPatchFields/fvPatchField/fvPatchField.H | 2 +- .../cellMotion/cellMotionFvPatchField.C | 6 +- ...meVaryingMappedFixedValuePointPatchField.C | 2 +- .../genericFvPatchField/genericFvPatchField.C | 2 +- ...ysisTemperatureCoupledFvPatchScalarField.C | 6 +- ...rolysisVelocityCoupledFvPatchVectorField.C | 6 +- ...ilmHeightInletVelocityFvPatchVectorField.C | 8 +-- ...linedFilmNusseltHeightFvPatchScalarField.C | 6 +- ...lmNusseltInletVelocityFvPatchVectorField.C | 6 +- ...veViewFactorFixedValueFvPatchScalarField.C | 2 +- .../alphaFixedPressureFvPatchScalarField.C | 4 +- 56 files changed, 161 insertions(+), 193 deletions(-) diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index c15fde7078..c9f03a373c 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -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::operator= - ( - scalarField("value", dict, p.size()) - ); -} + fixedValueFvPatchScalarField(p, iF, dict) +{} Foam::adjointOutletPressureFvPatchScalarField:: diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 31134c955b..7b00d66277 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -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:: diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 9b04284c0e..20a917ec33 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -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())); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C index de2404ab13..65017e2520 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C @@ -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())); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index 652b6e07bc..348d041cb0 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -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())); diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index 17050f28d5..bc4f5303e3 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -50,7 +50,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict, false), tau0_(dict.lookupOrDefault("tau", Zero)) { fvPatchField::operator=(patchInternalField()); diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C index ec59dbedfc..ba3a045726 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -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 diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.C index 17c0dc700f..2cd69993b1 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.C @@ -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 diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C index 5a6f29aa89..d53c250565 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C @@ -71,11 +71,12 @@ Foam::coupledFvPatchField::coupledFvPatchField ( const fvPatch& p, const DimensionedField& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : LduInterfaceField(refCast(p)), - fvPatchField(p, iF, dict) + fvPatchField(p, iF, dict, valueRequired) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H index 0148af1ac5..20d87b8e86 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H @@ -86,7 +86,8 @@ public: ( const fvPatch&, const DimensionedField&, - const dictionary& + const dictionary&, + const bool valueRequired=true ); //- Construct by mapping the given coupledFvPatchField onto a new patch diff --git a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.C index 3d15434880..188294d38d 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.C @@ -46,12 +46,13 @@ extrapolatedCalculatedFvPatchField ( const fvPatch& p, const DimensionedField& iF, - const dictionary& dict, - const bool valueRequired + const dictionary& dict ) : - calculatedFvPatchField(p, iF, dict, valueRequired) -{} + calculatedFvPatchField(p, iF, dict, false) +{ + evaluate(); +} template diff --git a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H index da998d3a85..f9eb61e285 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H @@ -87,8 +87,7 @@ public: ( const fvPatch&, const DimensionedField&, - const dictionary&, - const bool valueRequired=false + const dictionary& ); //- Construct by mapping given patchField onto a new patch diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C index bb789ed827..a7a8a8562f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C @@ -48,7 +48,7 @@ Foam::fixedGradientFvPatchField::fixedGradientFvPatchField const dictionary& dict ) : - fvPatchField(p, iF, dict), + fvPatchField(p, iF, dict, false), gradient_("gradient", dict, p.size()) { evaluate(); diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C index b6841f3353..fcde153c9d 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.C @@ -55,10 +55,11 @@ Foam::fixedValueFvPatchField::fixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - fvPatchField(p, iF, dict, true) + fvPatchField(p, iF, dict, valueRequired) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H index 3cf2421420..375d57fea4 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H @@ -99,7 +99,8 @@ public: ( const fvPatch&, const DimensionedField&, - const dictionary& + const dictionary&, + const bool valueRequired=true ); //- Construct by mapping the given fixedValueFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C index bcec377834..9a195de206 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C @@ -49,7 +49,7 @@ Foam::mixedFvPatchField::mixedFvPatchField const dictionary& dict ) : - fvPatchField(p, iF, dict), + fvPatchField(p, iF, dict, false), refValue_("refValue", dict, p.size()), refGrad_("refGradient", dict, p.size()), valueFraction_("valueFraction", dict, p.size()) diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C index 98bd38eb72..ba0dd92f09 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C @@ -61,7 +61,7 @@ Foam::slicedFvPatchField::slicedFvPatchField const dictionary& dict ) : - fvPatchField(p, iF, dict) + fvPatchField(p, iF, dict, false) { NotImplemented; } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C index bccf65ef16..0ed9a26703 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.C @@ -61,7 +61,7 @@ Foam::transformFvPatchField::transformFvPatchField const dictionary& dict ) : - fvPatchField(p, iF, dict) + fvPatchField(p, iF, dict, false) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.C index 4395534fe2..e99530bf21 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.C @@ -47,7 +47,7 @@ Foam::zeroGradientFvPatchField::zeroGradientFvPatchField const dictionary& dict ) : - fvPatchField(p, iF, dict) + fvPatchField(p, iF, dict, false) { fvPatchField::operator=(this->patchInternalField()); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index 4513dc4da6..b4241bb271 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -48,7 +48,7 @@ Foam::cyclicFvPatchField::cyclicFvPatchField const dictionary& dict ) : - coupledFvPatchField(p, iF, dict), + coupledFvPatchField(p, iF, dict, false), cyclicPatch_(refCast(p)) { if (!isA(p)) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C index c32b6f33d6..0b9335fb8f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C @@ -41,6 +41,38 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField {} +template +Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + cyclicACMILduInterfaceField(), + coupledFvPatchField(p, iF, dict, dict.found("value")), + cyclicACMIPatch_(refCast(p)) +{ + if (!isA(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 Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField ( @@ -66,37 +98,6 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField } -template -Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - cyclicACMILduInterfaceField(), - coupledFvPatchField(p, iF, dict), - cyclicACMIPatch_(refCast(p)) -{ - if (!isA(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 Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C index f97985b115..7d8fec72c1 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C @@ -38,31 +38,6 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField {} -template -Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField -( - const cyclicAMIFvPatchField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - cyclicAMILduInterfaceField(), - coupledFvPatchField(ptf, p, iF, mapper), - cyclicAMIPatch_(refCast(p)) -{ - if (!isA(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 Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField ( @@ -72,7 +47,7 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField ) : cyclicAMILduInterfaceField(), - coupledFvPatchField(p, iF, dict), + coupledFvPatchField(p, iF, dict, dict.found("value")), cyclicAMIPatch_(refCast(p)) { if (!isA(p)) @@ -95,6 +70,31 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField } +template +Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField +( + const cyclicAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicAMILduInterfaceField(), + coupledFvPatchField(ptf, p, iF, mapper), + cyclicAMIPatch_(refCast(p)) +{ + if (!isA(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 Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 1ce7a7d39f..18213659c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -85,7 +85,7 @@ activeBaffleVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict, false), pName_(dict.lookupOrDefault("p", "p")), cyclicPatchName_(dict.lookup("cyclicPatch")), cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index 04d33d9b8a..6b86262f29 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -91,7 +91,7 @@ activePressureForceBaffleVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict, false), pName_(dict.lookupOrDefault("p", "p")), cyclicPatchName_(dict.lookup("cyclicPatch")), cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C index 1ea26724c6..be52334338 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C @@ -64,7 +64,7 @@ Foam::fixedProfileFvPatchField::fixedProfileFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), profile_(Function1::New("profile", dict)), dir_(dict.lookup("direction")), origin_(readScalar(dict.lookup("origin"))) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 79b1745dda..1e507a5dfd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -54,7 +54,7 @@ flowRateInletVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), rhoInlet_(dict.lookupOrDefault("rhoInlet", -VGREAT)), extrapolateProfile_ ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index 6c0bba6263..22d6a2e789 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -50,10 +50,8 @@ movingWallVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} + fixedValueFvPatchVectorField(p, iF, dict) +{} Foam::movingWallVelocityFvPatchVectorField:: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C index 19476f5e7f..aadbfcfd85 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C @@ -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("phi", "phi")), UName_(dict.lookupOrDefault("U", "U")) { - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - if (dict.found("rho")) { rho_ = readScalar(dict.lookup("rho")); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C index cd4eb18b98..9ab1bc87ef 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C @@ -70,13 +70,11 @@ pressureDirectedInletVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), inletDir_("inletDirection", dict, p.size()) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} +{} Foam::pressureDirectedInletVelocityFvPatchVectorField:: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C index 6a779ae0bd..06e58e73bb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C @@ -66,12 +66,10 @@ pressureInletVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} +{} Foam::pressureInletVelocityFvPatchVectorField:: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C index 5ea2c2c823..c266d27f85 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C @@ -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("rho", "rho")), p_("p", dict, p.size()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C index 21229f7d82..1140551128 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C @@ -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("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C index 461481f5fb..ebc32b0790 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -52,7 +52,7 @@ rotatingWallVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), origin_(dict.lookup("origin")), axis_(dict.lookup("axis")), omega_(Function1::New("omega", dict)) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 478600608b..dc37c38a43 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C @@ -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()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index 5acddd12fa..c33db45ca2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -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"))), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index 2222b05b1e..cb0dbd1792 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -63,7 +63,7 @@ timeVaryingMappedFixedValueFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), fieldTableName_(iF.name()), setAverage_(dict.lookupOrDefault("setAverage", false)), perturb_(dict.lookupOrDefault("perturb", 1e-5)), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index c88c0a59ff..bcd8557253 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -55,7 +55,7 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict, false), UName_(dict.lookupOrDefault("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 7d14db67fa..15df485592 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -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("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), psiName_(dict.lookupOrDefault("psi", "thermo:psi")), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C index 37b7ada772..d41a424701 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C @@ -49,7 +49,7 @@ translatingWallVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), U_(Function1::New("U", dict)) { // Evaluate the wall velocity diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C index 4527eca009..ec71541bd0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C @@ -51,7 +51,7 @@ Foam::turbulentInletFvPatchField::turbulentInletFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), ranGen_(label(0)), fluctuationScale_(pTraits(dict.lookup("fluctuationScale"))), referenceField_("referenceField", dict, p.size()), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C index 6eea5de3bc..ba14325c6a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C @@ -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")) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index ab03ec6b0e..e79df9bec0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -60,7 +60,7 @@ Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF), + fixedValueFvPatchField(p, iF, dict, false), uniformValue_(Function1::New("uniformValue", dict)) { this->evaluate(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C index 744ac51b47..0a37e65e80 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C @@ -56,7 +56,7 @@ uniformTotalPressureFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict, false), UName_(dict.lookupOrDefault("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index f156caf7e8..4b25603ce0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -82,16 +82,11 @@ waveSurfacePressureFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict), phiName_(dict.lookupOrDefault("phi", "phi")), zetaName_(dict.lookupOrDefault("zeta", "zeta")), rhoName_(dict.lookupOrDefault("rho", "rho")) -{ - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); -} +{} Foam::waveSurfacePressureFvPatchScalarField:: diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index ea2935e73d..3c8f44baee 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -114,24 +114,23 @@ Foam::fvPatchField::fvPatchField manipulatedMatrix_(false), patchType_(dict.lookupOrDefault("patchType", word::null)) { - if (dict.found("value")) + if (valueRequired) { - Field::operator= - ( - Field("value", dict, p.size()) - ); - } - else if (!valueRequired) - { - Field::operator=(Zero); - } - else - { - FatalIOErrorInFunction - ( - dict - ) << "Essential entry 'value' missing" - << exit(FatalIOError); + if (dict.found("value")) + { + Field::operator= + ( + Field("value", dict, p.size()) + ); + } + else + { + FatalIOErrorInFunction + ( + dict + ) << "Essential entry 'value' missing" + << exit(FatalIOError); + } } } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 3fc282dab7..1d689139b9 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -200,7 +200,7 @@ public: const fvPatch&, const DimensionedField&, const dictionary&, - const bool valueRequired=false + const bool valueRequired=true ); //- Construct by mapping the given fvPatchField onto a new patch diff --git a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C index 0ad8ad0e45..a908defc02 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C +++ b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.C @@ -63,10 +63,8 @@ Foam::cellMotionFvPatchField::cellMotionFvPatchField const dictionary& dict ) : - fixedValueFvPatchField(p, iF) -{ - fvPatchField::operator=(Field("value", dict, p.size())); -} + fixedValueFvPatchField(p, iF, dict) +{} template diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C index ec50acb65f..4978b2aa47 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C @@ -63,7 +63,7 @@ timeVaryingMappedFixedValuePointPatchField const dictionary& dict ) : - fixedValuePointPatchField(p, iF), + fixedValuePointPatchField(p, iF, dict, false), fieldTableName_(iF.name()), setAverage_(dict.lookupOrDefault("setAverage", false)), perturb_(dict.lookupOrDefault("perturb", 1e-5)), diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C index 75cba4fb68..453df89828 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C @@ -53,7 +53,7 @@ Foam::genericFvPatchField::genericFvPatchField const dictionary& dict ) : - calculatedFvPatchField(p, iF, dict, false), + calculatedFvPatchField(p, iF, dict), actualTypeName_(dict.lookup("type")), dict_(dict) { diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C index 5734f736f3..6d1e2ee2dd 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C @@ -71,7 +71,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict), filmRegionName_ ( dict.lookupOrDefault("filmRegion", "surfaceFilmProperties") @@ -82,9 +82,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField ), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")) -{ - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); -} +{} Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField:: diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C index 4f30cb3a30..8bf2ea9908 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C @@ -71,7 +71,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict), filmRegionName_ ( dict.lookupOrDefault("filmRegion", "surfaceFilmProperties") @@ -82,9 +82,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField ), phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} +{} Foam::filmPyrolysisVelocityCoupledFvPatchVectorField:: diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C index 41fec4b2eb..18a0bc751e 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C @@ -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("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), deltafName_(dict.lookupOrDefault("deltaf", "deltaf")) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} +{} Foam::filmHeightInletVelocityFvPatchVectorField:: diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C index 19ebc51bf0..48fded0fa0 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C @@ -68,13 +68,11 @@ inclinedFilmNusseltHeightFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict), GammaMean_(Function1::New("GammaMean", dict)), a_(Function1::New("a", dict)), omega_(Function1::New("omega", dict)) -{ - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); -} +{} Foam::inclinedFilmNusseltHeightFvPatchScalarField:: diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C index 3611de9e92..1977e3805f 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C @@ -68,13 +68,11 @@ inclinedFilmNusseltInletVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF), + fixedValueFvPatchVectorField(p, iF, dict), GammaMean_(Function1::New("GammaMean", dict)), a_(Function1::New("a", dict)), omega_(Function1::New("omega", dict)) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} +{} Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField:: diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C index 866fbe8d2b..591d6d1964 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C @@ -72,7 +72,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF), + fixedValueFvPatchScalarField(p, iF, dict, false), radiationCoupledBase(p, dict), Qro_("Qro", dict, p.size()) { diff --git a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C index e6e6ea2c10..3eb505dfa1 100644 --- a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -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"))