Skip to content

Conversation

marchdf
Copy link
Contributor

@marchdf marchdf commented Jul 11, 2025

but don't actually let anyone use it because there are issues I think in amrex EB routines (redistribution) that I haven't fully investigated. But hydro MOL works. And this doesn't do EB diffusion either. But it's a step in the right direction.

@marchdf marchdf requested a review from baperry2 July 11, 2025 19:20
@marchdf marchdf changed the title Enable MOL anisotropic EB Enable hydro MOL anisotropic EB Jul 11, 2025
@marchdf marchdf changed the title Enable hydro MOL anisotropic EB Generify hydro MOL for anisotropic EB Jul 11, 2025
@marchdf
Copy link
Contributor Author

marchdf commented Jul 11, 2025

This is C7 with dx = dy/2

velocity

Screenshot 2025-07-11 at 1 22 35 PM

density

Screenshot 2025-07-11 at 1 22 49 PM

pressure

Screenshot 2025-07-11 at 1 24 55 PM

The part that bugs me a bit is the density profile is not quite normal to the wall everywhere. I am not sure if that's a bug in Pele or in amrex. Right now my money is on the redistribute routines. Or maybe it's all fine and it's just what happens with anisotropic EB. But I have to move to something else for now.

Copy link
Contributor

@baperry2 baperry2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the diffs look like they are EB cases that have machine precision changes, which is reasonable to me. But the sod-4 case has bigger diffs. I believe this case tests coarse/fine crossing the EB. I am not sure why that would be affected, but I don't think we should merge this without understanding those diffs.

amrex::Abort(
"dx != dy != dz not supported with pc_fill_bndry_grad_stencil_quadratic");
}
const amrex::Real area = std::pow(dx[0], AMREX_SPACEDIM - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these still dx[0] - maybe they should be dx_max instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't dealt with the grad stencils so I left them as they were. I just changed the call signature to take in the dx array, so that I can change it later. Basically making it more explicit where things will need to change.

@marchdf
Copy link
Contributor Author

marchdf commented Jul 15, 2025

Tracked the sod-4 diff down to the removal of these:

      const amrex::Real ebnorm_mag = std::sqrt(AMREX_D_TERM(
        ebnorm[0] * ebnorm[0], +ebnorm[1] * ebnorm[1], +ebnorm[2] * ebnorm[2]));
      for (amrex::Real& dir : ebnorm) {
        dir /= ebnorm_mag;
      }

which is a silly bit of code because ebnorm is already normalized when it is created. So it is being normalized twice. The hypothesis is that removing this and the use of ebnorm_local introduces small machine diffs that mess with the fluxes just enough that we get higher diffs in sod-4.

We debated and went with the option that removes this extra normalization. The case itself runs fine and to completion:
Screenshot 2025-07-15 at 10 07 29 AM

@marchdf marchdf merged commit c443486 into development Jul 15, 2025
13 of 15 checks passed
@marchdf marchdf deleted the clean-eb-dx branch July 15, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants