[petsc-users] want some explanations on BC setup

Li, Zhisong (lizs) lizs at mail.uc.edu
Fri Apr 23 13:45:58 CDT 2010



>I don't believe you are actually doing this since it will not converge:
>f[j][i] will never go to zero so the norm of the residual will not
>either.

>Jed


Actually here I mean putting only the equations and BC of snes/ex19.c into ts/ex7.c , not the exact program and no DMMG issue. I use x[j][i].u=0.0 or -lid as BC and it converges well. If I use f[j][i].u=x[j][i].u - lid ,x[j][i].u value at the boundary will grow up uncontrollably as time marches. 


> There are a variety of ways to enforce Dirichlet conditions without
>  removing them from the function space, I don't know what specifically
>  you are asking about TS examples, but if you use an initial condition that is
>  incompatible with Dirichlet boundary conditions, it will normally be made 
>  consistent at the end of the first step.


And for the driven cavity problem (snes/ex19.c), it's not fully Dirichlet boundary as omega on solid wall is not fixed and need to be determined. So we can never make IC consistent with BC for this case. You said " it will normally be made consistent at the end of the first step" I think this is not correct. Here is my test on ts/ex7.c:


Change the IC value 0.0 at the boundary (line 249) as nonzero, say 1.5. 

Leave the BC as f[j][i]=x[j][i] unchanged or fix it as f[j][i] =0.0 (line 189)
I also add "VecView(x,PETSC_VIEWER_DRAW_WORLD);" to view the result.

You will find the steady state result completely different because of the IC.

I really want go through this IC overwriting problem. Do you have any suggestion?


Thank you again.


Regards,

Zhisong Li


More information about the petsc-users mailing list