【CFD理论】梯度项-01

  • fvSchemes
    • Gauss gradient scheme
      • Interpolation schemes
    • Least-squares gradient scheme
    • 理论
      • 正交 computing gradient in cartesian grids
      • 非正交 green-gauss gradient
        • 1 face-based graient computation
        • example1
        • 2.vertex-based gradient computation
    • 补充学习

Gradient schemes
∇ϕ=e1∂∂x1ϕ+e2∂∂x2ϕ+e3∂∂x3ϕ\nabla \phi=\boldsymbol e_1\frac{\partial}{\partial x_1}\phi+\boldsymbol e_2\frac{\partial}{\partial x_2}\phi+\boldsymbol e_3\frac{\partial}{\partial x_3}\phi∇ϕ=e1​∂x1​∂​ϕ+e2​∂x2​∂​ϕ+e3​∂x3​∂​ϕ

fvSchemes

gradSchemes
{default none;grad(p) <optional limiter> <gradient scheme> <interpolation scheme>;
}

Gauss gradient scheme

gradSchemes
{default         none;grad(U)         Gauss <interpolation scheme>;
}

Interpolation schemes

  1. linear: cell-based linear
  2. pointLinear: point-based linear
  3. leastSquares: Least squares

Least-squares gradient scheme

gradSchemes
{default         none;grad(U)         leastSquares;
}

理论

正交 computing gradient in cartesian grids


(∂ϕ∂x)C=ϕE−ϕWXE−XW=ϕN−ϕSXN−XS(\frac{\partial \phi}{\partial x})_C=\frac{\phi_E-\phi_W}{X_E-X_W}=\frac{\phi_N-\phi_S}{X_N-X_S} (∂x∂ϕ​)C​=XE​−XW​ϕE​−ϕW​​=XN​−XS​ϕN​−ϕS​​

非正交 green-gauss gradient



两种计算方法ϕf\phi_fϕf​

  • face-based
  • vertex-based

体心处梯度:
散度定理⇒\Rightarrow⇒
(∇ϕ)C=1VC∑fϕf⋅Sf(\nabla \phi)_C=\frac{1}{V_C}\sum_f \phi_f\cdot \boldsymbol S_f(∇ϕ)C​=VC​1​∑f​ϕf​⋅Sf​
ϕf?\phi_f?ϕf​?

fig. 9.3a,no skewness,f=f′f=f'f=f′
ϕf=γϕC+(1−γ)ϕF\phi_f=\gamma\phi_C+(1-\gamma)\phi_Fϕf​=γϕC​+(1−γ)ϕF​
γ=∣∣rF−rf∣∣∣∣rF−rC∣∣=dFfdFC\gamma =\frac{\left||\boldsymbol r_F-r_f\right||}{\left||\boldsymbol r_F-r_C\right||}=\frac{d_{Ff}}{d_{FC}}γ=∣∣rF​−rC​∣∣∣∣rF​−rf​∣∣​=dFC​dFf​​
二阶精度:γ=0.5,ϕf=ϕP+ϕN2\gamma=0.5,\phi_f=\frac{\phi_P+\phi_N}{2}γ=0.5,ϕf​=2ϕP​+ϕN​​

fig. 9.3c,skewness,f≠f′f\neq f'f=f′
泰勒公式:
f(x)=f(x0)+f′(x0)(x−x0)+f′′(x−x0)2+...f(x)=f(x_0)+f'(x_0)(x-x_0)+f''(x-x_0)^2+...f(x)=f(x0​)+f′(x0​)(x−x0​)+f′′(x−x0​)2+...
ϕf=ϕf′+correction=ϕf′+(∇ϕ)f′(rf−rf′)≈f(x0)+f′(x0)(x−x0)\begin{aligned} \phi_f&=\phi_{f'}+correction\\ &=\phi_{f'}+(\nabla \phi)_{f'}(\boldsymbol r_f-\boldsymbol r_{f'})\\ &\approx f(x_0)+f'(x_0)(x-x_0)\\ \end{aligned} ϕf​​=ϕf′​+correction=ϕf′​+(∇ϕ)f′​(rf​−rf′​)≈f(x0​)+f′(x0​)(x−x0​)​

  • 基于体心的需要修正,基于节点的不需要修正,因为需要求ϕf\phi_fϕf​
  • 用Gauss求体心的梯度,就要知道面心值,而面心值要修正就要知道体心的梯度

