Skip to content

Fix auxiliary scalars with AMR#4

Merged
ThomasHowarth merged 3 commits intoITV-RWTH:tlh_passivefrom
bssoriano:fix_aux
Mar 31, 2025
Merged

Fix auxiliary scalars with AMR#4
ThomasHowarth merged 3 commits intoITV-RWTH:tlh_passivefrom
bssoriano:fix_aux

Conversation

@bssoriano
Copy link
Copy Markdown

This PR is to:

  • fix the issues related auxiliary variables not being initialized correctly when AMR is present in an inflow BC.
  • include the option for unity Lewis number. The Le=1 formulation is selected when schmidt < 0 for a given scalar. A separate input variable diffuse was added to turn off diffusion.

The issue with the auxiliary scalar was observed when AMR was added at the inflow BC. The code was returning "erroneous operation" for max_level = 2, and had non-physical values when max_level = 1. The first figure below shows the temperature contours for a jet issued from the inlet boundary at xlo and the boxes for level 1 at the boundary. An auxiliary scalar 'mixfrac' with inflow value equal to unity was added. This is a 3D case. The second figure clearly shows the non-physical behavior for the mixfrac field with very large values.

plt00149_Slice_y_temp
plt00149_Slice_y_mixfrac

The problem was mostly related to the regrid step and the fill patch for the auxiliary variables. The figure below shows the results produced with the code in this PR.

max_level = 1
plt00149_Slice_y_mixfrac

max_level = 2
plt00201_Slice_y_mixfrac

The unity Le number implementation was also verified for the same test case that @ThomasHowarth used to test his implementation. The figure below shows the comparison between temperature, Le=1 and Sc=100 for data extracted from the domain centerline.

image

The implementation was also tested for the same jet case presented previously with max_level = 2. There are some small differences between the auxiliary mixfrac field and temperature because temperature is not conserved and Cp is a function of T. Ideally the comparison should have been done with enthalpy. However, mixfrac and T match exactly when Cp=constant.

image

Added separate flag to turn off diffusion
Le=1 is used when schmidt < 0. Future implementation could have the user specify the Le number for each transported variable
The code returning erroneous operation when AMR was at the inflow BC for max_level = 2, and had non-physical values when max_level = 1. The problem was related to regrid.
@ThomasHowarth
Copy link
Copy Markdown

Thanks for this @bssoriano ! I knew I was missing a fillpatch somewhere... there are a couple of things I want to tweak and test, but I'll merge this and do some testing.

@ThomasHowarth ThomasHowarth merged commit 5400223 into ITV-RWTH:tlh_passive Mar 31, 2025
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