Surface / volume interactions for a 3D extruded mesh

32 views
Skip to first unread message

Corbin Foucart

unread,
Jan 1, 2021, 12:53:49 PM1/1/21
to deal.II User Group
Hello deal.ii community,

I've really enjoyed using deal.ii over the past few weeks -- it's very impressive how complete the software is. I'm in the process of implementing an ocean equations solver which has a few unusual features:
  1. The problem is to be solved over a 3D mesh extruded downwards in depth from a 2D surface mesh
  2. There is a free surface equation which makes use of the original 2D mesh
  3. 3D data is communicated to the 2D surface by integrating finite element fields vertically over the entire domain in depth (depth-averaged fields)
  4. From a 3D scalar field, I will need to compute another 3D scalar field representing the original field integrated to depth z (like a hydrostatic pressure at every point in the domain)
How I was thinking of doing this:
  • (1) Mesh the 2D region with gmsh and extrude it using the approach in step-49; this seems clear
  • (2,3) I was considering holding the original 2D mesh in memory and creating some type of map between the top-level volume elements and the surface. Is there a better way I could go about mapping the 3D volume data and depth-averaged data to the surface mesh?
  • (4) I can re-write the hydrostatic integrals as an ode in depth and march element-by-element from surface to bottom along each vertical column using a DG scheme. 
    • To isolate each vertical column, I could assign a material ID to each one
    • However, I need to extract the value on the bottom of each element above as a boundary condition to the element below
    • I could probably do this with FEFaceValues, but it's unclear to me how to "request" values on a top or bottom face (since element orientation is general). Is there an ordering I could rely on if I know it for a single element?
Any tips would be appreciated!

Best,
Corbin

Wells, David

unread,
Jan 4, 2021, 10:39:02 AM1/4/21
to dea...@googlegroups.com
Hi Corbin,

> Is there a better way I could go about mapping the 3D volume data and depth-averaged data to the surface mesh?

This is a tough question - other deal.II developers are trying to figure out how to do this in parallel here:


for now I'll assume you are doing things in serial. Collecting columns by material id sounds reasonable to me: GridGenerator::extrude_triangulation extrudes material ids so this should be pretty easy to do.

> I could probably do this with FEFaceValues, but it's unclear to me how to "request" values on a top or bottom face (since element orientation is general). Is there an ordering I could rely on if I know it for a single element?

The simplest way to do this would be to loop across the faces find the one with a downward-facing normal vector and the one with an upward-facing normal vector. If things really are extruded in the normal way then these should be the second to last and last faces, respectively, but checking the normal vectors should always work.

In particular, if you want to use FEFaceValues, you could try looping over the faces of the cell and only reinitialize FEFaceValues when a face has the right normal vector.

Best,
David

From: dea...@googlegroups.com <dea...@googlegroups.com> on behalf of Corbin Foucart <corbin....@gmail.com>
Sent: Friday, January 1, 2021 12:53 PM
To: deal.II User Group <dea...@googlegroups.com>
Subject: [deal.II] Surface / volume interactions for a 3D extruded mesh
 
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/55879d8b-7ca3-4abf-b59f-9eee8b49be25n%40googlegroups.com.

Wolfgang Bangerth

unread,
Feb 4, 2021, 5:16:11 PM2/4/21
to dea...@googlegroups.com

Corbin,
a month late, but maybe still useful: For your particular situation, where you
replicate a mesh in depth direction multiple times, it might also be
worthwhile thinking of this as "just a 2d problem" where at each node, you
just define as many variables as there are depth slices. In other words, you
work with just one 2d mesh but many variables via an FESystem object. This
makes a lot of operations much simpler where you're having to walk along
individual mesh lines from surface to ocean bottom or back up: These are in
essence all just equations defined at individual node points on the 2d mesh.

Best
W.

On 1/1/21 10:53 AM, Corbin Foucart wrote:
> Hello deal.ii community,
>
> I've really enjoyed using deal.ii over the past few weeks -- it's very
> impressive how complete the software is. I'm in the process of implementing an
> ocean equations solver which has a few unusual features:
>
> 1. The problem is to be solved over a 3D mesh extruded downwards in depth
> from a 2D surface mesh
> 2. There is a free surface equation which makes use of the original 2D mesh
> 3. 3D data is communicated to the 2D surface by integrating finite element
> fields vertically over the entire domain in depth (depth-averaged fields)
> 4. From a 3D scalar field, I will need to compute another 3D scalar field
> representing the original field integrated to depth z (like a hydrostatic
> pressure at every point in the domain)
>
> How I was thinking of doing this:
>
> * (1) Mesh the 2D region with gmsh and extrude it using the approach in
> step-49; this seems clear
> * (2,3) I was considering holding the original 2D mesh in memory and
> creating some type of map between the top-level volume elements and the
> surface./Is there a better way I could go about mapping the 3D volume data
> and depth-averaged data to the surface mesh?/
> * (4) I can re-write the hydrostatic integrals as an ode in depth and march
> element-by-element from surface to bottom along each vertical column using
> a DG scheme.
> o To isolate each vertical column, I could assign a material ID to each one
> o However, I need to extract the value on the bottom of each element
> above as a boundary condition to the element below
> o I could probably do this with FEFaceValues, /but it's unclear to me
> how to "request" values on a top or bottom face/ (since element
> orientation is general). Is there an ordering I could rely on if I
> know it for a single element?
>
> Any tips would be appreciated!
>
> Best,
> Corbin
>
> --
> The deal.II project is located at http://www.dealii.org/
> <https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.dealii.org%2F&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cd380e0c8086e474c974f08d8ae7e33c8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637451204355489357%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=egihkmggU8qn7AERoNK7m6RM02%2FHyx3ilXqwbNrpi%2Fk%3D&reserved=0>
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fforum%2Fdealii%3Fhl%3Den&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cd380e0c8086e474c974f08d8ae7e33c8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637451204355499351%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wcs7SHTLnMK6Y8G1dsUbOK15G1wEPNJLFSCDYrQH4ow%3D&reserved=0>
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com
> <mailto:dealii+un...@googlegroups.com>.
> <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdealii%2F55879d8b-7ca3-4abf-b59f-9eee8b49be25n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Cd380e0c8086e474c974f08d8ae7e33c8%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637451204355499351%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=nSrWP87M40vpYLP9Gyp8XzEBYuOLOYLunrPscE79JxU%3D&reserved=0>.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages