SlideShare a Scribd company logo
8
Most read
11
Most read
15
Most read
OpenFOAM
Limited Version
of Gradient
Schemes
Fumiya Nozaki
Last Updated: 17 June 2014
English
Keywords:
• cellLimited
2
Cell or Face limited version of gradient schemes
 Four different types of limiters are available for the gradient schemes
• cellLimited
• cellMDLimited
• faceLimited
• faceMDLimited
 Usage
gradSchemes
{
grad(p) cellLimited Gauss linear 1;
}
Four choices k: A parameter to control
the degree of limiting
operation
3
Effects of the controlling parameter k
gradSchemes
{
grad(p) cellLimited Gauss linear 1;
}
0 1
 This parameter ranges from 0 to 1
No limiting
operations
Full limiting
operations
Stability
Accuracy
4
Let’s look into
the code!
5
1. CellLimited
Scheme
Source code:
OpenFOAM-2.3.x/src/finiteVolume/finiteVolume/
gradSchemes/limitedGradSchemes/cellLimitedGrad
6
tmp<volVectorField> tGrad = basicGradScheme_().calcGrad(vsf, name);
if (k_ < SMALL)
{
return tGrad;
}
volVectorField& g = tGrad();
const labelUList& owner = mesh.owner(); Label list of owner cells
const labelUList& neighbour = mesh.neighbour();
Label list of neighbour cells
const volVectorField& C = mesh.C(); Cell center coordinates
const surfaceVectorField& Cf = mesh.Cf(); Face center coordinates
scalarField maxVsf(vsf.internalField());
scalarField minVsf(vsf.internalField());
 If the parameter value is set to “0”, the limiting operation is completely
deactivated.
SMALL = 1.0e-15
Gradient value without limiting operations
 Variable declarations
They are used to
calculate the limiter.
7
forAll(owner, facei)
{
label own = owner[facei];
label nei = neighbour[facei];
scalar vsfOwn = vsf[own];
scalar vsfNei = vsf[nei];
maxVsf[own] = max(maxVsf[own], vsfNei);
minVsf[own] = min(minVsf[own], vsfNei);
maxVsf[nei] = max(maxVsf[nei], vsfOwn);
minVsf[nei] = min(minVsf[nei], vsfOwn);
}
 Calculation of “maxVsf” and “minVsf” (Internal face loop)
Loop through the internal faces
vsfOwn vsfNei
Values at
cell centers
facei
maxVsf [N-th cell] = max vsf[cellI]
• At the end of the above loop we get the following relationships:
cellI ∈ SN
minVsf [N-th cell] = min vsf[cellI]
cellI ∈ SN
N
SN includes
N-th cell and
adjacent cells
8
 Calculation of “maxVsf” and “minVsf” (Boundary face loop)
const volScalarField::GeometricBoundaryField& bsf = vsf.boundaryField();
forAll(bsf, patchi)
{
const fvPatchScalarField& psf = bsf[patchi];
const labelUList& pOwner = mesh.boundary()[patchi].faceCells();
if (psf.coupled())
{
const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei)
{
label own = pOwner[pFacei];
scalar vsfNei = psfNei[pFacei];
maxVsf[own] = max(maxVsf[own], vsfNei);
minVsf[own] = min(minVsf[own], vsfNei);
}
}
else
{
forAll(pOwner, pFacei)
{
label own = pOwner[pFacei];
scalar vsfNei = psf[pFacei];
maxVsf[own] = max(maxVsf[own], vsfNei);
minVsf[own] = min(minVsf[own], vsfNei);
}
}
}
Loop through the boundary faces
on the coupled patches
Loop through the boundary faces
on the other patches
• Put
Then ... (Cont’d)
9
maxVsf -= vsf;
minVsf -= vsf;
if (k_ < 1.0)
{
const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf;
minVsf -= maxMinVsf;
//maxVsf *= 1.0/k_;
//minVsf *= 1.0/k_;
}
 Calculation of the final values of “maxVsf” and “minVsf”
