SlideShare a Scribd company logo
OpenFOAM
Spatial
Interpolation
Fumiya Nozaki
Last Updated: 16 June 2014
English
2
FVM discretization
𝛻𝜓 𝑑𝑉
𝑉
= 𝑑𝑺 ∙ 𝜓
𝑆
= 𝑺 𝑓 ∙ 𝜓 𝑓
𝑓
Values at
face centers
 Most spatial derivative terms are first integrated over a cell volume 𝑉
and then converted to integrals over the cell surface bounding the
volume using Gauss’s theorem
Gauss’s theorem
Spatial
discretization
3
Interpolation from cells to faces
Owner cell
center
Neighbour cell
center
Face
center
𝜓 𝑃 𝜓 𝑁
𝜓 𝑓
 What we need is some algebraic relational expressions
𝜓 𝑓 = 𝑓 𝜓 𝑃, 𝜓 𝑁
 Typical interpolation schemes in OpenFOAM
 upwind
 linearUpwind
 linear
 limitedLinear
etc.
Many other schemes are available for use
in the spatial interpolation [1].
4
Available interpolation schemes in OpenFOAM
𝜓 𝑓 = 𝑓 𝜓 𝑃, 𝜓 𝑁
5
Specification of interpolation schemes
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div((nuEff*(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
 Interpolation schemes are chosen on a term-by-term basis
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
6
Specification of interpolation schemes
 Interpolation schemes are chosen on a term-by-term basis
𝛻𝑝 𝑑𝑉
𝑉
= 𝑑𝑺 ∙ 𝑝
𝑆
= 𝑺 𝑓 ∙ 𝑝 𝑓
𝑓
7
Specification of interpolation schemes
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div((nuEff*(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
 Interpolation schemes are chosen on a term-by-term basis
𝛻 ∙ 𝜈 𝛻𝒖 𝑇
𝑑𝑉
𝑉
= 𝑑𝑺 ∙ 𝜈 𝛻𝒖 𝑇
𝑆
= 𝑺 𝑓 ∙ 𝜈 𝛻𝒖 𝑇
𝑓
𝑓
𝛻 ∙ 𝑼𝑼 𝑑𝑉
𝑉
= 𝑑𝑺 ∙ 𝑼𝑼
𝑆
= 𝑺 𝑓 ∙ 𝑼 𝑓 𝑼 𝑓
𝑓
= 𝐹𝑼 𝑓
𝑓
8
Specification of interpolation schemes
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
 Interpolation schemes are chosen on a term-by-term basis
𝛻 ∙ Γ𝛻𝜙 𝑑𝑉
𝑉
= 𝑑𝑺 ∙ Γ𝛻𝜙
𝑆
= Γ𝑓 𝑺 𝑓 ∙ 𝛻𝜙 𝑓
𝑓
9
Let’s look into
the code!
10
surfaceInterpolationScheme.C
0322 //- Return the face-interpolate of the given cell field
0323 // with explicit correction
0324 template<class Type>
0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
0326 surfaceInterpolationScheme<Type>::interpolate
0327 (
0328 const GeometricField<Type, fvPatchField, volMesh>& vf
0329 ) const
0330 {
0331 if (surfaceInterpolation::debug)
0332 {
0333 Info<< "surfaceInterpolationScheme<Type>::interpolate"
0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : "
0335 "interpolating "
0336 << vf.type() << " "
0337 << vf.name()
0338 << " from cells to faces"
0339 << endl;
0340 }
0341
0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf
0343 = interpolate(vf, weights(vf));
0344
0345 if (corrected())
0346 {
0347 tsf() += correction(vf);
0348 }
0349
0350 return tsf;
0351 }
surfaceInterpolationScheme.C
Without explicit correction
Addition of explicit correction
11
surfaceInterpolationScheme.C
0322 //- Return the face-interpolate of the given cell field
0323 // with explicit correction
0324 template<class Type>
0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
0326 surfaceInterpolationScheme<Type>::interpolate
0327 (
0328 const GeometricField<Type, fvPatchField, volMesh>& vf
0329 ) const
0330 {
0331 if (surfaceInterpolation::debug)
0332 {
0333 Info<< "surfaceInterpolationScheme<Type>::interpolate"
0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : "
0335 "interpolating "
0336 << vf.type() << " "
0337 << vf.name()
0338 << " from cells to faces"
0339 << endl;
0340 }
0341
0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf
0343 = interpolate(vf, weights(vf));
0344
0345 if (corrected())
0346 {
0347 tsf() += correction(vf);
0348 }
0349
0350 return tsf;
0351 }
surfaceInterpolationScheme.C
“weights()” are different
depending on the
interpolation scheme.
12
surfaceInterpolationScheme.C
0322 //- Return the face-interpolate of the given cell field
0323 // with explicit correction
0324 template<class Type>
0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
0326 surfaceInterpolationScheme<Type>::interpolate
0327 (
0328 const GeometricField<Type, fvPatchField, volMesh>& vf
0329 ) const
0330 {
0331 if (surfaceInterpolation::debug)
0332 {
0333 Info<< "surfaceInterpolationScheme<Type>::interpolate"
0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : "
0335 "interpolating "
0336 << vf.type() << " "
0337 << vf.name()
0338 << " from cells to faces"
0339 << endl;
0340 }
0341
0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf
0343 = interpolate(vf, weights(vf));
0344
0345 if (corrected())
0346 {
0347 tsf() += correction(vf);
0348 }
0349
0350 return tsf;
0351 }
surfaceInterpolationScheme.C
“interpolate()” calculates
interpolated face value
without explicit correction.
Turn to the next page.
13
surfaceInterpolationScheme.C
0266 const surfaceScalarField& lambdas = tlambdas();
0267
0268 const Field<Type>& vfi = vf.internalField();
0269 const scalarField& lambda = lambdas.internalField();
0270
0271 const fvMesh& mesh = vf.mesh();
0272 const labelUList& P = mesh.owner();
0273 const labelUList& N = mesh.neighbour();
0274
0275 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf
0276 (
0277 new GeometricField<Type, fvsPatchField, surfaceMesh>
0278 (
0279 IOobject
0280 (
0281 "interpolate("+vf.name()+')',
0282 vf.instance(),
0283 vf.db()
0284 ),
0285 mesh,
0286 vf.dimensions()
0287 )
0288 );
0289 GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf();
0290
0291 Field<Type>& sfi = sf.internalField();
0292
0293 for (register label fi=0; fi<P.size(); fi++)
0294 {
0295 sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]];
0296 }
surfaceInterpolationScheme.C
sfi[fi] represents the
interpolated value at
the fi-th face center.
14
First look into “upwind” scheme
Table 4.6: Interpolation schemes [1]
upwind
Flow directions are considered.
15
Calculation of weights
0128 //- Return the interpolation weighting factors
0129 tmp<surfaceScalarField> weights() const
0130 {
0131 return pos(this->faceFlux_);
0132 }
0133
0134 //- Return the interpolation weighting factors
0135 virtual tmp<surfaceScalarField> weights
0136 (
0137 const GeometricField<Type, fvPatchField, volMesh>&
0138 ) const
0139 {
0140 return weights();
0141 }
upwind.H
 l. 0131
𝑤𝑒𝑖𝑔ℎ𝑡𝑠() facei =
1
0
if 𝑓𝑎𝑐𝑒𝐹𝑙𝑢𝑥 facei > 0
if 𝑓𝑎𝑐𝑒𝐹𝑙𝑢𝑥 facei ≤ 0
upwind
16
Explicit correction
0175 //- Return true if this scheme uses an explicit correction
0176 virtual bool corrected() const
0177 {
0178 return false;
0179 }
surfaceInterpolationScheme.H
 For “upwind” scheme, corrected() returns “false”
So, “upwind” interpolation has no explicit correction.
 Evaluation of the interpolated value
• If phi[facei] > 0
sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= weights()[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= 1*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= vfi[P[fi]] = owner cell value
• If phi[facei] ≦ 0
sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= 0*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= vfi[N[fi]] = neighbour cell value
upwind
17
Interpolated valueupwind
phi[facei] > 0 phi[facei] ≦ 0
owner neighbour owner neighbour
owner is the upstream cell neighbour is the upstream cell
𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢
= 𝝍 𝒐𝒘𝒏𝒆𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢
= 𝝍 𝒏𝒆𝒊𝒈𝒉𝒃𝒐𝒖𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
18
Linear upwind differencing
Table 4.6: Interpolation schemes [1]
linearUpwind
Flow directions are considered.
19
Explicit correctionlinearUpwind
 “weights” are same as that of “upwind” scheme
 For “linearUpwind” scheme, corrected() returns “true”
 Calculation of explicit correction term
0139 //- Return true if this scheme uses an explicit correction
0140 virtual bool corrected() const
0141 {
0142 return true;
0143 }
linearUpwind.H
0085 forAll(faceFlux, facei)
0086 {
0087 label celli = (faceFlux[facei] > 0) ? owner[facei] : neighbour[facei];
0088 sfCorr[facei] = (Cf[facei] - C[celli]) & gradVf[celli];
0089 }
linearUpwind.C
𝒓 ∙ 𝛻𝜓 𝑢𝑝𝑠𝑡𝑟𝑒𝑎𝑚 𝑐𝑒𝑙𝑙
label of an upstream cell
• Upstream cell is judged by the
sign of the face flux field “phi”
(faceFlux means phi in the
above code)
20
Interpolated value
phi[facei] > 0 phi[facei] ≦ 0
owner neighbour owner neighbour
upstream cell
𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
+ 𝒓 ∙ 𝜵𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
linearUpwind
Center of
upstream cell
Face
center
𝒓
𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
+ 𝒓 ∙ 𝜵𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
21
Discretization of gradient
gradSchemes
{
grad(psi) Gauss linear;
}
interpolationSchemes
{
interpolate(psi) linearUpwind phi grad(psi);
}
 Specification of the discretization scheme of gradient term 𝛻𝑝
The same strings have to be specified.
“fvSchemes” file
linearUpwind
22
Linear interpolation with symmetric weighting
Table 4.6: Interpolation schemes [1]
midPoint
Flow directions are not considered.
23
Calculation of weightsmidPoint
0095 //- Return the interpolation weighting factors
0096 tmp<surfaceScalarField> weights
0097 (
0098 const GeometricField<Type, fvPatchField, volMesh>&
0099 ) const
0100 {
0101 tmp<surfaceScalarField> taw
0102 (
0103 new surfaceScalarField
0104 (
0105 IOobject
0106 (
0107 "midPointWeights",
0108 this->mesh().time().timeName(),
0109 this->mesh()
0110 ),
0111 this->mesh(),
0112 dimensionedScalar("0.5", dimless, 0.5)
0113 )
0114 );
0115
0116 surfaceScalarField::GeometricBoundaryField& awbf =
0117 taw().boundaryField();
0118
0119 forAll(awbf, patchi)
0120 {
0121 if (!awbf[patchi].coupled())
0122 {
0123 awbf[patchi] = 1.0;
0124 }
0125 }
0126
0127 return taw;
0128 }
midPoint.H
weights on the
internal faces are 0.5
24
Explicit correction
 For “midPoint” scheme, corrected() returns “false”
So, “midPoint” interpolation has no explicit correction.
 Evaluation of the interpolated value
sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= weights()[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= 0.5*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]
= 0.5*(vfi[P[fi]] + vfi[N[fi]])
= 0.5*(owner cell value + neighbour cell value)
Arithmetic mean
midPoint
0175 //- Return true if this scheme uses an explicit correction
0176 virtual bool corrected() const
0177 {
0178 return false;
0179 }
surfaceInterpolationScheme.H
25
Interpolated valuemidPoint
owner neighbour
𝟏
𝟐
𝝍 𝒐𝒘𝒏𝒆𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 + 𝝍 𝒏𝒆𝒊𝒈𝒉𝒃𝒐𝒖𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 =
Arithmetic mean
26
References
[1] User Guide http://foam.sourceforge.net/docs/Guides-a4/UserGuide.pdf
(accessed 06/15/2014)
27
Thank
You!

More Related Content

What's hot

OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
Fumiya Nozaki
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
Fumiya Nozaki
 
Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAM
Fumiya Nozaki
 
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
takuyayamamoto1800
 
Turbulence Models in OpenFOAM
Turbulence Models in OpenFOAMTurbulence Models in OpenFOAM
Turbulence Models in OpenFOAM
Fumiya Nozaki
 
OpenFOAMによる混相流シミュレーション入門
OpenFOAMによる混相流シミュレーション入門OpenFOAMによる混相流シミュレーション入門
OpenFOAMによる混相流シミュレーション入門
takuyayamamoto1800
 
OpenFOAMにおけるDEM計算の力モデルの解読
OpenFOAMにおけるDEM計算の力モデルの解読OpenFOAMにおけるDEM計算の力モデルの解読
OpenFOAMにおけるDEM計算の力モデルの解読
takuyayamamoto1800
 
CFD for Rotating Machinery using OpenFOAM
CFD for Rotating Machinery using OpenFOAMCFD for Rotating Machinery using OpenFOAM
CFD for Rotating Machinery using OpenFOAM
Fumiya Nozaki
 
OpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてOpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能について
Fumiya Nozaki
 
OpenFOAMによる気液2相流解析の基礎と設定例
OpenFOAMによる気液2相流解析の基礎と設定例OpenFOAMによる気液2相流解析の基礎と設定例
OpenFOAMによる気液2相流解析の基礎と設定例
takuyayamamoto1800
 
OpenFoamの混相流solver interFoamのパラメータによる解の変化
OpenFoamの混相流solver interFoamのパラメータによる解の変化OpenFoamの混相流solver interFoamのパラメータによる解の変化
OpenFoamの混相流solver interFoamのパラメータによる解の変化
takuyayamamoto1800
 
Mixer vessel by cfmesh
Mixer vessel by cfmeshMixer vessel by cfmesh
Mixer vessel by cfmesh
Etsuji Nomura
 
OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差
takuyayamamoto1800
 
OpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズOpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズ
mmer547
 
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
takuyayamamoto1800
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming Tips
Fumiya Nozaki
 
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
Fumiya Nozaki
 
ParaviewでのParticle Tracerを用いた可視化
ParaviewでのParticle Tracerを用いた可視化ParaviewでのParticle Tracerを用いた可視化
ParaviewでのParticle Tracerを用いた可視化
takuyayamamoto1800
 
OpenFOAMにおける混相流計算
OpenFOAMにおける混相流計算OpenFOAMにおける混相流計算
OpenFOAMにおける混相流計算
takuyayamamoto1800
 

What's hot (20)

OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
 
Dynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAMDynamic Mesh in OpenFOAM
Dynamic Mesh in OpenFOAM
 
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
 
Turbulence Models in OpenFOAM
Turbulence Models in OpenFOAMTurbulence Models in OpenFOAM
Turbulence Models in OpenFOAM
 
OpenFOAMによる混相流シミュレーション入門
OpenFOAMによる混相流シミュレーション入門OpenFOAMによる混相流シミュレーション入門
OpenFOAMによる混相流シミュレーション入門
 
OpenFOAMにおけるDEM計算の力モデルの解読
OpenFOAMにおけるDEM計算の力モデルの解読OpenFOAMにおけるDEM計算の力モデルの解読
OpenFOAMにおけるDEM計算の力モデルの解読
 
CFD for Rotating Machinery using OpenFOAM
CFD for Rotating Machinery using OpenFOAMCFD for Rotating Machinery using OpenFOAM
CFD for Rotating Machinery using OpenFOAM
 
OpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてOpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能について
 
OpenFOAMによる気液2相流解析の基礎と設定例
OpenFOAMによる気液2相流解析の基礎と設定例OpenFOAMによる気液2相流解析の基礎と設定例
OpenFOAMによる気液2相流解析の基礎と設定例
 
OpenFoamの混相流solver interFoamのパラメータによる解の変化
OpenFoamの混相流solver interFoamのパラメータによる解の変化OpenFoamの混相流solver interFoamのパラメータによる解の変化
OpenFoamの混相流solver interFoamのパラメータによる解の変化
 
Mixer vessel by cfmesh
Mixer vessel by cfmeshMixer vessel by cfmesh
Mixer vessel by cfmesh
 
OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差
 
OpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズOpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズ
 
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
OpenFOAMに実装したS-CLSVOF法検証(静止気泡のLaplace圧)
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming Tips
 
interFoamの検証
interFoamの検証interFoamの検証
interFoamの検証
 
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
OpenFOAMのチュートリアルを作ってみた#1 『くさび油膜効果の計算』
 
ParaviewでのParticle Tracerを用いた可視化
ParaviewでのParticle Tracerを用いた可視化ParaviewでのParticle Tracerを用いた可視化
ParaviewでのParticle Tracerを用いた可視化
 
OpenFOAMにおける混相流計算
OpenFOAMにおける混相流計算OpenFOAMにおける混相流計算
OpenFOAMにおける混相流計算
 

Similar to Spatial Interpolation Schemes in OpenFOAM

Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
 Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]  Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
BahaaIbrahim10
 
Mat lab vlm
Mat lab vlmMat lab vlm
Mat lab vlm
Franklin Nagao
 
A Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple ContactsA Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple Contacts
Joshua Gorinson
 
AllPosters
AllPostersAllPosters
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
Natalia
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
Natalia
 
Vlsiexpt 11 12
Vlsiexpt 11 12Vlsiexpt 11 12
Vlsiexpt 11 12
JINCY Soju
 
Bisection method
Bisection methodBisection method
Bisection method
Tirth Parmar
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman Kondakci
Süleyman Kondakci
 
White box testing
White box testingWhite box testing
White box testing
Purvi Sankhe
 
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
The Statistical and Applied Mathematical Sciences Institute
 
7 decision-control
7 decision-control7 decision-control
7 decision-control
Rohit Shrivastava
 
SLIDES_PEGASUS_CALISE
SLIDES_PEGASUS_CALISESLIDES_PEGASUS_CALISE
SLIDES_PEGASUS_CALISE
Giuseppe Calise
 
Java Performance Puzzlers
Java Performance PuzzlersJava Performance Puzzlers
Java Performance Puzzlers
Doug Hawkins
 
Cme434 project
Cme434 projectCme434 project
Cme434 project
Vijay Anand Velmurugan
 
conditional.ppt
conditional.pptconditional.ppt
conditional.ppt
DeveshDewangan5
 
Es272 ch6
Es272 ch6Es272 ch6
Exploiting vectorization with ISPC
Exploiting vectorization with ISPCExploiting vectorization with ISPC
Exploiting vectorization with ISPC
Roberto Agostino Vitillo
 
What is c
What is cWhat is c
What is c
Nitesh Saitwal
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
Manchireddy Reddy
 

Similar to Spatial Interpolation Schemes in OpenFOAM (20)

Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
 Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]  Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
Modeling and Structural Analysis of a Wing [FSI ANSYS&MATLAB]
 
Mat lab vlm
Mat lab vlmMat lab vlm
Mat lab vlm
 
A Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple ContactsA Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple Contacts
 
AllPosters
AllPostersAllPosters
AllPosters
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Vlsiexpt 11 12
Vlsiexpt 11 12Vlsiexpt 11 12
Vlsiexpt 11 12
 
Bisection method
Bisection methodBisection method
Bisection method
 
C Programming by Süleyman Kondakci
C Programming by Süleyman KondakciC Programming by Süleyman Kondakci
C Programming by Süleyman Kondakci
 
White box testing
White box testingWhite box testing
White box testing
 
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
 
7 decision-control
7 decision-control7 decision-control
7 decision-control
 
SLIDES_PEGASUS_CALISE
SLIDES_PEGASUS_CALISESLIDES_PEGASUS_CALISE
SLIDES_PEGASUS_CALISE
 
Java Performance Puzzlers
Java Performance PuzzlersJava Performance Puzzlers
Java Performance Puzzlers
 
Cme434 project
Cme434 projectCme434 project
Cme434 project
 
conditional.ppt
conditional.pptconditional.ppt
conditional.ppt
 
Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
Exploiting vectorization with ISPC
Exploiting vectorization with ISPCExploiting vectorization with ISPC
Exploiting vectorization with ISPC
 
What is c
What is cWhat is c
What is c
 
B61301007 matlab documentation
B61301007 matlab documentationB61301007 matlab documentation
B61301007 matlab documentation
 

More from Fumiya Nozaki

Basic Boundary Conditions in OpenFOAM v2.4
Basic Boundary Conditions in OpenFOAM v2.4Basic Boundary Conditions in OpenFOAM v2.4
Basic Boundary Conditions in OpenFOAM v2.4
Fumiya Nozaki
 
blockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアルblockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアル
Fumiya Nozaki
 
CAESES Free チュートリアル
CAESES Free チュートリアルCAESES Free チュートリアル
CAESES Free チュートリアル
Fumiya Nozaki
 
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
Fumiya Nozaki
 
ParaView による可視化 Tips
ParaView による可視化 TipsParaView による可視化 Tips
ParaView による可視化 Tips
Fumiya Nozaki
 
無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた
Fumiya Nozaki
 
Adjoint Shape Optimization using OpenFOAM
Adjoint Shape Optimization using OpenFOAMAdjoint Shape Optimization using OpenFOAM
Adjoint Shape Optimization using OpenFOAM
Fumiya Nozaki
 
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみたオープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
Fumiya Nozaki
 
OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1
Fumiya Nozaki
 

More from Fumiya Nozaki (9)

Basic Boundary Conditions in OpenFOAM v2.4
Basic Boundary Conditions in OpenFOAM v2.4Basic Boundary Conditions in OpenFOAM v2.4
Basic Boundary Conditions in OpenFOAM v2.4
 
blockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアルblockCoupledSwirlTestチュートリアル
blockCoupledSwirlTestチュートリアル
 
CAESES Free チュートリアル
CAESES Free チュートリアルCAESES Free チュートリアル
CAESES Free チュートリアル
 
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
CAESES-FFW,GridPro,OpenFOAMを使用した形状最適化事例#1
 
ParaView による可視化 Tips
ParaView による可視化 TipsParaView による可視化 Tips
ParaView による可視化 Tips
 
無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた無償のモデリングソフトウェアCAESESを使ってみた
無償のモデリングソフトウェアCAESESを使ってみた
 
Adjoint Shape Optimization using OpenFOAM
Adjoint Shape Optimization using OpenFOAMAdjoint Shape Optimization using OpenFOAM
Adjoint Shape Optimization using OpenFOAM
 
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみたオープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
オープンソースの CFD ソフトウェア SU2 のチュートリアルをやってみた
 
OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1OpenFOAM を用いた Adjoint 形状最適化事例1
OpenFOAM を用いた Adjoint 形状最適化事例1
 

Recently uploaded

Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
Priyanka Aash
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
BrainSell Technologies
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
sunilverma7884
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
Zilliz
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
SynapseIndia
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
BrainSell Technologies
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
Matthias Neugebauer
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes..."Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
Anant Gupta
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
Baishakhi Ray
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
Priyanka Aash
 

Recently uploaded (20)

Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
(CISOPlatform Summit & SACON 2024) Orientation by CISO Platform_ Using CISO P...
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
 
Tailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer InsightsTailored CRM Software Development for Enhanced Customer Insights
Tailored CRM Software Development for Enhanced Customer Insights
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
Opencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of MünsterOpencast Summit 2024 — Opencast @ University of Münster
Opencast Summit 2024 — Opencast @ University of Münster
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes..."Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
Semantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software DevelopmentSemantic-Aware Code Model: Elevating the Future of Software Development
Semantic-Aware Code Model: Elevating the Future of Software Development
 
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
 

Spatial Interpolation Schemes in OpenFOAM

  • 2. 2 FVM discretization 𝛻𝜓 𝑑𝑉 𝑉 = 𝑑𝑺 ∙ 𝜓 𝑆 = 𝑺 𝑓 ∙ 𝜓 𝑓 𝑓 Values at face centers  Most spatial derivative terms are first integrated over a cell volume 𝑉 and then converted to integrals over the cell surface bounding the volume using Gauss’s theorem Gauss’s theorem Spatial discretization
  • 3. 3 Interpolation from cells to faces Owner cell center Neighbour cell center Face center 𝜓 𝑃 𝜓 𝑁 𝜓 𝑓  What we need is some algebraic relational expressions 𝜓 𝑓 = 𝑓 𝜓 𝑃, 𝜓 𝑁
  • 4.  Typical interpolation schemes in OpenFOAM  upwind  linearUpwind  linear  limitedLinear etc. Many other schemes are available for use in the spatial interpolation [1]. 4 Available interpolation schemes in OpenFOAM 𝜓 𝑓 = 𝑓 𝜓 𝑃, 𝜓 𝑁
  • 5. 5 Specification of interpolation schemes gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div((nuEff*(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; }  Interpolation schemes are chosen on a term-by-term basis
  • 6. gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } 6 Specification of interpolation schemes  Interpolation schemes are chosen on a term-by-term basis 𝛻𝑝 𝑑𝑉 𝑉 = 𝑑𝑺 ∙ 𝑝 𝑆 = 𝑺 𝑓 ∙ 𝑝 𝑓 𝑓
  • 7. 7 Specification of interpolation schemes gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div((nuEff*(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; }  Interpolation schemes are chosen on a term-by-term basis 𝛻 ∙ 𝜈 𝛻𝒖 𝑇 𝑑𝑉 𝑉 = 𝑑𝑺 ∙ 𝜈 𝛻𝒖 𝑇 𝑆 = 𝑺 𝑓 ∙ 𝜈 𝛻𝒖 𝑇 𝑓 𝑓 𝛻 ∙ 𝑼𝑼 𝑑𝑉 𝑉 = 𝑑𝑺 ∙ 𝑼𝑼 𝑆 = 𝑺 𝑓 ∙ 𝑼 𝑓 𝑼 𝑓 𝑓 = 𝐹𝑼 𝑓 𝑓
  • 8. 8 Specification of interpolation schemes gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; }  Interpolation schemes are chosen on a term-by-term basis 𝛻 ∙ Γ𝛻𝜙 𝑑𝑉 𝑉 = 𝑑𝑺 ∙ Γ𝛻𝜙 𝑆 = Γ𝑓 𝑺 𝑓 ∙ 𝛻𝜙 𝑓 𝑓
  • 10. 10 surfaceInterpolationScheme.C 0322 //- Return the face-interpolate of the given cell field 0323 // with explicit correction 0324 template<class Type> 0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > 0326 surfaceInterpolationScheme<Type>::interpolate 0327 ( 0328 const GeometricField<Type, fvPatchField, volMesh>& vf 0329 ) const 0330 { 0331 if (surfaceInterpolation::debug) 0332 { 0333 Info<< "surfaceInterpolationScheme<Type>::interpolate" 0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : " 0335 "interpolating " 0336 << vf.type() << " " 0337 << vf.name() 0338 << " from cells to faces" 0339 << endl; 0340 } 0341 0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf 0343 = interpolate(vf, weights(vf)); 0344 0345 if (corrected()) 0346 { 0347 tsf() += correction(vf); 0348 } 0349 0350 return tsf; 0351 } surfaceInterpolationScheme.C Without explicit correction Addition of explicit correction
  • 11. 11 surfaceInterpolationScheme.C 0322 //- Return the face-interpolate of the given cell field 0323 // with explicit correction 0324 template<class Type> 0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > 0326 surfaceInterpolationScheme<Type>::interpolate 0327 ( 0328 const GeometricField<Type, fvPatchField, volMesh>& vf 0329 ) const 0330 { 0331 if (surfaceInterpolation::debug) 0332 { 0333 Info<< "surfaceInterpolationScheme<Type>::interpolate" 0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : " 0335 "interpolating " 0336 << vf.type() << " " 0337 << vf.name() 0338 << " from cells to faces" 0339 << endl; 0340 } 0341 0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf 0343 = interpolate(vf, weights(vf)); 0344 0345 if (corrected()) 0346 { 0347 tsf() += correction(vf); 0348 } 0349 0350 return tsf; 0351 } surfaceInterpolationScheme.C “weights()” are different depending on the interpolation scheme.
  • 12. 12 surfaceInterpolationScheme.C 0322 //- Return the face-interpolate of the given cell field 0323 // with explicit correction 0324 template<class Type> 0325 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > 0326 surfaceInterpolationScheme<Type>::interpolate 0327 ( 0328 const GeometricField<Type, fvPatchField, volMesh>& vf 0329 ) const 0330 { 0331 if (surfaceInterpolation::debug) 0332 { 0333 Info<< "surfaceInterpolationScheme<Type>::interpolate" 0334 "(const GeometricField<Type, fvPatchField, volMesh>&) : " 0335 "interpolating " 0336 << vf.type() << " " 0337 << vf.name() 0338 << " from cells to faces" 0339 << endl; 0340 } 0341 0342 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf 0343 = interpolate(vf, weights(vf)); 0344 0345 if (corrected()) 0346 { 0347 tsf() += correction(vf); 0348 } 0349 0350 return tsf; 0351 } surfaceInterpolationScheme.C “interpolate()” calculates interpolated face value without explicit correction. Turn to the next page.
  • 13. 13 surfaceInterpolationScheme.C 0266 const surfaceScalarField& lambdas = tlambdas(); 0267 0268 const Field<Type>& vfi = vf.internalField(); 0269 const scalarField& lambda = lambdas.internalField(); 0270 0271 const fvMesh& mesh = vf.mesh(); 0272 const labelUList& P = mesh.owner(); 0273 const labelUList& N = mesh.neighbour(); 0274 0275 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf 0276 ( 0277 new GeometricField<Type, fvsPatchField, surfaceMesh> 0278 ( 0279 IOobject 0280 ( 0281 "interpolate("+vf.name()+')', 0282 vf.instance(), 0283 vf.db() 0284 ), 0285 mesh, 0286 vf.dimensions() 0287 ) 0288 ); 0289 GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf(); 0290 0291 Field<Type>& sfi = sf.internalField(); 0292 0293 for (register label fi=0; fi<P.size(); fi++) 0294 { 0295 sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]]; 0296 } surfaceInterpolationScheme.C sfi[fi] represents the interpolated value at the fi-th face center.
  • 14. 14 First look into “upwind” scheme Table 4.6: Interpolation schemes [1] upwind Flow directions are considered.
  • 15. 15 Calculation of weights 0128 //- Return the interpolation weighting factors 0129 tmp<surfaceScalarField> weights() const 0130 { 0131 return pos(this->faceFlux_); 0132 } 0133 0134 //- Return the interpolation weighting factors 0135 virtual tmp<surfaceScalarField> weights 0136 ( 0137 const GeometricField<Type, fvPatchField, volMesh>& 0138 ) const 0139 { 0140 return weights(); 0141 } upwind.H  l. 0131 𝑤𝑒𝑖𝑔ℎ𝑡𝑠() facei = 1 0 if 𝑓𝑎𝑐𝑒𝐹𝑙𝑢𝑥 facei > 0 if 𝑓𝑎𝑐𝑒𝐹𝑙𝑢𝑥 facei ≤ 0 upwind
  • 16. 16 Explicit correction 0175 //- Return true if this scheme uses an explicit correction 0176 virtual bool corrected() const 0177 { 0178 return false; 0179 } surfaceInterpolationScheme.H  For “upwind” scheme, corrected() returns “false” So, “upwind” interpolation has no explicit correction.  Evaluation of the interpolated value • If phi[facei] > 0 sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = weights()[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = 1*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = vfi[P[fi]] = owner cell value • If phi[facei] ≦ 0 sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = 0*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = vfi[N[fi]] = neighbour cell value upwind
  • 17. 17 Interpolated valueupwind phi[facei] > 0 phi[facei] ≦ 0 owner neighbour owner neighbour owner is the upstream cell neighbour is the upstream cell 𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒐𝒘𝒏𝒆𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒏𝒆𝒊𝒈𝒉𝒃𝒐𝒖𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢
  • 18. 18 Linear upwind differencing Table 4.6: Interpolation schemes [1] linearUpwind Flow directions are considered.
  • 19. 19 Explicit correctionlinearUpwind  “weights” are same as that of “upwind” scheme  For “linearUpwind” scheme, corrected() returns “true”  Calculation of explicit correction term 0139 //- Return true if this scheme uses an explicit correction 0140 virtual bool corrected() const 0141 { 0142 return true; 0143 } linearUpwind.H 0085 forAll(faceFlux, facei) 0086 { 0087 label celli = (faceFlux[facei] > 0) ? owner[facei] : neighbour[facei]; 0088 sfCorr[facei] = (Cf[facei] - C[celli]) & gradVf[celli]; 0089 } linearUpwind.C 𝒓 ∙ 𝛻𝜓 𝑢𝑝𝑠𝑡𝑟𝑒𝑎𝑚 𝑐𝑒𝑙𝑙 label of an upstream cell • Upstream cell is judged by the sign of the face flux field “phi” (faceFlux means phi in the above code)
  • 20. 20 Interpolated value phi[facei] > 0 phi[facei] ≦ 0 owner neighbour owner neighbour upstream cell 𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 + 𝒓 ∙ 𝜵𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 linearUpwind Center of upstream cell Face center 𝒓
  • 21. 𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = 𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 + 𝒓 ∙ 𝜵𝝍 𝒖𝒑𝒔𝒕𝒓𝒆𝒂𝒎 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 21 Discretization of gradient gradSchemes { grad(psi) Gauss linear; } interpolationSchemes { interpolate(psi) linearUpwind phi grad(psi); }  Specification of the discretization scheme of gradient term 𝛻𝑝 The same strings have to be specified. “fvSchemes” file linearUpwind
  • 22. 22 Linear interpolation with symmetric weighting Table 4.6: Interpolation schemes [1] midPoint Flow directions are not considered.
  • 23. 23 Calculation of weightsmidPoint 0095 //- Return the interpolation weighting factors 0096 tmp<surfaceScalarField> weights 0097 ( 0098 const GeometricField<Type, fvPatchField, volMesh>& 0099 ) const 0100 { 0101 tmp<surfaceScalarField> taw 0102 ( 0103 new surfaceScalarField 0104 ( 0105 IOobject 0106 ( 0107 "midPointWeights", 0108 this->mesh().time().timeName(), 0109 this->mesh() 0110 ), 0111 this->mesh(), 0112 dimensionedScalar("0.5", dimless, 0.5) 0113 ) 0114 ); 0115 0116 surfaceScalarField::GeometricBoundaryField& awbf = 0117 taw().boundaryField(); 0118 0119 forAll(awbf, patchi) 0120 { 0121 if (!awbf[patchi].coupled()) 0122 { 0123 awbf[patchi] = 1.0; 0124 } 0125 } 0126 0127 return taw; 0128 } midPoint.H weights on the internal faces are 0.5
  • 24. 24 Explicit correction  For “midPoint” scheme, corrected() returns “false” So, “midPoint” interpolation has no explicit correction.  Evaluation of the interpolated value sfi[fi] = lambda[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = weights()[fi]*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = 0.5*(vfi[P[fi]] - vfi[N[fi]]) + vfi[N[fi]] = 0.5*(vfi[P[fi]] + vfi[N[fi]]) = 0.5*(owner cell value + neighbour cell value) Arithmetic mean midPoint 0175 //- Return true if this scheme uses an explicit correction 0176 virtual bool corrected() const 0177 { 0178 return false; 0179 } surfaceInterpolationScheme.H
  • 25. 25 Interpolated valuemidPoint owner neighbour 𝟏 𝟐 𝝍 𝒐𝒘𝒏𝒆𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 + 𝝍 𝒏𝒆𝒊𝒈𝒉𝒃𝒐𝒖𝒓 𝒄𝒆𝒍𝒍 𝒐𝒇 𝐟𝐚𝐜𝐞𝐢 𝝍 𝒇 𝐟𝐚𝐜𝐞𝐢 = Arithmetic mean
  • 26. 26 References [1] User Guide http://foam.sourceforge.net/docs/Guides-a4/UserGuide.pdf (accessed 06/15/2014)