diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C index 508e584948d78620d16262643cefe68346a88c67..1d6c6a9bfa90b95af9066d970c4cc8e51ae13a49 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -183,6 +183,7 @@ void Foam::fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const { transformFvPatchField<Type>::write(os); fixedValue_.writeEntry("fixedValue", os); + this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H index be651bc33ffbc767320f42079acc73a63228c766..5a90a21f68f35057e7a1a599d9702f5d2e6f4a28 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,28 +31,44 @@ Group grpGenericBoundaryConditions grpWallBoundaryConditions Description - This boundary condition sets the patch-normal component to a fixed value. + This boundary condition sets the patch-normal component to the field (vector + or tensor) to the patch-normal component of a user specified field. + The tangential component is treated as slip, i.e. copied from the internal + field. Usage - \table - Property | Description | Required | Default value - fixedValue | fixed value | yes | - \endtable - Example of the boundary condition specification: \verbatim <patchName> { + // Mandatory entries (unmodifiable) type fixedNormalSlip; - fixedValue uniform 0; // example entry for a scalar field + fixedValue uniform (1 0 0); // example entry for a vector field + + // Mandatory/Optional (inherited) entries + ... } \endverbatim + where the entries mean: + \table + Property | Description | Type | Reqd | Deflt + type | Type name: fixedNormalSlip | word | yes | - + fixedValue | User-defined value the normal component of which <!-- + --> the boundary is set to <!-- + --> | vectorField/tensorField | yes | - + \endtable + + The inherited entries are elaborated in: + - \link transformFvPatchField.H \endlink + - \link fvPatchField.H \endlink + See also Foam::transformFvPatchField SourceFiles fixedNormalSlipFvPatchField.C + fixedNormalSlipFvPatchFields.C \*---------------------------------------------------------------------------*/ @@ -74,7 +91,7 @@ class fixedNormalSlipFvPatchField : public transformFvPatchField<Type> { - // Private data + // Private Data //- Value the normal component of which the boundary is set to Field<Type> fixedValue_; @@ -104,7 +121,7 @@ public: ); //- Construct by mapping given fixedNormalSlipFvPatchField - // onto a new patch + //- onto a new patch fixedNormalSlipFvPatchField ( const fixedNormalSlipFvPatchField<Type>&, @@ -148,7 +165,7 @@ public: } - // Member functions + // Member Functions // Access @@ -158,37 +175,36 @@ public: return false; } + //- Return user-defined input field + virtual Field<Type>& fixedValue() + { + return fixedValue_; + } + + //- Return user-defined input field as const field + virtual const Field<Type>& fixedValue() const + { + return fixedValue_; + } + - // Mapping functions + // Mapping //- Map (and resize as needed) from self given a mapping object virtual void autoMap ( - const fvPatchFieldMapper& + const fvPatchFieldMapper& m ); //- Reverse map the given fvPatchField onto this fvPatchField virtual void rmap ( - const fvPatchField<Type>&, - const labelList& + const fvPatchField<Type>& ptf, + const labelList& addr ); - // Return defining fields - - virtual Field<Type>& fixedValue() - { - return fixedValue_; - } - - virtual const Field<Type>& fixedValue() const - { - return fixedValue_; - } - - - // Evaluation functions + // Evaluation //- Return gradient at boundary virtual tmp<Field<Type>> snGrad() const; @@ -208,7 +224,7 @@ public: virtual void write(Ostream&) const; - // Member operators + // Member Operators virtual void operator=(const UList<Type>&) {}