maxV[N] = max { max vsf[cellI],max psf[pFacei] }
cellI ∈ SN
N
pFacei ∈ PN
PN: Set of the faces of N-th cell
that are also boundary faces
minV[N] = min { min vsf[cellI],min psf[pFacei] }
cellI ∈ SN pFacei ∈ PN
pFacei
10
Then we can write as shown below:
maxVsf[N] = maxV[N] – vsf[N] +
1
𝑘
− 1 × (maxV[N] – minV[N])
minVsf[N] = minV[N] – vsf[N] -
1
𝑘
− 1 × (maxV[N] – minV[N])
• maxVsf[N] ≧ 0 and minVsf[N] ≦ 0
• As the parameter k_ approaches 0, the absolute values of maxVsf[N]
and minVsf[N] increase.
maxVsf -= vsf;
minVsf -= vsf;
if (k_ < 1.0)
{
const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf;
minVsf -= maxMinVsf;
//maxVsf *= 1.0/k_;
//minVsf *= 1.0/k_;
}
11
// create limiter
scalarField limiter(vsf.internalField().size(), 1.0);
forAll(owner, facei)
{
label own = owner[facei];
label nei = neighbour[facei];
// owner side
limitFace
(
limiter[own],
maxVsf[own],
minVsf[own],
(Cf[facei] - C[own]) & g[own]
);
// neighbour side
limitFace
(
limiter[nei],
maxVsf[nei],
minVsf[nei],
(Cf[facei] - C[nei]) & g[nei]
);
}
 Calculation of “limiter”
Initial value
Loop through the internal faces
Call limitFace()
and calculate
limiter values
C[own] C[nei]
faceiCf[facei]
12
limitFace
template<>
inline void cellLimitedGrad<scalar>::limitFace
(
scalar& limiter,
const scalar& maxDelta,
const scalar& minDelta,
const scalar& extrapolate
)
{
if (extrapolate > maxDelta + VSMALL)
{
limiter = min(limiter, maxDelta/extrapolate);
}
else if (extrapolate < minDelta - VSMALL)
{
limiter = min(limiter, minDelta/extrapolate);
}
}
cellLimitedGrad.H
13
limitFace
maxDelta
minDelta
extrapolate
extrapolate > maxDelta
limiter = min(limiter, maxDelta/extrapolate)
Then, limiter × extrapolate ≦ maxDelta.
14
limitFace
r & g[own] > maxVsf[own]
limiter[own] = min(limiter[own], maxVsf[own]/r & g[own])
Then, r & g[own]*limiter[own] ≦ maxVsf[own]
maxVsf[own]
minVsf[own]
r & g[own]
𝒓
Cf[facei]
C[own]
vsf[own]
vsf[nei]
15
maxVsf[own]
r & g[own]
vsf[own]
vsf[nei]
Clipped part
Visualization of effects of k
As k approaches 1, maxVsf[own] decreases
16
maxVsf[own]
r & g[own]
vsf[own]
vsf[nei]
Clipped part
As k approaches 1, the limiter has further limiting effect
Visualization of effects of k
17
g.internalField() *= limiter;
g.correctBoundaryConditions();
gaussGrad<scalar>::correctBoundaryConditions(vsf, g);
return tGrad;
 Calculation of limited gradient
Limited gradient value =
Gradient value without limiting operations * limiter
g * limiter
Limiter equally clips each component of the gradient
1818
2. CellMDLimited
Scheme
Source code:
OpenFOAM-2.3.x/src/finiteVolume/finiteVolume/
gradSchemes/limitedGradSchemes/cellMDLimitedGrad
19
This chapter will
be updated as
soon as possible.

More Related Content

PDF
OpenFOAM LES乱流モデルカスタマイズ
mmer547
 
