New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Entropy Variables to libCEED fluids NS mini-app #1110
base: main
Are you sure you want to change the base?
Conversation
6130183
to
84a92b7
Compare
Huh, turns out that waiting 7 months and rebasing can sometimes fix issues... I'm no longer seeing strange artifacts with I will add some tests, but I think this MR actually may be pretty much ready. |
4be3dd5
to
badc2d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, particularly regarding the naming of the components. Otherwise looks good to me.
CeedScalar velocity[3]; | ||
CeedScalar temperature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have more specific names for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. Jed's suggestion in the past was to go the opposite route, and just name them V1
, V2
, V3
or something like that. I'm starting to think that might be best, since I don't know how to name them otherwise.
e.g.
- The quantity I'm currently calling
temperature
is$-\frac{\rho}{P}$ , which has units$\frac{kg}{J}$ or$\frac{s^2}{m^2}$ . - The quantity I'm calling
velocity
is$\mathbf{U}\cdot\frac{\rho}{P}$ , which has units$\frac{s}{m}$ .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the units for V1
are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jedbrown should I use similar naming for the state components? E.g.
typedef struct {
CeedScalar S_density;
CeedScalar S_momentum[3];
CeedScalar S_energy;
} StateEntropy;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 Consistency is good so if we're going to name them, may as well make them match. I'm not sure it's easier in the code.
BTW, did you do anything here that may impact performance of the primitive or conservative variable code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minorly, yes. The StateFrom*
functions now also compute the entropy variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that necessary? We added both conservative and primitive to avoid recomputing the equation of state each time that quantity is needed in fluxes, but I don't think entropy variables are used that way so we could probably remove the V
member from State
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would we use entropy variables then? We use StateFromQ
and StateFromQ_fwd
all over the place, and that relies on the given state variables to be in State
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary? State
is just our internal representation. We can import entropy variables to that representation without making it part of State
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that I understand what you mean by "import entropy variables to that representation without making it part of State
".
Tangentially, one of the major uses for entropy variables is in making the fluxes symmetric, which while not implemented here, would justify storing V
in State
.
Improve variable names in docs Co-authored-by: James Wright <james@jameswright.xyz>
c7d1d5f
to
772a643
Compare
This PR introduces physical entropy variables to libCEED fluids (see Hughes et al for full formulation). Support for entropy variables mirrors that of primitive and conservative variables, with conversion and forward physics functions.
Also adds additional unit tests for variable conversion.