Generalize droplet mixture calculations#613
Generalize droplet mixture calculations#613baperry2 merged 14 commits intoAMReX-Combustion:developmentfrom
Conversation
|
Can you explain what's going on with the different versions of each function with and without Also, maybe we should be adding some documentation for the liqProps stuff now, before a documentation debt builds up too much. |
The idea behind the overloaded functions was a result of some mixture density calls that used a single droplet temp like this one, while many others used a limited component-specific temperature
Everything we've done so far has been organizational and hasn't changed how the spray module is called from LMeX or C. I can add a brief overview of the liquid property functions used for the PeleMP method if you'd like. |
|
I updated all the mixture functions to include a |
|
The RealArrayLike templates are designed to work for any data type that returns amrex::Real from the [] operator. Should we be more explicit about this requirement in the code? One strategy would to be to create a helper struct: And then in each template include a static assert: This has no effect on code behavior or what can compile, but makes expectations more explicit/might increase readability of the code. But it also adds significant verbosity and can potentially add confusion rather than reduce it if the reader isn't as familiar with C++. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors droplet mixture calculations by creating dedicated mixture property functions within the MPLiqProps struct. It generalizes the calculation of various thermophysical properties for liquid fuel mixtures in spray simulations, improving code reusability and maintainability.
- Adds new mixture property functions for boiling point, critical temperature, specific heat, thermal conductivity, dynamic viscosity, and surface tension
- Removes parameter reference indicators (
&) from function signatures to simplify the interface - Refactors existing code to use the new mixture functions instead of manual loop-based calculations
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Spray/SprayProperties.H | Adds new mixture property functions and removes reference parameters from existing functions |
| Source/Spray/Drag.H | Replaces manual mixture calculations with new mixture property functions |
| Source/Spray/BreakupSplash/WallFilm.H | Refactors to use mixture property functions for film calculations |
| Source/Spray/BreakupSplash/TABBreakup.H | Updates breakup calculations to use mixture functions |
| Source/Spray/BreakupSplash/ReitzKHRT.H | Modernizes breakup model to use mixture property functions |
| Source/Spray/BreakupSplash/AhamedSplash.H | Updates splashing model to use mixture functions |
| Docs/sphinx/Spray.rst | Reorganizes documentation and adds dedicated section for liquid spray properties |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Source/Spray/SprayProperties.H
Outdated
| // Helper function to get effective temperature considering boiling point | ||
| template <typename cBoilTLike> | ||
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real effectiveT( | ||
| const amrex::Real& T, const int spf, const cBoilTLike& cBoilT) const |
There was a problem hiding this comment.
I don't like the template typename "cBoilTLike" - the reader probably has no idea what that means and it's redundant with the variable name. cBoilT just has to be RealArrayLike as defined here - it could be a GpuArray of amrex::Real, a pointer to amrex::Real, or in principal even something else like amrex::CellData.
I'm also not wild about this helper function in general because it doesn't actually simplify the code, but I'm fine with leaving it in if you think it makes the intent of the code more clear.
There was a problem hiding this comment.
That's fair. I removed the helper function and replaced cBoilTLike with RealArrayLike2 per your previous implementation idea.
This PR creates mixture property functions within the MPLiqProps struct for the following:
boilT_mixcritT_mixcp_mixlambda_mixmu_mixsigma_mixNote that
rho_mixwas included in #602. Managing the mixture averaged molecular weight of the spray is still a work in progress and not included here.