1 face-based graient computation

1.计算ϕf′=γϕP+(1−γ)ϕN2.计算(∇ϕ)P=1VP∑fϕf′⋅Sf3.计算更新的ϕf=ϕf′+γ(∇ϕ)P⋅(rf−rP)+(1−γ)(∇ϕ)N⋅(rf−rN)4.更新(∇ϕ)P=1VP∑fϕf⋅Sf5.重复3\begin{aligned} &1.计算 \phi_{f'}=\gamma\phi_P+(1-\gamma)\phi_N\\ & 2.计算(\nabla \phi)_P=\frac{1}{V_P}\sum_f\phi_{f'}\cdot\boldsymbol S_f\\ & 3.计算更新的\phi_f=\phi_{f'}+\gamma(\nabla \phi)_P\cdot(\boldsymbol r_f-\boldsymbol r_P)+(1-\gamma)(\nabla\phi)_N \cdot (\boldsymbol r_f - \boldsymbol r_N)\\ & 4.更新(\nabla \phi)_P=\frac{1}{V_P}\sum_f\phi_f\cdot\boldsymbol S_f\\ & 5.重复3 \end{aligned} ​1.计算ϕf′​=γϕP​+(1−γ)ϕN​2.计算(∇ϕ)P​=VP​1​f∑​ϕf′​⋅Sf​3.计算更新的ϕf​=ϕf′​+γ(∇ϕ)P​⋅(rf​−rP​)+(1−γ)(∇ϕ)N​⋅(rf​−rN​)4.更新(∇ϕ)P​=VP​1​f∑​ϕf​⋅Sf​5.重复3​

example1


a.Green-Gauss method with no correction

(∇ϕ)C=1VC∑fϕf⋅Sf(\nabla \phi)_C=\frac{1}{V_C}\sum_f \phi_f\cdot \boldsymbol S_f(∇ϕ)C​=VC​1​∑f​ϕf​⋅Sf​

face centrolids:
f1(8.5,11),f2(10,6.5),f3(14.5,7),f4(17.25,11.5),f5(14.75.15.5),f6(10.5,15.5)f_1(8.5,11),f_2(10,6.5),f_3(14.5,7),f_4(17.25,11.5),f_5(14.75.15.5),f_6(10.5,15.5)f1​(8.5,11),f2​(10,6.5),f3​(14.5,7),f4​(17.25,11.5),f5​(14.75.15.5),f6​(10.5,15.5)

surface vectors:
Sf1=−6i+jS_{f1}=-6\boldsymbol i+\boldsymbol jSf1​=−6i+j
Sf2=−3i−4jS_{f2}=-3\boldsymbol i-4\boldsymbol jSf2​=−3i−4j
Sf3=4i−5jS_{f3}=4\boldsymbol i-5\boldsymbol jSf3​=4i−5j
Sf4=5i−0.5jS_{f4}=5\boldsymbol i-0.5\boldsymbol jSf4​=5i−0.5j
Sf5=3i+5.5jS_{f5}=3\boldsymbol i+5.5\boldsymbol jSf5​=3i+5.5j
Sf6=−3i+3jS_{f6}=-3\boldsymbol i+3\boldsymbol jSf6​=−3i+3j

interpolation factor (gc)n(gc)_n(gc)n​:
(gc)1=0.487(gc)_1=0.487(gc)1​=0.487
(gc)2=0.427(gc)_2=0.427(gc)2​=0.427
(gc)3=0.502(gc)_3=0.502(gc)3​=0.502
(gc)1=0.538(gc)_1=0.538(gc)1​=0.538
(gc)1=0.492(gc)_1=0.492(gc)1​=0.492
(gc)1=0.455(gc)_1=0.455(gc)1​=0.455

ϕf\phi_fϕf​ value:
ϕf1=(gc)1ϕC+(1−(gc)1)ϕF=110.442\phi_{f1}=(gc)_1\phi_C+(1-(gc)_1)\phi_F=110.442ϕf1​=(gc)1​ϕC​+(1−(gc)1​)ϕF​=110.442
ϕf2=91.364\phi_{f2}=91.364ϕf2​=91.364
ϕf3=123.674\phi_{f3}=123.674ϕf3​=123.674
ϕf4=206.27\phi_{f4}=206.27ϕf4​=206.27
ϕf5=263.012\phi_{f5}=263.012ϕf5​=263.012
ϕf5=158.28\phi_{f5}=158.28ϕf5​=158.28

(∇ϕ)C=1VC∑fϕf⋅Sf=11.889i+12.433j(\nabla \phi)_C=\frac{1}{V_C}\sum_f \phi_f\cdot \boldsymbol S_f=11.889\boldsymbol i+12.433\boldsymbol j(∇ϕ)C​=VC​1​∑f​ϕf​⋅Sf​=11.889i+12.433j

b.Green-Gauss method with correction

  1. ϕf′\phi_{f'}ϕf′​ value:
    ϕf1′=ϕC+ϕF12=111.875\phi_{f1'}=\frac{\phi_C+\phi_{F1}}{2}=111.875ϕf1′​=2ϕC​+ϕF1​​=111.875
    ϕf2′=101\phi_{f2'}=101ϕf2′​=101
    ϕf3′=123.5\phi_{f3'}=123.5ϕf3′​=123.5
    ϕf4′=209.5\phi_{f4'}=209.5ϕf4′​=209.5
    ϕf5′=261.5\phi_{f5'}=261.5ϕf5′​=261.5
    ϕf6′=158.5\phi_{f6'}=158.5ϕf6′​=158.5

  2. (∇ϕ)C=1VC∑fϕf′⋅Sf=11.53i+11.826j(\nabla \phi)_C=\frac{1}{V_C}\sum_{f} \phi_{f'}\cdot \boldsymbol S_f=11.53\boldsymbol i+11.826\boldsymbol j(∇ϕ)C​=VC​1​∑f​ϕf′​⋅Sf​=11.53i+11.826j

  3. ϕf\phi_{f}ϕf​ value:
    ϕf1=ϕf1′+0.5∗[(∇ϕ)C+(∇ϕ)F1]⋅[rf−0.5∗(rC+rF)]=111.875+3.7435=115.6185\phi_{f1}=\phi_{f1'}+0.5*[(\nabla\phi)_C+(\nabla \phi)_{F1}]\cdot[\boldsymbol r_f-0.5*(\boldsymbol r_C+\boldsymbol r_F)]=111.875+3.7435=115.6185ϕf1​=ϕf1′​+0.5∗[(∇ϕ)C​+(∇ϕ)F1​]⋅[rf​−0.5∗(rC​+rF​)]=111.875+3.7435=115.6185
    ϕf2=91.911\phi_{f2}=91.911ϕf2​=91.911
    ϕf3=115.764\phi_{f3}=115.764ϕf3​=115.764
    ϕf4=224.097\phi_{f4}=224.097ϕf4​=224.097
    ϕf5=265.566\phi_{f5}=265.566ϕf5​=265.566
    ϕf6=176.046\phi_{f6}=176.046ϕf6​=176.046

  4. (∇ϕ)C=1VC∑fϕf⋅Sf=11.614i+13.76j(\nabla \phi)_C=\frac{1}{V_C}\sum_{f} \phi_{f}\cdot \boldsymbol S_f=11.614\boldsymbol i+13.76\boldsymbol j(∇ϕ)C​=VC​1​∑f​ϕf​⋅Sf​=11.614i+13.76j

2.vertex-based gradient computation


ϕn=∑k=1NB(n)ϕFk∣∣rn−rFk∣∣∑k=1NB(n)1∣∣rn−rFk∣∣\phi_n=\frac{\sum_{k=1}^{NB(n)}\frac{\phi_{F_k}}{\left||\boldsymbol r_n-\boldsymbol r_{F_k}\right||}}{\sum_{k=1}^{NB(n)}\frac{1}{\left||\boldsymbol r_n-\boldsymbol r_{F_k}\right||}}ϕn​=∑k=1NB(n)​∣∣rn​−rFk​​∣∣1​∑k=1NB(n)​∣∣rn​−rFk​​∣∣ϕFk​​​​
ϕf=ϕn1+ϕn22\phi_f=\frac{\phi_{n1}+\phi_{n2}}{2}ϕf​=2ϕn1​+ϕn2​​

补充学习

fluid mechanics 101 26-28

  1. GreenGaussGradient
  2. LeastSquaresGradient
  3. NodeBasedGradient

【CFD理论】梯度项-01相关推荐

  1. 【CFD理论】扩散项-01

    [CFD理论]扩散项-01 分别描述扩散项和对流项 基本边界条件 Dirichlet Neumann Robin symmetry interface diffusivity example 分别描述 ...

  2. 【CFD理论】对流项-06高分格式

    [CFD理论]对流项-06高分格式 high resolution schemes the normalized variable formulation (NVF) 分情况讨论ϕC~\tilde{\ ...

  3. 【CFD理论】对流项-02

    [CFD理论]对流项-02 知识回顾 边界问题 properties of discretisation schemes conservation 守恒性 Boundedness 有界性 exampl ...

  4. 【CFD理论】对流项-04-TVD

    [CFD理论]对流项-04 total variation and TVD schemes criteria for TVD schemes flux limiter functions 通量限制器 ...

  5. 可使用计算机打印的方式替代,邮政投递员高级理论知识试卷01

    邮政投递员高级理论知识试卷 单位: 姓名: 得分: 一.填空题(第1题-第20题,每题1分,满分20分.) 1. 营业日戳只限于营业部门在收寄和________________邮件时使用. 2. 国内 ...

  6. DNS域名解析(理论+正项解析)

    目录 前言 一.BIND域名服务基础 1.DNS系统的作用及类型 2.DNS系统的分布式数据结构 3.DNS使用的协议及端口号 4.正向解析查询过程 5.两种查询方式 6.DNS服务器类型: 二.BI ...

  7. FVM in CFD 学习笔记_第9章_梯度计算

    学习自F. Moukalled, L. Mangani, M. Darwish所著The Finite Volume Method in Computational Fluid Dynamics - ...

  8. FVM in CFD 学习笔记_第11章_对流项离散

    学习自F. Moukalled, L. Mangani, M. Darwish所著The Finite Volume Method in Computational Fluid Dynamics - ...

  9. 02.改善深层神经网络:超参数调试、正则化以及优化 W1.深度学习的实践层面(作业:初始化+正则化+梯度检验)

    文章目录 作业1:初始化 1. 神经网络模型 2. 使用 0 初始化 3. 随机初始化 4. He 初始化 作业2:正则化 1. 无正则化模型 2. L2 正则化 3. DropOut 正则化 3.1 ...

最新文章

  1. 一起谈.NET技术,C#中int和System.Int32理解总结
  2. plantuml 依赖_使用PlantUML绘制类图
  3. (建议收藏)万字长文,帮你一招搞定产品经理面试-详解产品经理面试大全
  4. CCR源码分析-CCR架构
  5. WORD如何定义新项目符号?
  6. python替换缺失值,处理空值+生成图形+图形标准化
  7. linux上的一些命令
  8. SQLite: 关于日期的标准化问题
  9. codeforcesRound#275 Div2 前三题
  10. 十大免费响应式Joomla主题
  11. 太阳能最佳倾角c语言编程,用C语言编程计算太阳的高度角,用于控制太阳能电板最佳的倾角...
  12. JavaWeb中外部引入的js中涉及到location.href的页面跳转/jsp页面的外部js文件引入
  13. Usb rndis,mtp等function添加,config配置
  14. 速卖通电脑办公行业什么产品好卖?解读2022速卖通重点招商品类及营销策略
  15. html实现鼠标跟随,html5实现鼠标跟随
  16. 水平垂直居中的几种方式
  17. 运动场球具的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  18. 图的深度优先算法和广度优先算法
  19. java时间,日期,毫秒值,String的相互转换总结
  20. ADI Blackfin DSP处理器-BF533的开发详解55:CVBS输入-DSP和ADV7180的应用详解(含源码)

热门文章

  1. IDEA中快速添加自己自定义的方法方法,想要什么快捷方法都行
  2. C语言练习 | 实现四则运算和单位换算的简易计算器
  3. http://yuanma.wxb0.com/ 唯品源码网站
  4. STM32 链接文件使用
  5. reduce()函数
  6. JAVA查询近12个月的数据并进行统计
  7. Android之无限轮播图源代码
  8. C++调用Armadillo计算库
  9. CStaticText 静态文本
  10. 分享一个在线占位图制作工具