Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Brandon Denton via petsc-users
How exactly does the aux data work? What is typically available there? Is it 
something the user can populate?



From: Matthew Knepley 
Sent: Wednesday, October 11, 2023 8:07 PM
To: Brandon Denton 
Cc: Jed Brown ; petsc-users 
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

On Wed, Oct 11, 2023 at 4:15 PM Brandon Denton 
mailto:blden...@buffalo.edu>> wrote:
By natural coordinates, I am referring to the reference element coordinates. 
Usually these are represented as (xi, eta, zeta) in the literature.

Yes. I would like to have the Jacobian and the derivatives of the map available 
within PetscDSSetResidual() f0 and f1 functions.

Yes, we can get these passed an aux data.

  I believe DMPlexComputeCellGeometryFEM() function provides this information. 
Is there a way to get the cell, shape functions as well? It not, can we talk 
about this more? I would like to understand how the shape functions are 
addressed within PETSc. Dr. Kirk's approach uses the shape function gradients 
in its SUPG parameter. I'd love to talk with you about this is more detail.

There should be a way to formulate this in a basis independent way.  I would 
much prefer that to
explicit inclusion of the basis.

  Thanks,

 Matt

From: Matthew Knepley mailto:knep...@gmail.com>>
Sent: Wednesday, October 11, 2023 3:13 PM
To: Brandon Denton mailto:blden...@buffalo.edu>>
Cc: Jed Brown mailto:j...@jedbrown.org>>; petsc-users 
mailto:petsc-users@mcs.anl.gov>>
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

On Wed, Oct 11, 2023 at 2:09 PM Brandon Denton 
mailto:blden...@buffalo.edu>> wrote:
Thank you for the discussion.

Are we agreed then that the derivatives of the natural coordinates are required 
for the described approach? If so, is this something PETSc can currently do 
within the point-wise residual functions?

I am not sure what natural coordinates are. Do we just mean the Jacobian, 
derivatives of the map between reference and real coordinates? If so, yes the 
Jacobian is available. Right now I do not pass it
directly, but passing it is easy.

  Thanks,

 Matt

Matt - Thank you for the command line option for the 2nd derivatives. Those 
will be needed to implement the discussed approach. Specifically in the 
stabilization and shock capture parameters. (Ref.: B. Kirk's Thesis). What is a 
good reference for the usual SUPG method you are referencing? I've been looking 
through my textbooks but haven't found a good reference.

Jed - Thank you for the link. I will review the information on it.

Sorry about the attachment. I will upload it to this thread later (I'm at work 
right now and I can't do it from here).

From: Jed Brown mailto:j...@jedbrown.org>>
Sent: Wednesday, October 11, 2023 1:38 PM
To: Matthew Knepley mailto:knep...@gmail.com>>
Cc: Brandon Denton mailto:blden...@buffalo.edu>>; 
petsc-users mailto:petsc-users@mcs.anl.gov>>
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

Matthew Knepley mailto:knep...@gmail.com>> writes:

> On Wed, Oct 11, 2023 at 1:03 PM Jed Brown 
> mailto:j...@jedbrown.org>> wrote:
>
>> I don't see an attachment, but his thesis used conservative variables and
>> defined an effective length scale in a way that seemed to assume constant
>> shape function gradients. I'm not aware of systematic literature comparing
>> the covariant and contravariant length measures on anisotropic meshes, but
>> I believe most people working in the Shakib/Hughes approach use the
>> covariant measure. Our docs have a brief discussion of this choice.
>>
>> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibceed.org%2Fen%2Flatest%2Fexamples%2Ffluids%2F%23equation-eq-peclet=05%7C01%7Cbldenton%40buffalo.edu%7Cd9372f934b26455371a708dbca80dc8e%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638326427028053956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=skMsKDmpBxiaXtBSqhsyckvVpTOkGqDsNJIYo22Ywps%3D=0<https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet>
>>
>> Matt, I don't understand how the second derivative comes into play as a
>> length measure on anistropic meshes -- the second derivatives can be
>> uniformly zero and yet you still need a length measure.
>>
>
> I was talking about the usual SUPG where we just penalize the true residual.

I think you're focused on computing the strong diffusive flux (which can be 
done using second derivatives or by a projection; the latter produces somewhat 
better results). But you still need a length scale and that's most naturally 
computed using the derivative of reference coordinates with respect to physical 
(or equivalently, the associated metric tensor).


--
What most ex

Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Matthew Knepley
On Wed, Oct 11, 2023 at 4:15 PM Brandon Denton  wrote:

> By natural coordinates, I am referring to the reference element
> coordinates. Usually these are represented as (xi, eta, zeta) in the
> literature.
>
> Yes. I would like to have the Jacobian and the derivatives of the map
> available within PetscDSSetResidual() f0 and f1 functions.
>

Yes, we can get these passed an aux data.


>   I believe DMPlexComputeCellGeometryFEM() function provides this
> information. Is there a way to get the cell, shape functions as well? It
> not, can we talk about this more? I would like to understand how the shape
> functions are addressed within PETSc. Dr. Kirk's approach uses the shape
> function gradients in its SUPG parameter. I'd love to talk with you about
> this is more detail.
>

There should be a way to formulate this in a basis independent way.  I
would much prefer that to
explicit inclusion of the basis.

  Thanks,

 Matt


> *From:* Matthew Knepley 
> *Sent:* Wednesday, October 11, 2023 3:13 PM
> *To:* Brandon Denton 
> *Cc:* Jed Brown ; petsc-users 
> *Subject:* Re: [petsc-users] FEM Implementation of NS with SUPG
> Stabilization
>
> On Wed, Oct 11, 2023 at 2:09 PM Brandon Denton 
> wrote:
>
> Thank you for the discussion.
>
> Are we agreed then that the derivatives of the natural coordinates are
> required for the described approach? If so, is this something PETSc can
> currently do within the point-wise residual functions?
>
>
> I am not sure what natural coordinates are. Do we just mean the Jacobian,
> derivatives of the map between reference and real coordinates? If so, yes
> the Jacobian is available. Right now I do not pass it
> directly, but passing it is easy.
>
>   Thanks,
>
>  Matt
>
>
> Matt - Thank you for the command line option for the 2nd derivatives.
> Those will be needed to implement the discussed approach. Specifically in
> the stabilization and shock capture parameters. (Ref.: B. Kirk's Thesis).
> What is a good reference for the usual SUPG method you are referencing?
> I've been looking through my textbooks but haven't found a good reference.
>
> Jed - Thank you for the link. I will review the information on it.
>
> Sorry about the attachment. I will upload it to this thread later (I'm at
> work right now and I can't do it from here).
> --
> *From:* Jed Brown 
> *Sent:* Wednesday, October 11, 2023 1:38 PM
> *To:* Matthew Knepley 
> *Cc:* Brandon Denton ; petsc-users <
> petsc-users@mcs.anl.gov>
> *Subject:* Re: [petsc-users] FEM Implementation of NS with SUPG
> Stabilization
>
> Matthew Knepley  writes:
>
> > On Wed, Oct 11, 2023 at 1:03 PM Jed Brown  wrote:
> >
> >> I don't see an attachment, but his thesis used conservative variables
> and
> >> defined an effective length scale in a way that seemed to assume
> constant
> >> shape function gradients. I'm not aware of systematic literature
> comparing
> >> the covariant and contravariant length measures on anisotropic meshes,
> but
> >> I believe most people working in the Shakib/Hughes approach use the
> >> covariant measure. Our docs have a brief discussion of this choice.
> >>
> >>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibceed.org%2Fen%2Flatest%2Fexamples%2Ffluids%2F%23equation-eq-peclet=05%7C01%7Cbldenton%40buffalo.edu%7Cd9372f934b26455371a708dbca80dc8e%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638326427028053956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=skMsKDmpBxiaXtBSqhsyckvVpTOkGqDsNJIYo22Ywps%3D=0
> <https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet>
> >>
> >> Matt, I don't understand how the second derivative comes into play as a
> >> length measure on anistropic meshes -- the second derivatives can be
> >> uniformly zero and yet you still need a length measure.
> >>
> >
> > I was talking about the usual SUPG where we just penalize the true
> residual.
>
> I think you're focused on computing the strong diffusive flux (which can
> be done using second derivatives or by a projection; the latter produces
> somewhat better results). But you still need a length scale and that's most
> naturally computed using the derivative of reference coordinates with
> respect to physical (or equivalently, the associated metric tensor).
>
>
>
> --
> 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
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Brandon Denton via petsc-users
By natural coordinates, I am referring to the reference element coordinates. 
Usually these are represented as (xi, eta, zeta) in the literature.

Yes. I would like to have the Jacobian and the derivatives of the map available 
within PetscDSSetResidual() f0 and f1 functions.  I believe 
DMPlexComputeCellGeometryFEM() function provides this information. Is there a 
way to get the cell, shape functions as well? It not, can we talk about this 
more? I would like to understand how the shape functions are addressed within 
PETSc. Dr. Kirk's approach uses the shape function gradients in its SUPG 
parameter. I'd love to talk with you about this is more detail.







From: Matthew Knepley 
Sent: Wednesday, October 11, 2023 3:13 PM
To: Brandon Denton 
Cc: Jed Brown ; petsc-users 
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

On Wed, Oct 11, 2023 at 2:09 PM Brandon Denton 
mailto:blden...@buffalo.edu>> wrote:
Thank you for the discussion.

Are we agreed then that the derivatives of the natural coordinates are required 
for the described approach? If so, is this something PETSc can currently do 
within the point-wise residual functions?

I am not sure what natural coordinates are. Do we just mean the Jacobian, 
derivatives of the map between reference and real coordinates? If so, yes the 
Jacobian is available. Right now I do not pass it
directly, but passing it is easy.

  Thanks,

 Matt

Matt - Thank you for the command line option for the 2nd derivatives. Those 
will be needed to implement the discussed approach. Specifically in the 
stabilization and shock capture parameters. (Ref.: B. Kirk's Thesis). What is a 
good reference for the usual SUPG method you are referencing? I've been looking 
through my textbooks but haven't found a good reference.

Jed - Thank you for the link. I will review the information on it.

Sorry about the attachment. I will upload it to this thread later (I'm at work 
right now and I can't do it from here).

From: Jed Brown mailto:j...@jedbrown.org>>
Sent: Wednesday, October 11, 2023 1:38 PM
To: Matthew Knepley mailto:knep...@gmail.com>>
Cc: Brandon Denton mailto:blden...@buffalo.edu>>; 
petsc-users mailto:petsc-users@mcs.anl.gov>>
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

Matthew Knepley mailto:knep...@gmail.com>> writes:

> On Wed, Oct 11, 2023 at 1:03 PM Jed Brown 
> mailto:j...@jedbrown.org>> wrote:
>
>> I don't see an attachment, but his thesis used conservative variables and
>> defined an effective length scale in a way that seemed to assume constant
>> shape function gradients. I'm not aware of systematic literature comparing
>> the covariant and contravariant length measures on anisotropic meshes, but
>> I believe most people working in the Shakib/Hughes approach use the
>> covariant measure. Our docs have a brief discussion of this choice.
>>
>> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibceed.org%2Fen%2Flatest%2Fexamples%2Ffluids%2F%23equation-eq-peclet=05%7C01%7Cbldenton%40buffalo.edu%7Cd9372f934b26455371a708dbca80dc8e%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638326427028053956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=skMsKDmpBxiaXtBSqhsyckvVpTOkGqDsNJIYo22Ywps%3D=0<https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet>
>>
>> Matt, I don't understand how the second derivative comes into play as a
>> length measure on anistropic meshes -- the second derivatives can be
>> uniformly zero and yet you still need a length measure.
>>
>
> I was talking about the usual SUPG where we just penalize the true residual.

I think you're focused on computing the strong diffusive flux (which can be 
done using second derivatives or by a projection; the latter produces somewhat 
better results). But you still need a length scale and that's most naturally 
computed using the derivative of reference coordinates with respect to physical 
(or equivalently, the associated metric tensor).


--
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

https://www.cse.buffalo.edu/~knepley/<http://www.cse.buffalo.edu/~knepley/>


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Matthew Knepley
On Wed, Oct 11, 2023 at 2:09 PM Brandon Denton  wrote:

> Thank you for the discussion.
>
> Are we agreed then that the derivatives of the natural coordinates are
> required for the described approach? If so, is this something PETSc can
> currently do within the point-wise residual functions?
>

I am not sure what natural coordinates are. Do we just mean the Jacobian,
derivatives of the map between reference and real coordinates? If so, yes
the Jacobian is available. Right now I do not pass it
directly, but passing it is easy.

  Thanks,

 Matt


> Matt - Thank you for the command line option for the 2nd derivatives.
> Those will be needed to implement the discussed approach. Specifically in
> the stabilization and shock capture parameters. (Ref.: B. Kirk's Thesis).
> What is a good reference for the usual SUPG method you are referencing?
> I've been looking through my textbooks but haven't found a good reference.
>
> Jed - Thank you for the link. I will review the information on it.
>
> Sorry about the attachment. I will upload it to this thread later (I'm at
> work right now and I can't do it from here).
> --
> *From:* Jed Brown 
> *Sent:* Wednesday, October 11, 2023 1:38 PM
> *To:* Matthew Knepley 
> *Cc:* Brandon Denton ; petsc-users <
> petsc-users@mcs.anl.gov>
> *Subject:* Re: [petsc-users] FEM Implementation of NS with SUPG
> Stabilization
>
> Matthew Knepley  writes:
>
> > On Wed, Oct 11, 2023 at 1:03 PM Jed Brown  wrote:
> >
> >> I don't see an attachment, but his thesis used conservative variables
> and
> >> defined an effective length scale in a way that seemed to assume
> constant
> >> shape function gradients. I'm not aware of systematic literature
> comparing
> >> the covariant and contravariant length measures on anisotropic meshes,
> but
> >> I believe most people working in the Shakib/Hughes approach use the
> >> covariant measure. Our docs have a brief discussion of this choice.
> >>
> >>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibceed.org%2Fen%2Flatest%2Fexamples%2Ffluids%2F%23equation-eq-peclet=05%7C01%7Cbldenton%40buffalo.edu%7Cd9372f934b26455371a708dbca80dc8e%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638326427028053956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=skMsKDmpBxiaXtBSqhsyckvVpTOkGqDsNJIYo22Ywps%3D=0
> <https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet>
> >>
> >> Matt, I don't understand how the second derivative comes into play as a
> >> length measure on anistropic meshes -- the second derivatives can be
> >> uniformly zero and yet you still need a length measure.
> >>
> >
> > I was talking about the usual SUPG where we just penalize the true
> residual.
>
> I think you're focused on computing the strong diffusive flux (which can
> be done using second derivatives or by a projection; the latter produces
> somewhat better results). But you still need a length scale and that's most
> naturally computed using the derivative of reference coordinates with
> respect to physical (or equivalently, the associated metric tensor).
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Brandon Denton via petsc-users
Thank you for the discussion.

Are we agreed then that the derivatives of the natural coordinates are required 
for the described approach? If so, is this something PETSc can currently do 
within the point-wise residual functions?

Matt - Thank you for the command line option for the 2nd derivatives. Those 
will be needed to implement the discussed approach. Specifically in the 
stabilization and shock capture parameters. (Ref.: B. Kirk's Thesis). What is a 
good reference for the usual SUPG method you are referencing? I've been looking 
through my textbooks but haven't found a good reference.

Jed - Thank you for the link. I will review the information on it.

Sorry about the attachment. I will upload it to this thread later (I'm at work 
right now and I can't do it from here).

From: Jed Brown 
Sent: Wednesday, October 11, 2023 1:38 PM
To: Matthew Knepley 
Cc: Brandon Denton ; petsc-users 
Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

Matthew Knepley  writes:

> On Wed, Oct 11, 2023 at 1:03 PM Jed Brown  wrote:
>
>> I don't see an attachment, but his thesis used conservative variables and
>> defined an effective length scale in a way that seemed to assume constant
>> shape function gradients. I'm not aware of systematic literature comparing
>> the covariant and contravariant length measures on anisotropic meshes, but
>> I believe most people working in the Shakib/Hughes approach use the
>> covariant measure. Our docs have a brief discussion of this choice.
>>
>> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibceed.org%2Fen%2Flatest%2Fexamples%2Ffluids%2F%23equation-eq-peclet=05%7C01%7Cbldenton%40buffalo.edu%7Cd9372f934b26455371a708dbca80dc8e%7C96464a8af8ed40b199e25f6b50a20250%7C0%7C0%7C638326427028053956%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=skMsKDmpBxiaXtBSqhsyckvVpTOkGqDsNJIYo22Ywps%3D=0<https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet>
>>
>> Matt, I don't understand how the second derivative comes into play as a
>> length measure on anistropic meshes -- the second derivatives can be
>> uniformly zero and yet you still need a length measure.
>>
>
> I was talking about the usual SUPG where we just penalize the true residual.

I think you're focused on computing the strong diffusive flux (which can be 
done using second derivatives or by a projection; the latter produces somewhat 
better results). But you still need a length scale and that's most naturally 
computed using the derivative of reference coordinates with respect to physical 
(or equivalently, the associated metric tensor).


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Jed Brown
Matthew Knepley  writes:

> On Wed, Oct 11, 2023 at 1:03 PM Jed Brown  wrote:
>
>> I don't see an attachment, but his thesis used conservative variables and
>> defined an effective length scale in a way that seemed to assume constant
>> shape function gradients. I'm not aware of systematic literature comparing
>> the covariant and contravariant length measures on anisotropic meshes, but
>> I believe most people working in the Shakib/Hughes approach use the
>> covariant measure. Our docs have a brief discussion of this choice.
>>
>> https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet
>>
>> Matt, I don't understand how the second derivative comes into play as a
>> length measure on anistropic meshes -- the second derivatives can be
>> uniformly zero and yet you still need a length measure.
>>
>
> I was talking about the usual SUPG where we just penalize the true residual.

I think you're focused on computing the strong diffusive flux (which can be 
done using second derivatives or by a projection; the latter produces somewhat 
better results). But you still need a length scale and that's most naturally 
computed using the derivative of reference coordinates with respect to physical 
(or equivalently, the associated metric tensor).


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Matthew Knepley
On Wed, Oct 11, 2023 at 1:03 PM Jed Brown  wrote:

> I don't see an attachment, but his thesis used conservative variables and
> defined an effective length scale in a way that seemed to assume constant
> shape function gradients. I'm not aware of systematic literature comparing
> the covariant and contravariant length measures on anisotropic meshes, but
> I believe most people working in the Shakib/Hughes approach use the
> covariant measure. Our docs have a brief discussion of this choice.
>
> https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet
>
> Matt, I don't understand how the second derivative comes into play as a
> length measure on anistropic meshes -- the second derivatives can be
> uniformly zero and yet you still need a length measure.
>

I was talking about the usual SUPG where we just penalize the true residual.

  Matt


> Brandon Denton via petsc-users  writes:
>
> > I was thinking about trying to implement Ben Kirk's approach to
> Navier-Stokes (see attached paper; Section 5). His approach uses these
> quantities to align the orientation of the unstructured element/cell with
> the fluid velocity to apply the stabilization/upwinding and to detect
> shocks.
> >
> > If you have an example of the approach you mentioned, could you please
> send it over so I can review it?
> >
> > On Oct 11, 2023 6:02 AM, Matthew Knepley  wrote:
> > On Tue, Oct 10, 2023 at 9:34 PM Brandon Denton via petsc-users <
> petsc-users@mcs.anl.gov> wrote:
> > Good Evening,
> >
> > I am looking to implement a form of Navier-Stokes with SUPG
> Stabilization and shock capturing using PETSc's FEM infrastructure. In this
> implementation, I need access to the cell's shape function gradients and
> natural coordinate gradients for calculations within the point-wise
> residual calculations. How do I get these quantities at the quadrature
> points? The signatures for fo and f1 don't seem to contain this information.
> >
> > Are you sure you need those? Darsh and I implemented SUPG without that.
> You would need local second derivative information, which you can get using
> -dm_ds_jet_degree 2. If you check in an example, I can go over it.
> >
> >   Thanks,
> >
> >  Matt
> >
> > Thank you in advance for your time.
> > Brandon
> >
> >
> > --
> > 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
> >
> > https://www.cse.buffalo.edu/~knepley/<
> http://www.cse.buffalo.edu/~knepley/>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Jed Brown
I don't see an attachment, but his thesis used conservative variables and 
defined an effective length scale in a way that seemed to assume constant shape 
function gradients. I'm not aware of systematic literature comparing the 
covariant and contravariant length measures on anisotropic meshes, but I 
believe most people working in the Shakib/Hughes approach use the covariant 
measure. Our docs have a brief discussion of this choice.

https://libceed.org/en/latest/examples/fluids/#equation-eq-peclet

Matt, I don't understand how the second derivative comes into play as a length 
measure on anistropic meshes -- the second derivatives can be uniformly zero 
and yet you still need a length measure.

Brandon Denton via petsc-users  writes:

> I was thinking about trying to implement Ben Kirk's approach to Navier-Stokes 
> (see attached paper; Section 5). His approach uses these quantities to align 
> the orientation of the unstructured element/cell with the fluid velocity to 
> apply the stabilization/upwinding and to detect shocks.
>
> If you have an example of the approach you mentioned, could you please send 
> it over so I can review it?
>
> On Oct 11, 2023 6:02 AM, Matthew Knepley  wrote:
> On Tue, Oct 10, 2023 at 9:34 PM Brandon Denton via petsc-users 
> mailto:petsc-users@mcs.anl.gov>> wrote:
> Good Evening,
>
> I am looking to implement a form of Navier-Stokes with SUPG Stabilization and 
> shock capturing using PETSc's FEM infrastructure. In this implementation, I 
> need access to the cell's shape function gradients and natural coordinate 
> gradients for calculations within the point-wise residual calculations. How 
> do I get these quantities at the quadrature points? The signatures for fo and 
> f1 don't seem to contain this information.
>
> Are you sure you need those? Darsh and I implemented SUPG without that. You 
> would need local second derivative information, which you can get using 
> -dm_ds_jet_degree 2. If you check in an example, I can go over it.
>
>   Thanks,
>
>  Matt
>
> Thank you in advance for your time.
> Brandon
>
>
> --
> 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
>
> https://www.cse.buffalo.edu/~knepley/


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Brandon Denton via petsc-users
I was thinking about trying to implement Ben Kirk's approach to Navier-Stokes 
(see attached paper; Section 5). His approach uses these quantities to align 
the orientation of the unstructured element/cell with the fluid velocity to 
apply the stabilization/upwinding and to detect shocks.

If you have an example of the approach you mentioned, could you please send it 
over so I can review it?

On Oct 11, 2023 6:02 AM, Matthew Knepley  wrote:
On Tue, Oct 10, 2023 at 9:34 PM Brandon Denton via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:
Good Evening,

I am looking to implement a form of Navier-Stokes with SUPG Stabilization and 
shock capturing using PETSc's FEM infrastructure. In this implementation, I 
need access to the cell's shape function gradients and natural coordinate 
gradients for calculations within the point-wise residual calculations. How do 
I get these quantities at the quadrature points? The signatures for fo and f1 
don't seem to contain this information.

Are you sure you need those? Darsh and I implemented SUPG without that. You 
would need local second derivative information, which you can get using 
-dm_ds_jet_degree 2. If you check in an example, I can go over it.

  Thanks,

 Matt

Thank you in advance for your time.
Brandon


--
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

https://www.cse.buffalo.edu/~knepley/


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-11 Thread Matthew Knepley
On Tue, Oct 10, 2023 at 9:34 PM Brandon Denton via petsc-users <
petsc-users@mcs.anl.gov> wrote:

> Good Evening,
>
> I am looking to implement a form of Navier-Stokes with SUPG Stabilization
> and shock capturing using PETSc's FEM infrastructure. In this
> implementation, I need access to the cell's shape function gradients and
> natural coordinate gradients for calculations within the point-wise
> residual calculations. How do I get these quantities at the quadrature
> points? The signatures for fo and f1 don't seem to contain this information.
>

Are you sure you need those? Darsh and I implemented SUPG without that. You
would need local second derivative information, which you can get using
-dm_ds_jet_degree 2. If you check in an example, I can go over it.

  Thanks,

 Matt


> Thank you in advance for your time.
> Brandon
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-10 Thread Brandon Denton via petsc-users
My initial plan was to write a new code using only PETSc. However, I don't see 
how to do what I want within the point-wise residual function. Am I missing 
something?

Yes. I would be interested in collaborating on the ceed-fluids. I took a quick 
look at the links you provided and it looks interesting. I'll warn you though. 
I'm a Mechanical Engineer by trade/training. The calculus and programming 
sometimes take me a little while to wrap my head around. Let me know how I can 
help. In the meantime, I'll continue to review the information you sent over.

From: Jed Brown 
Sent: Tuesday, October 10, 2023 10:18 PM
To: Brandon Denton ; petsc-users@mcs.anl.gov 

Subject: Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

Do you want to write a new code using only PETSc or would you be up for 
collaborating on ceed-fluids, which is a high-performance compressible SUPG 
solver based on DMPlex with good GPU support? It uses the metric to compute 
covariant length for stabilization. We have YZƁ shock capturing, though it 
hasn't been tested much beyond shock tube experiments. (Most of our work has 
been low Mach.)

https://libceed.org/en/latest/examples/fluids/
https://github.com/CEED/libCEED/blob/main/examples/fluids/qfunctions/stabilization.h#L76


On Tue, Oct 10, 2023, at 7:34 PM, Brandon Denton via petsc-users wrote:
Good Evening,

I am looking to implement a form of Navier-Stokes with SUPG Stabilization and 
shock capturing using PETSc's FEM infrastructure. In this implementation, I 
need access to the cell's shape function gradients and natural coordinate 
gradients for calculations within the point-wise residual calculations. How do 
I get these quantities at the quadrature points? The signatures for fo and f1 
don't seem to contain this information.

Thank you in advance for your time.
Brandon



Re: [petsc-users] FEM Implementation of NS with SUPG Stabilization

2023-10-10 Thread Jed Brown
Do you want to write a new code using only PETSc or would you be up for 
collaborating on ceed-fluids, which is a high-performance compressible SUPG 
solver based on DMPlex with good GPU support? It uses the metric to compute 
covariant length for stabilization. We have YZƁ shock capturing, though it 
hasn't been tested much beyond shock tube experiments. (Most of our work has 
been low Mach.)

https://libceed.org/en/latest/examples/fluids/
https://github.com/CEED/libCEED/blob/main/examples/fluids/qfunctions/stabilization.h#L76


On Tue, Oct 10, 2023, at 7:34 PM, Brandon Denton via petsc-users wrote:
> Good Evening,
> 
> I am looking to implement a form of Navier-Stokes with SUPG Stabilization and 
> shock capturing using PETSc's FEM infrastructure. In this implementation, I 
> need access to the cell's shape function gradients and natural coordinate 
> gradients for calculations within the point-wise residual calculations. How 
> do I get these quantities at the quadrature points? The signatures for fo and 
> f1 don't seem to contain this information.
> 
> Thank you in advance for your time.
> Brandon