Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVD限制器 #7

Open
YinLiu-91 opened this issue Nov 19, 2023 · 1 comment
Open

TVD限制器 #7

YinLiu-91 opened this issue Nov 19, 2023 · 1 comment

Comments

@YinLiu-91
Copy link
Owner

YinLiu-91 commented Nov 19, 2023

  1. 参考链接 https://zhuanlan.zhihu.com/p/612189005
  2. 链接中的如下值,是根据 uh的含义和如何计算单元3个点处的结果 #6 中介绍的公式计算的:
    • $u_l=c_0-c_1+\frac{2}{3}\cdot c_2$

    • $u_m=c_0-\frac{1}{3}c_2$

    • $u_r=c_0+c_1+\frac{2}{3}\cdot c_2$
      image

    • 从chiwang shu 的天元课程讲义中有(注意,均值是对 $uh=c_0+c_1x+c_2(x^2-1/3)$ 在-1,1上积分平均的结果,不是三个点的值简单相加再相除),经过积分后, $\bar{u}_i=c_0$
      image

    • 那么: $u_{i+1/2}-\bar{u}_i=c_0+c_1+\frac{2}{3}\cdot c_2-(c_0)=c_1+2/3c_2$

    • 且: $\bar{u}_{i}-u=c_1-2/3c_2$ 截图中第二项好像不太对?

    • 因此利用下图公式可以得到 $c_1=\frac{minmod_1+minmod_2}{2}, c_2=\frac{3}{4}(minmod_1-minmod_2)$,即如下代码中的uhmod(i,2),uhmod(i,3)

    for i = 1:Nx  % 循环所有单元                                      
    deltaUR = uh(i,2) + (2/3)*uh(i,3);              % 单元右端值减去平均值
    deltaUL = uh(i,2) - (2/3)*uh(i,3);              % 单元平均值减去单元左端值?这里对?
    deltaURM = uhb(i + 2,1) - uhb(i + 1,1);         % 右单元平均值减去本单元平均值
    deltaULM = uhb(i + 1,1) - uhb(i,1);             % 本单元平均值减去左单元平均值
    
    deltaURM1 = minmod(deltaUR,deltaURM,deltaULM);
    deltaULM1 = minmod(deltaUL,deltaURM,deltaULM);
    
    uhmod(i,2) = (deltaURM1 + deltaULM1)/2;
    uhmod(i,3) = 3*(deltaURM1 - deltaULM1)/4;
    end
  3. 利用minmod函数求new定义如下(minmod对于输入同号时才有非零值,不同号为0),这时,能根据minmod定义求出下面方程右端项结果:
    image
  4. 将上图左端项与系数的关系求得如下:
    image
    • 上图右端由minmod函数给出,那么此为2个未知量,2个方程,可以求出新的 $c_1,c_2$的结果,
@YinLiu-91 YinLiu-91 changed the title TVD格式 TVD限制器 Nov 19, 2023
@YinLiu-91
Copy link
Owner Author

总结TVD添加时新的系数计算方法

  1. 求出minmod作为方程组的右端项
  2. 求出含有系数的计算公式
  3. 组成方程组,联立求解

YinLiu-91 added a commit that referenced this issue Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant