diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C index a2ee30027a0775af74a1a6c7e5fff5ab12047fe0..221a553d3ee6bad432c2cac31df17d95e736ef4c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.C @@ -38,7 +38,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField ) : fixedGradientFvPatchField<Type>(p, iF), - uniformGradient_() + uniformGradient_(nullptr) {} @@ -51,7 +51,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField ) : fixedGradientFvPatchField<Type>(p, iF, fld), - uniformGradient_() + uniformGradient_(nullptr) {} @@ -64,7 +64,10 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField ) : fixedGradientFvPatchField<Type>(p, iF), - uniformGradient_(Function1<Type>::New("uniformGradient", dict)) + uniformGradient_ + ( + PatchFunction1<Type>::New(p.patch(), "uniformGradient", dict) + ) { this->patchType() = dict.getOrDefault<word>("patchType", word::null); this->evaluate(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H index bf42d2894ad107495d8d9b1ba1ce5c31364d99a5..0cce531299c893a1769099c3ff277bcae32dad90 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,8 +35,8 @@ Description Usage \table - Property | Description | Required | Default value - uniformGradient | uniform gradient | yes | + Property | Description | Required | Default + uniformGradient | uniform gradient | yes | \endtable Example of the boundary condition specification: @@ -48,9 +49,9 @@ Usage \endverbatim Note - The uniformGradient entry is a Function1 type, able to describe time - varying functions. The example above gives the usage for supplying a - constant value. + The uniformGradient entry is a PatchFunction1 type, + able to describe time and spatial varying functions. + The example above gives the usage for supplying a constant value. See also Foam::Function1Types @@ -65,7 +66,7 @@ SourceFiles #define uniformFixedGradientFvPatchField_H #include "fixedGradientFvPatchFields.H" -#include "Function1.H" +#include "PatchFunction1.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -81,10 +82,10 @@ class uniformFixedGradientFvPatchField : public fixedGradientFvPatchField<Type> { - // Private data + // Private Data //- Gradient - autoPtr<Function1<Type>> uniformGradient_; + autoPtr<PatchFunction1<Type>> uniformGradient_; public: @@ -118,8 +119,7 @@ public: const dictionary& ); - //- Construct by mapping given uniformFixedGradientFvPatchField - // onto a new patch + //- Construct by mapping onto a new patch uniformFixedGradientFvPatchField ( const uniformFixedGradientFvPatchField<Type>&, @@ -169,7 +169,7 @@ public: virtual void updateCoeffs(); //- Write - virtual void write(Ostream&) const; + virtual void write(Ostream& os) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index 26623aa1a5d508035affabd92d5905d3a0fc9eca..4b8f236dc3871dfcd3c5b74a43b7a595e9fefaa4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,7 +38,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(p, iF), - uniformValue_() + uniformValue_(nullptr) {} @@ -51,7 +51,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(p, iF, fld), - uniformValue_() + uniformValue_(nullptr) {} diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H index ce4786477b0025ff11bc9c65a6ad8dd7b45cedd2..440b5ca30e5693a2a49a4fb8391dec8b1f6c42b8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,8 +35,8 @@ Description Usage \table - Property | Description | Required | Default value - uniformValue | uniform value | yes | + Property | Description | Required | Default + uniformValue | uniform value | yes | \endtable Example of the boundary condition specification: @@ -49,9 +49,9 @@ Usage \endverbatim Note - The uniformValue entry is a Function1 type, able to describe time - varying functions. The example above gives the usage for supplying a - constant value. + The uniformValue entry is a PatchFunction1 type, + able to describe time and spatial varying functions. + The example above gives the usage for supplying a constant value. See also Foam::Function1Types @@ -82,8 +82,9 @@ class uniformFixedValueFvPatchField : public fixedValueFvPatchField<Type> { - // Private data + // Private Data + //- Value autoPtr<PatchFunction1<Type>> uniformValue_; @@ -118,8 +119,7 @@ public: const dictionary& ); - //- Construct by mapping given uniformFixedValueFvPatchField - // onto a new patch + //- Construct by mapping onto a new patch uniformFixedValueFvPatchField ( const uniformFixedValueFvPatchField<Type>&, @@ -185,7 +185,7 @@ public: virtual void updateCoeffs(); //- Write - virtual void write(Ostream&) const; + virtual void write(Ostream& os) const; };