Skip to content
Snippets Groups Projects
Commit a9fd39c6 authored by Johan Roenby's avatar Johan Roenby Committed by Kutalmış Berçin
Browse files

BUG: fixedNormalSlip BC: add 'value' keyword (#1980,#1981)


DOC: improve header-file content

Co-authored-by: default avatarKutalmis Bercin <kutalmis.bercin@esi-group.com>
parent 84a14529
Branches
Tags
No related merge requests found
......@@ -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);
}
......
......@@ -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>&) {}
......
  • Johan Roenby @johan_roenby ·
    Author Contributor

    A correction to my submitted issue: I wrote that the value in the write funtion is needed "for restart and visualisation in paraview". In fact, restart will probably work correctly without the value written out because evaluate() is called by the dict-reading constructor and, indeed, this reconstructs the face values on the patch correctly using the fixedValue and slip condition.

    The point about paraview not showing the correct velocity on a patch when using the BC still holds. I have confirmed that, and that the addition of the value in write solves this (I used paraview, not paraFoam). So one could argue that this is a paraview OpenFOAM reader problem, rather than a problem with the BC implementation itself.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment