How to adding a new "state" variable in PeleC? #933
-
Hello everyone, In the However, after the modification, the case that previously ran successfully now encounters CVODE errors: Is there something wrong with my method of adding a new 'state' variable? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To add a new state variable, the easiest way is to use the existing ADV (advected) and AUX (not advected) capabilities. In your See With what you are doing, you are likely misaligning the indices expected in the state vector, which will cause lots of issues. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answers here. I finally got what I wanted working! |
Beta Was this translation helpful? Give feedback.
To add a new state variable, the easiest way is to use the existing ADV (advected) and AUX (not advected) capabilities. In your
GNUmakefile
, setPELE_NUM_ADV
orPELE_NUM_AUX
to the number of new variables you would like. You can provide names for these variables by defining a customProblemSpecificFunctions::set_adv_names
function in yourprob.H
. Then it's up to you to provide appropriate initial conditions for these components of the state vector inpc_initdata
, user-defined boundary conditions if needed inbcnormal
, and user-defined source terms if desired inProblemSpecificFunctions::problem_modify_ext_sources
.See
Exec/RegTests/AuxQuantities
for an example.With what you are doing, yo…