使用有限体积法时应如何应用边界条件?


16

上一个问题开始,我试图将边界条件应用于该非均匀有限体积网格,

左侧边界包括幽灵单元。

我想将Robin类型的边界条件应用于域的lhs(,这样,x=xL)

σL=(dux+au)|x=xL

其中是边界值; a d是分别在边界,对流和扩散上定义的系数;Ù X = ùσLa,d,是的衍生物ü在边界评价和ü为我们所求解的变量。ux=uxuu

可能的方法

我可以想到两种在上述有限体积网格上实现此边界条件的方法:

  1. 鬼细胞方法。

    写为包括虚像元的有限差。σ 大号 = ð Ü 1 - ü 0ux

    σL=du1u0h+au(xL)

    A.然后对点x 0x 1使用线性插值法求中间值u x Lx0x1u(xL)

    B.或者,通过对单元进行平均来找到u x L= 1u(xL)u(xL)=12(u0+u1)

    无论哪种情况,都可以用通常的方式(通过代入有限体积方程式)消除对虚影单元的依赖。

  2. 外推法。

    适合的直链(或二次)函数来通过在使用点的值X 1X 2X 3)。这将提供u x L处的值。然后可以对线性(或二次)函数进行微分,以找到边界处导数u xx L的值的表达式。这种方法并没有采用影细胞。u(x)x1,x2x3u(xL)ux(xL)

问题

  • 三种方法(1A,1B或2)中的哪一种是“标准”的,或者您会建议使用?
  • 哪种方法带来的误差最小或最稳定?
  • 我想我可以自己实现鬼单元法,但是,如何实现外推法,这种方法有名称吗?
  • 拟合线性函数或二次方程之间是否存在稳定性差异?

具体方程式

我希望将此边界应用于带有非线性源项的对流扩散方程(以守恒形式),

ut=aux+duxx+s(x,u,t)

使用方法在上述网格上将该方程离散化,θ

wjn+1θrawj1n+1θrbwjn+1θrcwj+1n+1=wjn+(1θ)rawj1n+(1θ)rbwjn+(1θ)rcwj+1n+s(xj,tn)

但是对于边界点(),我更喜欢使用完全隐式方案(θj=1)来降低复杂度,θ=1

w1n+1raw0n+1rbw1n+1rcw2n+1=w1n+s1n

注意重影点,将通过应用边界条件将其删除。w0n+1

系数有定义,

ra=Δthj(ahj2h+dh)

rb=Δthj(a2[hj1hhj+1h+]+d[1h1h+])

rc=Δthj(ahj2h++dh+)

All the "h" variables are defined as in the above diagram. Finally, Δt which is the time step (N.B. this is a simplified case with constant a and d coefficients, in practice the "r" coefficients are slightly more complicated for this reason).


1
LeVeque's more recent book on finite volume methods advocates ghost cells, due to their simplicity of implementation, but I don't recall the discussion of error terms.
Geoff Oxberry

Can you put down the equations you want to solve? The way to go will also depend on the problem. E.g., it may well be that because of the 'Neumann' part, the boundary conditions are like naturally resolved in the discrete formulation.
Jan

@GeoffOxberry thanks for the suggestion. I am happy using ghost cell, I will try and implement in that way.
boyfarrell

@Jan I initially avoided putting the equations down because of the complexity due to the non-uniform mesh discretisation, but I just updated the question with these details. This is an advection-diffusion problem. I'm not too sure what you mean by "naturally resolved".
boyfarrell

Like Neumann bc's are naturally resolved in FEM schemes for, e.g.,Poisson's eqn. For FVM I think of: Consider the first cell 0hdx(au+dux)dx=(au+dux)|x=h1(au+dux)|x=0=s . If you have a value for ux on the boundary, there is no need to discretize it.
Jan

Answers:


9

This is rather a general remark on FVM than an answer to the concrete questions. And the message is that there shouldn't be the need for such an adhoc discretization of the boundary conditions.

Unlike in FE- or FD-methods, where the starting point is a discrete ansatz for the solution, the FVM approach leaves the solution untouched (at first) but averages on a segmentation of the domain. The discretization of the solution comes into play only when the obtained system of balance equations is turned into an algebraic equation system by approximating the fluxes across the interfaces.

In this sense, in view of the boundary conditions, I advise to stick to the continuous form of the solution as long as possible and to introduce the discrete approximations only at the very end.

Say, the equation

ut=aux+duxx+s(x,u,t)
holds on the entire domain. Then it holds on the subdomain [0,h1), and an integration in space gives
0h1utdx=0h1x(au+dux)dx+0h1s(x,u,t)dx=(au+dux)|x=h1(au+dux)|x=0+0h1s(x,u,t)dx,
which is the contribution of the first cell to the equation system. Note that, apart from taking only averages, there has been no discretization of u.

But now, to turn this into an algebraic equation, one typically assumes that on cell Ci the function u is constant in space, i.e. u(t,x)|Ci=ui(t). Thus, having associated u(xi)ui, one can express ux|hi at the cell boarders via the difference quotient in ui and ui+1. To express u at the cell boarders one can use interpolation (i.e. central differences or upwind schemes).

What to do at the boundary? In the example, it is all about approximating (au+dux)|x=0, no matter what has been done to u so far.

  • Given u|x=0=gD one can introduce a ghost cell and the condition that an interpolant between u0 and u1 is equal to gD at the boarder.

  • Given ux|x=0=gN one can introduce a ghost cell and the condition that an approximation to the derivative between u0 and u1 matches gN at the boarder

  • If the flux itself is prescribed: (au+dux)|x=0=gR, there is no need for a discretization.

However, I am not sure, what to do in the case that there are Robin type bc's that do not match the flux directly. This, will need some regularization because of the discontinuity of the advection and diffusion parameters.


===> Some personal thoughts on FVM <===

  • FVM is not a scaled FDM, as examples of 1D Poisson's equations on a regular grid often suggest
  • There shouldn't be a grid in FVM, there should be cells with interfaces and, if necessary, centers
  • That's why I think that a stencil formulation of the discretization is not suitable
  • Assembling of the equation system should be done according to the discretization approach, i.e. by iterating over the cells rather than defining an equation for every unknown. I mean to think of the i-th row of the coefficient matrix as the part of the problem posed on cell Ωi, rather than of the equation that is associated with ui.
  • This is particularly important for 2D or 3D problems but may also help to have a clear notation in 1D: Make a difference between the volume (in 1D: length) of the cell, here hi, and the distance between the centers, maybe in 1D: di:=di,i+1=|xixi+1|.


Thanks for your guidance while I was learning about this method. Maybe I can share my thoughts too. I agree it is best to say with the FVM form for as long as possible; particularly for the boundary conditions as you have shown! But I think it is very helpful when implementing to write the equation in matrix form; it is a precise and clear notation. Also, the stability and other numerical properties crucially depend on how the problem is discretised (for FVM this means how the fluxes an the cell faces are approximated). In that respect I prefer a matrix equations, to iteration over cells.
boyfarrell

Maybe my last point was ambiguous. In the end, you will have a coefficient matrix and a variable vector. I will edit my post. I was more about interpreting than actually doing.
Jan

Fantastic, I understand your point. Thanks.
boyfarrell
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.