stabilityBlendingFactor
Description
The stabilityBlendingFactor function object
computes the stabilityBlendingFactor to be used by the
local blended convection scheme. The output is a surface field weight
between 0-1.
The weight of a blended scheme, i.e. w, is given by a function of
the blending factor, f:
The factor is calculated based on six criteria:
- mesh non-orthogonality field
- magnitude of cell centres gradient
- convergence rate of residuals
- faceWeight
- skewness
- Courant number
The user can enable them individually.
For option 1, the following relation is used, where is the non-orthogonality:
For option 2, the following relation is used, where is the magnitude of cell centres gradient (Note that for orthogonal meshes):
For option 3, a PID control is used in order to control residual unbounded fluctuations for individual cells.
where P, I and D are user inputs.
The following relation is used:
where
: Average(residual)
: User input
Note that will blend more towards one as the cell residual is larger then the domain mean residuals.
For option 4, the following relation is used, where is the face weight (Note that for orthogonal meshes):
For option 5, the following relation is used, where is the cell skewness:
For option 6, the following relation is used:
where
Co1 : Courant number below which scheme2 is used
Co2 : Courant number above which scheme1 is used
The final factor is determined by:
An indicator (volume) field, named blendedIndicator is generated if the log
flag is on:
1 : represent scheme1 as active,
0 : represent scheme2 as active.
Additional reporting is written to the standard output, providing statistics as to the number of cells used by each scheme.
Operands
| Operand | Type | Location |
|---|---|---|
| input | - | - |
| output file | dat | $FOAM_CASE/postProcessing/<FO>/<time>/<file> |
| output field | volScalarField | $FOAM_CASE/<time>/<outField> |
Usage
Example of the stabilityBlendingFactor function object
by using functions sub-dictionary in system/controlDict file:
stabilityBlendingFactor1
{
// Mandatory entries (unmodifiable)
type stabilityBlendingFactor;
libs (fieldFunctionObjects);
// Mandatory entries (unmodifiable)
field <field>; // U;
result <outField>; // UBlendingFactor;
// Optional entries (runtime modifiable)
tolerance 0.001;
// Any of the options can be chosen in combinations
// Option-1
switchNonOrtho true;
nonOrthogonality nonOrthoAngle;
maxNonOrthogonality 20;
minNonOrthogonality 60;
// Option-2
switchGradCc true;
maxGradCc 3;
minGradCc 4;
// Option-3
switchResiduals true;
maxResidual 10;
residual initialResidual:p;
P 1.5;
I 0;
D 0.5;
// Option-4
switchFaceWeight true;
maxFaceWeight 0.3;
minFaceWeight 0.2;
// Option-5
switchSkewness true;
maxSkewness 2;
minSkewness 3;
// Option-6
switchCo true;
U U;
Co1 1;
Co2 10;
// Optional (inherited) entries
writePrecision 8;
writeToFile true;
useUserTime true;
region region0;
enabled true;
log true;
timeStart 0;
timeEnd 1000;
executeControl timeStep;
executeInterval 1;
writeControl timeStep;
writeInterval 1;
}
where the entries mean:
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Type name: stabilityBlendingFactor | word | yes | - |
| libs | Library name: fieldFunctionObjects | word | yes | - |
| field | Name of the operand field | word | yes | - |
| result | Name of surface field used in the localBlended scheme | word | yes | - |
| switchNonOrtho | Select non-orthogonal method | bool | no | false |
| nonOrthogonality | Name of the non-orthogonal field | word | no | nonOrthoAngle |
| maxNonOrthogonality | Maximum non-orthogonal for scheme2 | scalar | no | 20 |
| minNonOrthogonality | Minimum non-orthogonal for scheme1 | scalar | no | 60 |
| switchGradCc | Select cell centre gradient method | bool | no | false |
| maxGradCc | Maximum gradient for scheme2 | scalar | no | 2 |
| minGradCc | Minimum gradient for scheme1 | scalar | no | 4 |
| switchResiduals | Select residual evolution method | bool | no | false |
| residual | Name of the residual field | word | no | initialResidual:p |
| maxResidual | Maximum residual-mean ratio for scheme1 | scalar | no | 10 |
| P | Proportional factor for PID | scalar | no | 3 |
| I | Integral factor for PID | scalar | no | 0 |
| D | Differential factor for PID | scalar | no | 0.25 |
| switchFaceWeight | Select face weight method | bool | no | false |
| faceWeight | Name of the faceWeight field | word | no | faceWeight |
| maxFaceWeight | Maximum face weight for scheme1 | scalar | no | 0.2 |
| minFaceWeight | Minimum face weight for scheme2 | scalar | no | 0.3 |
| switchSkewness | Select skewness method | bool | no | false |
| skewness | Name of the skewness field | word | no | skewness |
| maxSkewness | Maximum skewness for scheme2 | scalar | no | 2 |
| minSkewness | Minimum skewness for scheme1 | scalar | no | 3 |
| switchCo | Select Co blended method | bool | no | false |
| U | Name of the flux field for Co blended | word | no | U |
| Co1 | Courant number below which scheme2 is used | scalar | no | 1 |
| Co2 | Courant number above which scheme1 is used | scalar | no | 10 |
| tolerance | Tolerance for number of blended cells | scalar | no | 0.001 |
The result entry is the field which is read by the localBlended scheme
specified in fvSchemes. This name is determined by the localBlended class.
The inherited entries are elaborated in:
Usage by the postProcess utility is not available.
Further information
Tutorial:
Source code:
API:
History: Introduced in version v1806