[petsc-users] want some explanations on BC setup

Li, Zhisong (lizs) lizs at mail.uc.edu
Fri Apr 23 11:01:21 CDT 2010

```Hi, Jed,

Thank you so much for these words. Actually I am working towards a 3D incompressible flow solver with finite volume method. So a driven cavity flow problem of finite difference will be a good starting point.
________________________________________

>This is an "impulsive start" to the steady-state problem, the initial
>condition does not satisfy the boundary conditions.

>> Why it's here " - lid" rather than "+ lid"? How about if we use "
>> f[j][i].u = - lid " or " x[j][i].u = - lid "?

> Hopefully the explanation above explains this.  You aren't normally
> supposed to modify the solution vector X in residual evaluation, but
> this condition will usually be satisfied identically after the first
> iteration.

> I think that, at least in some cases, it is okay to project the solution
> vector during residual evaluation, but this is more relevant for
> the Jacobian should look like (it won't work correctly with colored or
> matrix-free finite difference Jacobians), so I don't recommend it.

The order of scheme is not a big issue to me. The big troubles I can't work out are:

1. Direct removing temperature terms in snes/ex19.c doesn't give a sensible result except applying option "-snes_mf" or "-snes_mf_operator".

2. Combining snes/ex19.c and ts/ex7.c (no temperature), I could not even get a converging SNES function norm or bounded result if I strictly follow your BC rules. But I can make it converged or bounded by setting BC like " f[j][i] = - lid " or "x[j][i] = - lid " with/without -snes_mf. I can send you my modified code (simple and straightforward) if you want.

Thank you again.

Regards,

Zhisong Li
```