fixedValueCorrected
Overview
fixedValueCorrected is a Dirichlet condition for fields of any type
(scalar, vector, sphericalTensor, symmTensor, tensor). On top of the fixed
value it stores a non-orthogonal correction $\mathbf{c}\cdot\nabla\phi_P$ of the
near-wall value. The correction is evaluated on a small sub-mesh around the
patch. It comes from the foam-extend interface-tracking solver
(interTrackFoam, Tuković), where it is used on patches whose near-wall
cells become skewed as the mesh follows a moving interface. The fixed-value
matrix coefficients themselves are not corrected. The correction only reaches
the discretisation through snGradCorrection(), which is called by the
patchCorrected snGrad scheme. That scheme is not ported (see
Known Limitations).
The BC is compiled into libinterfaceTrackingFvMesh, not
libmultiRegionSystem, so this library must be loaded. It is one of three
types derived from the common base correctedFvPatchField:
| Type | Page |
|---|---|
fixedValueCorrected | this page |
fixedGradientCorrected | fixedGradientCorrected |
zeroGradientCorrected | zeroGradientCorrected |
corrected | the base class itself, registered as a type but not usable on its own (see below) |
Mathematical Formulation
$$ \phi_b = \phi_\text{fixed} \quad \text{on } \partial\Omega $$With $\mathbf{n}$ the patch unit normal, $\boldsymbol{\Delta}$ the patch delta vector and $\delta = 1/\texttt{deltaCoeffs}$, the base class defines the correction vector and the stored correction
$$ \mathbf{c} = \boldsymbol{\Delta} - \mathbf{n}\,(\mathbf{n}\cdot\boldsymbol{\Delta}), \qquad \phi_c = \mathbf{c}\cdot(\nabla\phi)_P $$and the corrected normal gradient
$$ \left.\frac{\partial\phi}{\partial n}\right|_b = \frac{\phi_b - \phi_P}{\delta} - \frac{\phi_c}{\delta} = \frac{\phi_b - (\phi_P + \phi_c)}{\delta} $$The matrix coefficients are those of plain fixedValue:
| Coefficient | Value |
|---|---|
valueInternalCoeffs | $0$ |
valueBoundaryCoeffs | $\phi_b$ |
gradientInternalCoeffs | $-1/\delta$ |
gradientBoundaryCoeffs | $\phi_b/\delta$ |
snGradCorrection() | $-\phi_c/\delta$ |
| Symbol | Description | Unit |
|---|---|---|
| $\phi$ | Patch field | field unit |
| $\mathbf{n}$ | Patch unit normal | – |
| $\boldsymbol{\Delta}$ | Patch delta vector (patch().delta()) | m |
| $\mathbf{c}$ | Correction vector (correctionVectors()) | m |
| $(\nabla\phi)_P$ | Cell gradient next to the patch, computed on the patch sub-mesh | field unit/m |
| $\phi_c$ | Stored correction (corrVecGrad) | field unit |
| $\delta$ | $1/$patch().deltaCoeffs() | m |
Note on OpenFOAM.com. In OpenFOAM.com (v2512 and v2606),
fvPatch::delta() returns the patch-normal delta for every non-coupled patch.
So $\mathbf{c} \equiv \mathbf{0}$ and $\phi_c \equiv 0$ identically. The BC then
behaves exactly like stock fixedValue, but still does the sub-mesh work
described below on every update. The correction is only non-zero in
foam-extend, where delta() is the full $\mathbf{C}_f - \mathbf{C}_P$.
Implementation
Base class correctedFvPatchField (type corrected).
- Construction: reads
volFieldName(required) and, if present,corrVecGrad. It computes the correction vectors $\mathbf{c}$. It does not readvalueorpatchType. updateCoeffs(): if the mesh is moving, recomputes $\mathbf{c}$. Then it always callsupdateCorrVecGrad():- On first use, builds a patch sub-mesh (
fvMeshSubset) from the patch face cells plus all their neighbouring cells. The sub-mesh takes itsfvSchemes/fvSolutionfrom the region mesh. - Interpolates the volume field named
volFieldNameonto the sub-mesh. - For each component, computes
fvc::gradwith the gradient scheme namedsnGradCorr(<volFieldName>)(normally covered bygradSchemes { default ...; }). - Stores $\phi_c = \mathbf{c}\cdot(\nabla\phi)_P$ and
$\mathbf{n}\cdot(\nabla\phi)_P$ (
nGradInternal, not used by any active code path).
- On first use, builds a patch sub-mesh (
movePatchSubMesh(): moves the sub-mesh points to the current mesh points.interfaceTrackingFvMesh::update()calls it after each mesh motion for everyfixedValueCorrected,fixedGradientCorrectedorzeroGradientCorrectedpatch of the fieldsUandponly. The sub-meshes of other fields are not moved.write(): writestype,volFieldNameandcorrVecGrad.
fixedValueCorrected.
- Construction: reads
value(required) in addition to the base keywords. fixesValue()returnstrue, so no pressure reference is needed if the BC is used onp.- All assignment operators (
=,+=,-=,*=,/=with fields, patch fields or constants) are no-ops, as in stockfixedValue. The value can only be changed with==. evaluate()is not overridden, so the value stays fixed.write(): base entries plusvalue.
patchCorrectedSnGrad (not compiled). The source is in
src/dynamicFvMesh/interfaceTrackingFvMesh/patchCorrectedSnGrad. It is a
central snGrad scheme with explicit non-orthogonal correction, using the
gradient scheme snGradCorr(<field>). On patches of type
fixedValueCorrected it replaces the boundary correction by
snGradCorrection(). This is the only code path through which the stored
correction would enter a discretised equation. The entry in
src/dynamicFvMesh/Make/files is commented out (“NEEDS TO BE PORTED STILL”),
so the scheme cannot be selected.
The corrected type
makePatchFields(corrected) registers the base class as type corrected for
scalar, vector, sphericalTensor, symmTensor and tensor fields. The base class
does not implement any matrix coefficients (valueInternalCoeffs etc. fall
back to fvPatchField, which raises NotImplemented). It does not read or
write value, so its patch values are uninitialised. It also does not
override evaluate(). type corrected; is therefore not a usable boundary
condition. Use one of the three derived types.
Dictionary Entries
| Keyword | Description | Required | Default |
|---|---|---|---|
type | fixedValueCorrected | yes | – |
volFieldName | Name of the volume field this patch field belongs to (e.g. U, p). Used to look up the field for the sub-mesh gradient. | yes | – (no default) |
value | Fixed patch value | yes | – |
corrVecGrad | Initial stored correction $\phi_c$ (written on output; overwritten at the first update) | no | zero |
Library loading (system/controlDict of the case):
libs
(
"libinterfaceTrackingFvMesh.so"
);
Usage
movingWall
{
type fixedValueCorrected;
volFieldName U;
value uniform (0 0 0);
}
The field must be the one named in volFieldName. The sub-mesh is only kept
in step with mesh motion if the field is U or p and the region mesh is an
interfaceTrackingFvMesh.
Known Limitations
- No effect in OpenFOAM.com. The patch delta is patch-normal, so the
correction vectors and $\phi_c$ are identically zero. The BC is equivalent
to
fixedValue, at the cost of a sub-mesh construction and a gradient evaluation per component on everyupdateCoeffs(). patchCorrectedsnGrad scheme not ported. Even with a non-zero correction, nothing in the compiled code would usesnGradCorrection(). The matrix coefficients are those of plainfixedValue.- Interface-tracking region type disabled. The BCs were meant for
interTrackFluid, which is commented out insrc/multiRegionSystem/Make/files. ThemultiphaseFlowtutorials that need it (2dRisingBubble,3dDuineveldRisingBubble,3dOscillatingBubble) cannot currently be run. Only3dDuineveldRisingBubblementionspatchCorrected, and only in comments in its base-meshfvSchemes. volFieldNamehas no default and must match the field name. Otherwise the field lookup inupdateCoeffs()fails.- Sub-mesh motion only for
Uandp. For any other field, the sub-mesh keeps its initial geometry while the mesh moves. correctedis not a standalone BC (see above).
In practice, use the stock fixedValue instead.
Tutorials
No tutorial uses fixedValueCorrected (or any *Corrected type). The FSI
tutorials beamInCrossFlow, heatedBeamInCrossFlow and HronTurekFsi3 load
libinterfaceTrackingFvMesh.so for their interfaceTrackingFvMesh fluid mesh,
but their fields use stock and regionCoupled* boundary conditions.
References
- Tuković, Ž., Jasak, H., A moving mesh finite volume interface tracking method for surface tension dominated interfacial fluid flow, Computers & Fluids 55, 2012. DOI: 10.1016/j.compfluid.2011.11.003
- Alkfri, A., Habes, C., Marschall, H., multiRegionFoam: A Unified Multiphysics Framework for Multi-Region Coupled Continuum-Physical Problems, Engineering with Computers, 2023. DOI: 10.1007/s00366-024-01974-4