Yes, It does converge toward 0-flow when I refine the mesh ! In the code, coordinates are set by ierr = DMDASetUniformCoordinates(da_prop,0.0+0.5*dx,1.0-0.5*dx,0.0+0.5*dy,1.0-0.5*dy,0.,0);CHKERRQ(ierr); Does it set coordinate for elements center here? When I want to try non-uniform grid, should I just modify coordinates attached with the DM, or I need more implementation?
Many thanks. Sang On Wed, Apr 16, 2014 at 6:23 PM, Matthew Knepley <[email protected]> wrote: > On Wed, Apr 16, 2014 at 4:48 PM, Sang pham van <[email protected]>wrote: > >> Hi Jed, >> >> I modified the ex43 code to enforce no-slip BCs on all boundaries. >> I run the code with volume force (0,-1) and isoviscosity. The expected >> result is Vx = Vy = 0 everywhere, and linearly decreasing pressure (from to >> to bottom). >> In the attached is plot of velocity field and pressure, so there is still >> a (light) flow in middle of the domain. Do you know why the solution is >> that, and what should I do to get the expected result? >> > > It sounds like it is due to discretization error. Your incompressibility > constraint is not verified element-wise > (I think ex43 is penalized Q1-Q1), so you can have some flow here. Refine > it and see if it converges toward > 0 flow. > > Matt > > >> Thank you. >> >> Sang >> >> >> >> >> On Wed, Mar 26, 2014 at 2:38 PM, Jed Brown <[email protected]> wrote: >> >>> Sang pham van <[email protected]> writes: >>> >>> > Hi Dave, >>> > I guess you are the one contributed the ex42 in KSP's examples. I want >>> to >>> > modify the example to solve for stokes flow driven by volume force in >>> 3D >>> > duct. Please help me to understand the code by answering the following >>> > questions: >>> > >>> > 1. Firstly, just for confirmation, the equations you're solving are: >>> > \nu * \nabla \cdot \nabla U - \nabla P = 0 and >>> >>> For variable viscosity, it must be formulated as in the example: >>> >>> \nabla\cdot (\nu D U) - \nabla P = 0 >>> >>> where D U = (\nabla U + (\nabla U)^T)/2 >>> >>> > \nabla \cdot U = 0 >>> > >>> > where U = (Ux,Uy,Uz), \nu is variable viscosity? >>> > >>> > 2. Are U and P defined at all nodes? (I googled the Q1Q1 element, it >>> looks >>> > like a box element with U and P defined at 8 corners). >>> >>> Yes. >>> >>> > 3. Are nodes' coordinate defined though the DA coordinates? >>> >>> Yes, though they are set to be uniform. >>> >>> > 4. How can I enforce noslip BC, and where should I plug in volume >>> force? >>> >>> Enforce the Dirichlet condition for the entire node. >>> >> >> > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener >
