[petsc-users] examples of DMPlex*FVM methods

Matthew Knepley knepley at gmail.com
Thu Apr 6 08:18:14 CDT 2017


On Thu, Apr 6, 2017 at 7:04 AM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
>
> > On Wed, Apr 5, 2017 at 9:57 PM, Jed Brown <jed at jedbrown.org> wrote:
> >
> >> Matthew Knepley <knepley at gmail.com> writes:
> >>
> >> > On Wed, Apr 5, 2017 at 1:13 PM, Jed Brown <jed at jedbrown.org> wrote:
> >> >
> >> >> Matthew Knepley <knepley at gmail.com> writes:
> >> >>
> >> >> > On Wed, Apr 5, 2017 at 12:03 PM, Jed Brown <jed at jedbrown.org>
> wrote:
> >> >> >
> >> >> >> Matthew Knepley <knepley at gmail.com> writes:
> >> >> >> > As a side note, I think using FV to solve an elliptic equation
> >> should
> >> >> be
> >> >> >> a
> >> >> >> > felony. Continuous FEM is excellent for this, whereas FV needs
> >> >> >> > a variety of twisted hacks and is always worse in terms of
> >> computation
> >> >> >> and
> >> >> >> > accuracy.
> >> >> >>
> >> >> >> Unless you need exact (no discretization error) local
> conservation,
> >> >> >> e.g., for a projection in a staggered grid incompressible flow
> >> problem,
> >> >> >> in which case you can use either FV or mixed FEM (algebraically
> >> >> >> equivalent to FV in some cases).
> >> >> >>
> >> >> >
> >> >> > Okay, the words are getting in the way of me understanding. I want
> to
> >> see
> >> >> > if I can pull something I can use out of the above explanation.
> >> >> >
> >> >> > First, "locally conservative" bothers me. It does not seem to
> indicate
> >> >> what
> >> >> > it really does. I start with the Poisson equation
> >> >> >
> >> >> >   \Delta p = f
> >> >> >
> >> >> > So the setup is then that I discretize both the quantity and its
> >> >> derivative
> >> >> > (I will use mixed FEM style since I know it better)
> >> >> >
> >> >> >   div  v = f
> >> >> >   grad p = v
> >> >> >
> >> >> > Now, you might expect that "local conservation" would give me the
> >> exact
> >> >> > result for
> >> >> >
> >> >> >   \int_T p
> >> >> >
> >> >> > everywhere, meaning the integral of p over every cell T.
> >> >>
> >> >> Since when is pressure a conserved quantity?
> >> >>
> >> >> In your notation above, local conservation means
> >> >>
> >> >>   \int_T (div v - f) = 0
> >> >>
> >> >> I.e., if you have a tracer moving in a source-free velocity field v
> >> >> solving the above equation, its concentration satisfies
> >> >>
> >> >>   c_t + div(c v) = 0
> >> >>
> >> >> and it will be conserved element-wise.
> >> >>
> >> >
> >> > But again that seems like a terrible term. What that statement above
> >> means
> >> > is that globally
> >> > I will have no loss, but the individual amounts in each cell are not
> >> > accurate to machine error,
> >> > they are accurate to discretization error because the flux is only
> >> accurate
> >> > to discretization error.
> >>
> >> No. The velocity field is divergence-free up to solver tolerance.  Since
> >> the piecewise constants are in the test space, there is a literal
> >> equation that reads
> >>
> >>   \int_T (div v - f) = 0.
> >>
> >> That holds up to solver tolerance, not just up to discretization error.
> >> That's what local conservation means.
> >>
> >> If you use continuous FEM, you don't have a statement like the above.
> >>
> >
> > Okay, that is what you mean by local conservation. That state is still
> only
> > accurate to discretization error.
> > Why do I care about satisfying that equation to machine precision?
>
> I swear we've had this discussion before.  If you have a tracer moving
> in a velocity field that is not discrete divergence-free (i.e.,
> satisfying the element-wise equation above), you'll get artifacts in the
> concentration (possibly violating positivity or a maximum principle).
> The (normal component of) velocity is also more accurate when you solve
> in mixed H(div) form (or an equivalent FV method) than if you solve in
> H^1.
>

Okay, that makes sense. If I do not have fluxes matching the sources, I do
not
preserve montonicity for an advected field. I might need this to machine
precision
because some other equations cannot tolerate a negative number there. I will
write this one down.

Why do I need it "for a projection in a staggered grid incompressible flow
problem".
This would mean I satisfy (I think)

  \int_T div p = 0

meaning that there is a force balance on each cell to machine precision. If
I just care
about the fluid flow, this does not seem important.

  Thanks,

     Matt

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170406/64f95c90/attachment.html>


More information about the petsc-users mailing list