Open sbryngelson opened 1 year ago
@sbryngelson How do you want to handle the cases that will require hardcoding analytic initial conditions?
@wilfonba for cases with analytic functions, I think we should add some functionality to make this possible without commenting/uncommenting source code. I'm open to suggestions. Some example possibilities are
What do you think of having the user supply an additional input file with fypp functions that can be included in m_patches.f90
?
I'm not sure I understand, I would have to see a small example I think.
I'll put something together
@wilfonba I’d be happy to discuss possible toolchain implementations.
@wilfonba What if, in the case.py
file you could have something like
'patch_icpp(1)%geometry': 15,
'patch_icpp(1)%pres': '5*x',
'patch_icpp(1)%vel(1)': = '10*sin(2*x**2)',
...
and then in m_patches.fpp
or perhaps in m_assign_variables.fpp
you would have something that copies/pastes these strings ('5*x'
and '10*sin(2*x**2)'
) into a function that assigns the analytic values depending on the value of x_cc
or x_cb
or y_
or z_
. Something analogous would be done for 2D/3D so you could also have
'patch_icpp(1)%geometry': 7,
'patch_icpp(1)%pres': '5*x*y',
'patch_icpp(1)%vel(1)': '10*y*sin(2*x**2)',
'patch_icpp(1)%vel(2)': '10*x*sin(2*y**2)',
...
for example, in 2D (note that 15
and 7
are the patch numbers associated with 1D and 2D analytical right now). All such analytic string expressions would have to be in Fortran syntax.
I think something like this would actually work really nicely and cleanly, and actually shouldn't require any toolchain changes (or only very small ones). It would require using fypp in pre_process
, and a new macro to parse those analytic expressions into the Fortran code. @henryleberre can easily help with those parts easily.
This would actually be quite the improvement to the code, since we could remove all hard-coded analytic functions and basically never need to do that again!
That was the first idea that had come to mind for me as well, but I didn't think to parse the strings in Python rather than in Fortran and some googling suggested doing so in Fortran is rather difficult. I'm sure there's a python package somewhere that takes care of that already though, so I'll do it that way. It is the cleanest.
So I think we don't want to parse the strings in Python at all (I may well stand corrected later).
Instead, we want to use fypp to copy-paste the Python strings into the Fortran code as raw code and do a fypp-powered substitution (like x -> x_cb(i)
, y -> y_cb(j)
) so that you can loop through x/y/z space appropriately.
Ah, I see what you mean now. That makes sense.
Ah, I see what you mean now. That makes sense.
I would like this printed and framed 😄
Updated the issue in light of #176
Riemann problem taken care of in #256
@sbryngelson the 2D single-material triple point problem here (https://arxiv.org/abs/2312.17042) might be worth adding to this.
Simulate and add several new examples/test cases to the
examples/
directory:I will accept PRs that add these individually (they do not have to be added all at once). Please add small (in terms of MB) visualization images of the results to the
example/
directory.I will also accept additions to this list, particularly problems in 3D or multiphase 2D problems.
Update: More problems!
Can find refs in doi:10.1016/j.cpc.2024.109236
Original:
[x] Shu-Osher problem (1D):
[x] Lax shock tube problem (1D):
[x] Titarev-Toro problem (1D):
[x] Riemann test problem (2D):
[x] Rayleigh-Taylor instability (2D):
[x] Lid-driven compressible cavity (2D), finite Reynolds number:
[ ] Double-Mach reflection (2D):
[ ] Kelvin-Helmholtz instability (2D):
[ ] Viscous shock tube (2D):
[ ] Double periodic shear layer (2D):
[ ] 2D single-material triple point problem here
[ ] Shock-cylinder interaction (2D):
[ ] Viscous Richtmeyer-Meshkov instability (2D):
[ ] Underwater explosion (2D):
[ ] Compressible decaying isotropic turbulence (2D and 3D!):
[ ] Spherical underwater explosion in a rigid cylindrical container (3D)
[ ] Liquid jet in crossflow (3D)
[ ] Jet-spray [SprayAB] (3D)