Fix auxiliary scalars with AMR#4
Merged
ThomasHowarth merged 3 commits intoITV-RWTH:tlh_passivefrom Mar 31, 2025
Merged
Conversation
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.
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to:
schmidt < 0for a given scalar. A separate input variablediffusewas 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.
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

max_level = 2

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