AMReX-Combustion / PeleLMeX

An adaptive mesh hydrodynamics simulation code for low Mach number reacting flows without level sub-cycling.
https://amrex-combustion.github.io/PeleLMeX/
BSD 3-Clause "New" or "Revised" License
24 stars 32 forks source link

Rough walls #229

Closed czc-zju closed 10 months ago

czc-zju commented 11 months ago

In PeleLM/PeleLMex, can the walls in the figure be modeled and meshed? Or can this wall be embedded? This wall is built based on the expression: f=cos(2pai x)*cos(2pai z), pai =3.14. 1a72b8f9b83a95b7dee309682159715

baperry2 commented 11 months ago

Background: Embedded boundary geometry definition in PeleLMeX comes from AMReX. For very simple geometries like spheres or planes, the geometry may be specified directly in the input file using the eb2 prefix (see the EB_BackwardStepFlame tutorial for an example). You can look at the AMReX source code amrex/Src/EB/AMReX_EB2.cpp for the full list of shapes and corresponding input file parameters that can be defined in this way. More complex shapes may be defined by specifying an EBUserDefined function in a problem-specific EBUserDefined.H (see the ChallengeProblem Case for an example). In this function, you can take various shapes defined in AMReX and combine them and/or apply different transformations. See the AMReX documentation for more details.

Answer: I do not believe that sinusoids are currently possible by default with either approach for specifying the EB geometry described above. However, I don't think it would be too difficult for you to add a class to give this capability, taking amrex/Src/EB/AMReX_IF_Plane.H as an example. You basically just need to define a function of (x,y,z) that is positive in the solid, negative within the fluid, and zero on the surface, which would be pretty easy for your geometry. If you do that, there shouldn't be any issues with simulating the rough channel case, provided you use enough resolution to capture the scale of the roughness.

czc-zju commented 11 months ago

Thank you very much for your suggestions. I have made some attempts in the past few days, but I encountered some problems. Whenever I try to use PeleLMex for calculations, I always get an error. I'm not sure what went wrong. Here are the configuration files for PeleLMex and the EB_plane file: PeleLMex Settings File: pelelmex.zip AMReX_EB2_IF_Parser.H: image

I have also tried using peleC, and it works fine. However, the velocity at the embedded body surface should be zero, but it's not in my case. I suspect there might still be some issues. Here are the results: image image

baperry2 commented 10 months ago

Can you give some more details on the error you are seeing when you try this in pelelmex?

czc-zju commented 10 months ago

image

baperry2 commented 10 months ago

You are likely using insufficient resolution to adequately resolve the roughness features. There should not be multiple EB surfaces cutting through any grid cell. Double check the function you are using to specify the surface and make sure the wavelength of the roughness elements is much larger than your grid spacing. I'd recommend that you start out by using a very large wavelength and low amplitude. I wouldn't be surprised if adding a slight phase shift could also be useful in avoiding this error.

You could also experiment with the eb2.cover_multiple_cuts input file flag from AMReX, though I'm not familiar at all with what that functionality does or if it could help.

I'm going to move this conversation to a discussion because it's not about existing capability in PeleLMeX.