PDF
Spatial Interpolation Schemes in OpenFOAM
Fumiya Nozaki
 
PDF
CFD for Rotating Machinery using OpenFOAM
Fumiya Nozaki
 
PDF
OpenFOAM の境界条件をまとめよう!
Fumiya Nozaki
 
PDF
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
Fumiya Nozaki
 
PDF
OpenFOAM の Function Object 機能について
Fumiya Nozaki
 
PDF
OpenFOAMにおける混相流計算
takuyayamamoto1800
 
PDF
Boundary Conditions in OpenFOAM
Fumiya Nozaki
 
OpenFOAM LES乱流モデルカスタマイズ
mmer547
 
Spatial Interpolation Schemes in OpenFOAM
Fumiya Nozaki
 
CFD for Rotating Machinery using OpenFOAM
Fumiya Nozaki
 
OpenFOAM の境界条件をまとめよう!
Fumiya Nozaki
 
OpenFOAM の cyclic、cyclicAMI、cyclicACMI 条件について
Fumiya Nozaki
 
OpenFOAM の Function Object 機能について
Fumiya Nozaki
 
OpenFOAMにおける混相流計算
takuyayamamoto1800
 
Boundary Conditions in OpenFOAM
Fumiya Nozaki
 

What's hot (20)

PDF
OpenFOAM -空間の離散化と係数行列の取り扱い(Spatial Discretization and Coefficient Matrix)-
Fumiya Nozaki
 
PDF
OpenFOAM Programming Tips
Fumiya Nozaki
 
PDF
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
Fumiya Nozaki
 
PDF
OpenFOAMにおけるDEM計算の力モデルの解読
takuyayamamoto1800
 
PDF
Turbulence Models in OpenFOAM
Fumiya Nozaki
 
PDF
OpenFOAMの壁関数
Fumiya Nozaki
 
PDF
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
Fumiya Nozaki
 
PDF
ParaView による可視化 Tips
Fumiya Nozaki
 
PDF
Dynamic Mesh in OpenFOAM
Fumiya Nozaki
 
PDF
Paraviewの等高面を綺麗に出力する
takuyayamamoto1800
 
PDF
Basic Boundary Conditions in OpenFOAM v2.4
Fumiya Nozaki
 
PDF
OpenFOAMの混相流用改造solver(S-CLSVOF法)の設定・使い方
takuyayamamoto1800
 
PDF
OpenFOAMにおけるDEM計算の衝突モデルの解読
takuyayamamoto1800
 
PDF
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
takuyayamamoto1800
 
PDF
Of tutorials v1806
Etsuji Nomura
 
PPTX
About chtMultiRegionFoam
守淑 田村
 
PDF
About dexcs2021 for OpenFOAM
Etsuji Nomura
 
PDF
ParaviewでのParticle Tracerを用いた可視化
takuyayamamoto1800
 
PPTX
OpenFOAMにおける相変化解析
takuyayamamoto1800
 
PDF
Of tutorials v1712
Etsuji Nomura
 
OpenFOAM -空間の離散化と係数行列の取り扱い(Spatial Discretization and Coefficient Matrix)-
Fumiya Nozaki
 
OpenFOAM Programming Tips
Fumiya Nozaki
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
Fumiya Nozaki
 
OpenFOAMにおけるDEM計算の力モデルの解読
takuyayamamoto1800
 
Turbulence Models in OpenFOAM
Fumiya Nozaki
 
OpenFOAMの壁関数
Fumiya Nozaki
 
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
Fumiya Nozaki
 
ParaView による可視化 Tips
Fumiya Nozaki
 
Dynamic Mesh in OpenFOAM
Fumiya Nozaki
 
Paraviewの等高面を綺麗に出力する
takuyayamamoto1800
 
Basic Boundary Conditions in OpenFOAM v2.4
Fumiya Nozaki
 
OpenFOAMの混相流用改造solver(S-CLSVOF法)の設定・使い方
takuyayamamoto1800
 
OpenFOAMにおけるDEM計算の衝突モデルの解読
takuyayamamoto1800
 
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
takuyayamamoto1800
 
Of tutorials v1806
Etsuji Nomura
 
About chtMultiRegionFoam
守淑 田村
 
About dexcs2021 for OpenFOAM
Etsuji Nomura
 
ParaviewでのParticle Tracerを用いた可視化
takuyayamamoto1800
 
OpenFOAMにおける相変化解析
takuyayamamoto1800
 
Of tutorials v1712
Etsuji Nomura
 
Ad

Viewers also liked (16)

PDF
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
Fumiya Nozaki
 
PDF
CAESES Free チュートリアル
Fumiya Nozaki
 
PDF
Adjoint Shape Optimization using OpenFOAM
Fumiya Nozaki
 
PDF
blockCoupledSwirlTestチュートリアル
Fumiya Nozaki
 
PDF
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
Fumiya Nozaki
 
PDF
無償のモデリングソフトウェアCAESESを使ってみた
Fumiya Nozaki
 
PDF
OpenFOAM for beginners: Hands-on training
Jibran Haider
 
PDF
Optimization of parameter settings for GAMG solver in simple solver, OpenFOAM...
Masashi Imano
 
PDF
Flow and Noise Simulation of the NASA Tandem Cylinder Experiment using OpenFOAM
Con Doolan
 
PDF
OpenFOAM を用いた Adjoint 形状最適化事例1
Fumiya Nozaki
 
PDF
Large strain solid dynamics in OpenFOAM
Jibran Haider
 
PDF
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
Fumiya Nozaki
 
PDF
Optimization of relaxation factor for simple solver, OpenFOAM Study Meeting f...
Masashi Imano
 
PDF
Runtime Performance Optimizations for an OpenFOAM Simulation
Fisnik Kraja
 
PDF
Improvements of the Interpolationand Non-Orthogonal Correction Schemes in Caelus
Applied CCM Pty Ltd
 
PDF
Week9
s1160120
 
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
Fumiya Nozaki
 
CAESES Free チュートリアル
Fumiya Nozaki
 
Adjoint Shape Optimization using OpenFOAM
Fumiya Nozaki
 
blockCoupledSwirlTestチュートリアル
Fumiya Nozaki
 
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
Fumiya Nozaki
 
無償のモデリングソフトウェアCAESESを使ってみた
Fumiya Nozaki
 
OpenFOAM for beginners: Hands-on training
Jibran Haider
 
Optimization of parameter settings for GAMG solver in simple solver, OpenFOAM...
Masashi Imano
 
Flow and Noise Simulation of the NASA Tandem Cylinder Experiment using OpenFOAM
Con Doolan
 
OpenFOAM を用いた Adjoint 形状最適化事例1
Fumiya Nozaki
 
Large strain solid dynamics in OpenFOAM
Jibran Haider
 
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
Fumiya Nozaki
 
Optimization of relaxation factor for simple solver, OpenFOAM Study Meeting f...
Masashi Imano
 
Runtime Performance Optimizations for an OpenFOAM Simulation
Fisnik Kraja
 
Improvements of the Interpolationand Non-Orthogonal Correction Schemes in Caelus
Applied CCM Pty Ltd
 
Week9
s1160120
 
Ad

Similar to Limited Gradient Schemes in OpenFOAM (8)

PDF
Finite Volume Discretisation in OpenFOAM
ilyesdata6
 
PPT
study Streaming Multigrid For Gradient Domain Operations On Large Images
Chiamin Hsu
 
PDF
thesis.MSc
Nassim Jibai
 
PDF
Simpson and lagranje dalambair math methods
kinan keshkeh
 
PDF
FiniteElementNotes
Martin Jones
 
PPTX
UnderstandingElmerFEM.pptx
PhynnovativeYT
 
