Replies: 3 comments
-
Just add: the above code snippet occurs in |
Beta Was this translation helpful? Give feedback.
-
I'm not the best person to give advice on the specific questions being asked, but I have a couple comments on overall strategy. I'd expect the aux quantities you are looking at to be non-stiff, and also with them being passive, stiff integration with CVODE using an analytical Jacobian may be overkill. Another option would be to treat the source terms as external sources as we do with source terms from the soot and spray modules. See #427 for examples of this with non-transported auxiliary quantities. This strategy is decoupled from the SDC iterations (#429) and essentially amounts to forward Euler integration of the sources, so it definitely isn't applicable for everything, but probably would be fine for mixture fraction (no source) and residence time (constant source term). Also keep any eye out for #467 which will provide an improved framework for supporting auxiliary scalars. |
Beta Was this translation helpful? Give feedback.
-
Thanks Bruce. The passive scalar we want to add does introduce some stiffness, and we found that implicit CVODE can help to solve this issue. I will also keep an eye on the threads you recommended. |
Beta Was this translation helpful? Give feedback.
-
Dear community,
I'm implementing the transport equation of auxiliary variables, such as residence times (or age variable) and post-flame residence times (hereafter referred to
aux
) in PeleLMeX. These variables can be considered as passive scalars and do not affect the evolution of variablesstate[0:NVAR]
originally transported in PeleLMeX.Our implementation of the residence times worked pretty well on CPU. Specifically, a second CVODE solver was initialized and used to advance the$T$ , $aux$ ], is that we found the addition of

aux
variables, with the correspondingcF_RHS_aux
andcJac_aux
added. The interface and implementation ofutils::flatten
andùtils::unflatten
are also changed accordingly. The reason we added a second CVODE, instead of using the the original CVODE for the prolonged ODE vector [$\rho Y_K$,aux
variables may change the original solution, possibly due to the addition of Jacobian ofaux
fields (here we use denseAJ_direct withReactorCvode
with analytical Jacobian).Below is the transport of mixture fraction of the cross flow, residence time and post-flame residence time in a H2 JICF. These variables are added following the spirit of SDC. We also did some tests in other manufactured cases, the results agree well with some available analytical solutions.
Our problem is the GPU. We now face some issues when implementing the same equation with MAGMA on AMD HIP GPU (we need to burn through some GPU resources). An error occurs when using
SUNLinSol_MagmaDense
to set the linear solver of CVODE named asLS_aux
. Here is how we did on GPU:Similar to what we have done for CPU, a second
initCvode_aux
,cvode::cJac_aux
,cF_RHS_aux
andfKernelAJCHem
are added for GPU. On the other hand in the GPU region ofReactorCvode::react(...)
, we first declareThe ODE vector for
aux
is then declared asAfter
flatten(box, ncells...)
, we initialized the CVODE components as follows.The error occurs as
SUNDIALS_ERROR: SUNLinSol_MagmaDense() failed - returned NULL pointer
which means SUNLinSol_MagmaDense return a null pointer and didn't initliaze
y_aux
properly.I want to ask:
SUNLinSol_MagmaDense
?stream
is used inutils::setNVectorGPU
. I don't understand how thestream
works in amrex and Pele*. Sorry I looked into the online amrex doc and the past publication but I still didn't grasp the gist. Also The sundials document gives very limited introduction onN_VSetKernelExecPolicy_Hip
related topics. Can you help to give me some reading direction, like howamrex::gpuStream
is used in PeleLMeX?stream
inReactorCvode::react(..., stream)
?stream
for both CVODE solvers (original and auxiliaray fields)?Any comments are greatly welcomed.
thanks
Zisen
Beta Was this translation helpful? Give feedback.
All reactions