PDF
Revisiting Projection Methods over Automatic Oct-tree Meshes
Abhishek Jain
 
PPTX
CVPR2016 Fitting Surface Models to Data 抜粋
sumisumith
 
Finite Volume Discretisation in OpenFOAM
ilyesdata6
 
study Streaming Multigrid For Gradient Domain Operations On Large Images
Chiamin Hsu
 
thesis.MSc
Nassim Jibai
 
Simpson and lagranje dalambair math methods
kinan keshkeh
 
FiniteElementNotes
Martin Jones
 
UnderstandingElmerFEM.pptx
PhynnovativeYT
 
Revisiting Projection Methods over Automatic Oct-tree Meshes
Abhishek Jain
 
CVPR2016 Fitting Surface Models to Data 抜粋
sumisumith
 

Recently uploaded (20)

PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 

Limited Gradient Schemes in OpenFOAM

  • 1. OpenFOAM Limited Version of Gradient Schemes Fumiya Nozaki Last Updated: 17 June 2014 English Keywords: • cellLimited
  • 2. 2 Cell or Face limited version of gradient schemes  Four different types of limiters are available for the gradient schemes • cellLimited • cellMDLimited • faceLimited • faceMDLimited  Usage gradSchemes { grad(p) cellLimited Gauss linear 1; } Four choices k: A parameter to control the degree of limiting operation
  • 3. 3 Effects of the controlling parameter k gradSchemes { grad(p) cellLimited Gauss linear 1; } 0 1  This parameter ranges from 0 to 1 No limiting operations Full limiting operations Stability Accuracy
  • 6. 6 tmp<volVectorField> tGrad = basicGradScheme_().calcGrad(vsf, name); if (k_ < SMALL) { return tGrad; } volVectorField& g = tGrad(); const labelUList& owner = mesh.owner(); Label list of owner cells const labelUList& neighbour = mesh.neighbour(); Label list of neighbour cells const volVectorField& C = mesh.C(); Cell center coordinates const surfaceVectorField& Cf = mesh.Cf(); Face center coordinates scalarField maxVsf(vsf.internalField()); scalarField minVsf(vsf.internalField());  If the parameter value is set to “0”, the limiting operation is completely deactivated. SMALL = 1.0e-15 Gradient value without limiting operations  Variable declarations They are used to calculate the limiter.
  • 7. 7 forAll(owner, facei) { label own = owner[facei]; label nei = neighbour[facei]; scalar vsfOwn = vsf[own]; scalar vsfNei = vsf[nei]; maxVsf[own] = max(maxVsf[own], vsfNei); minVsf[own] = min(minVsf[own], vsfNei); maxVsf[nei] = max(maxVsf[nei], vsfOwn); minVsf[nei] = min(minVsf[nei], vsfOwn); }  Calculation of “maxVsf” and “minVsf” (Internal face loop) Loop through the internal faces vsfOwn vsfNei Values at cell centers facei maxVsf [N-th cell] = max vsf[cellI] • At the end of the above loop we get the following relationships: cellI ∈ SN minVsf [N-th cell] = min vsf[cellI] cellI ∈ SN N SN includes N-th cell and adjacent cells
  • 8. 8  Calculation of “maxVsf” and “minVsf” (Boundary face loop) const volScalarField::GeometricBoundaryField& bsf = vsf.boundaryField(); forAll(bsf, patchi) { const fvPatchScalarField& psf = bsf[patchi]; const labelUList& pOwner = mesh.boundary()[patchi].faceCells(); if (psf.coupled()) { const scalarField psfNei(psf.patchNeighbourField()); forAll(pOwner, pFacei) { label own = pOwner[pFacei]; scalar vsfNei = psfNei[pFacei]; maxVsf[own] = max(maxVsf[own], vsfNei); minVsf[own] = min(minVsf[own], vsfNei); } } else { forAll(pOwner, pFacei) { label own = pOwner[pFacei]; scalar vsfNei = psf[pFacei]; maxVsf[own] = max(maxVsf[own], vsfNei); minVsf[own] = min(minVsf[own], vsfNei); } } } Loop through the boundary faces on the coupled patches Loop through the boundary faces on the other patches
  • 9. • Put Then ... (Cont’d) 9 maxVsf -= vsf; minVsf -= vsf; if (k_ < 1.0) { const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; //maxVsf *= 1.0/k_; //minVsf *= 1.0/k_; }  Calculation of the final values of “maxVsf” and “minVsf” maxV[N] = max { max vsf[cellI],max psf[pFacei] } cellI ∈ SN N pFacei ∈ PN PN: Set of the faces of N-th cell that are also boundary faces minV[N] = min { min vsf[cellI],min psf[pFacei] } cellI ∈ SN pFacei ∈ PN pFacei
  • 10. 10 Then we can write as shown below: maxVsf[N] = maxV[N] – vsf[N] + 1 𝑘 − 1 × (maxV[N] – minV[N]) minVsf[N] = minV[N] – vsf[N] - 1 𝑘 − 1 × (maxV[N] – minV[N]) • maxVsf[N] ≧ 0 and minVsf[N] ≦ 0 • As the parameter k_ approaches 0, the absolute values of maxVsf[N] and minVsf[N] increase. maxVsf -= vsf; minVsf -= vsf; if (k_ < 1.0) { const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf)); maxVsf += maxMinVsf; minVsf -= maxMinVsf; //maxVsf *= 1.0/k_; //minVsf *= 1.0/k_; }
  • 11. 11 // create limiter scalarField limiter(vsf.internalField().size(), 1.0); forAll(owner, facei) { label own = owner[facei]; label nei = neighbour[facei]; // owner side limitFace ( limiter[own], maxVsf[own], minVsf[own], (Cf[facei] - C[own]) & g[own] ); // neighbour side limitFace ( limiter[nei], maxVsf[nei], minVsf[nei], (Cf[facei] - C[nei]) & g[nei] ); }  Calculation of “limiter” Initial value Loop through the internal faces Call limitFace() and calculate limiter values C[own] C[nei] faceiCf[facei]
  • 12. 12 limitFace template<> inline void cellLimitedGrad<scalar>::limitFace ( scalar& limiter, const scalar& maxDelta, const scalar& minDelta, const scalar& extrapolate ) { if (extrapolate > maxDelta + VSMALL) { limiter = min(limiter, maxDelta/extrapolate); } else if (extrapolate < minDelta - VSMALL) { limiter = min(limiter, minDelta/extrapolate); } } cellLimitedGrad.H
  • 13. 13 limitFace maxDelta minDelta extrapolate extrapolate > maxDelta limiter = min(limiter, maxDelta/extrapolate) Then, limiter × extrapolate ≦ maxDelta.
  • 14. 14 limitFace r & g[own] > maxVsf[own] limiter[own] = min(limiter[own], maxVsf[own]/r & g[own]) Then, r & g[own]*limiter[own] ≦ maxVsf[own] maxVsf[own] minVsf[own] r & g[own] 𝒓 Cf[facei] C[own] vsf[own] vsf[nei]
  • 15. 15 maxVsf[own] r & g[own] vsf[own] vsf[nei] Clipped part Visualization of effects of k As k approaches 1, maxVsf[own] decreases
  • 16. 16 maxVsf[own] r & g[own] vsf[own] vsf[nei] Clipped part As k approaches 1, the limiter has further limiting effect Visualization of effects of k
  • 17. 17 g.internalField() *= limiter; g.correctBoundaryConditions(); gaussGrad<scalar>::correctBoundaryConditions(vsf, g); return tGrad;  Calculation of limited gradient Limited gradient value = Gradient value without limiting operations * limiter g * limiter Limiter equally clips each component of the gradient
  • 19. 19 This chapter will be updated as soon as possible.