@@ -47,13 +47,15 @@ void IonNeutral::AssembleIonNeutralTasks(
47
47
id.i_sendf = tl[" stagen" ]->AddTask (&MHD::SendFlux, pmhd, id.i_flux );
48
48
id.i_recvf = tl[" stagen" ]->AddTask (&MHD::RecvFlux, pmhd, id.i_sendf );
49
49
id.i_rkupdt = tl[" stagen" ]->AddTask (&MHD::RKUpdate, pmhd, id.i_recvf );
50
+ id.i_srctrms = tl[" stagen" ]->AddTask (&MHD::MHDSrcTerms, pmhd, id.i_rkupdt );
50
51
51
- id.n_flux = tl[" stagen" ]->AddTask (&Hydro::Fluxes, phyd, id.i_rkupdt );
52
+ id.n_flux = tl[" stagen" ]->AddTask (&Hydro::Fluxes, phyd, id.i_srctrms );
52
53
id.n_sendf = tl[" stagen" ]->AddTask (&Hydro::SendFlux, phyd, id.n_flux );
53
54
id.n_recvf = tl[" stagen" ]->AddTask (&Hydro::RecvFlux, phyd, id.n_sendf );
54
55
id.n_rkupdt = tl[" stagen" ]->AddTask (&Hydro::RKUpdate, phyd, id.n_recvf );
56
+ id.n_srctrms = tl[" stagen" ]->AddTask (&Hydro::HydroSrcTerms, phyd, id.n_rkupdt );
55
57
56
- id.impl = tl[" stagen" ]->AddTask (&IonNeutral::ImpRKUpdate, this , id.n_rkupdt );
58
+ id.impl = tl[" stagen" ]->AddTask (&IonNeutral::ImpRKUpdate, this , id.n_srctrms );
57
59
id.i_restu = tl[" stagen" ]->AddTask (&MHD::RestrictU, pmhd, id.impl );
58
60
id.n_restu = tl[" stagen" ]->AddTask (&Hydro::RestrictU, phyd, id.i_restu );
59
61
@@ -185,9 +187,24 @@ TaskStatus IonNeutral::ImpRKUpdate(Driver *pdriver, int estage) {
185
187
// equations for ion-neutral drag.
186
188
// Only required for istage = (1,2,3,[4])
187
189
if (estage < pdriver->nexp_stages ) {
188
- Real gamma_adt = drag_coeff*(pdriver->a_impl )*(pmy_pack->pmesh ->dt );
189
- Real xi_adt = ionization_coeff*(pdriver->a_impl )*(pmy_pack->pmesh ->dt );
190
- Real alpha_adt = recombination_coeff*(pdriver->a_impl )*(pmy_pack->pmesh ->dt );
190
+ Real gamma_adt;
191
+ Real xi_adt;
192
+ Real alpha_adt;
193
+
194
+ // Condition to set gamma_adt, xi_adt, and alpha_adt to zero
195
+ if (istage < 3 && pdriver->integrator == " imex2+" ) {
196
+ gamma_adt = 0.0 ;
197
+ xi_adt = 0.0 ;
198
+ alpha_adt = 0.0 ;
199
+ } else {
200
+ gamma_adt = drag_coeff * (pdriver->a_impl ) * (pmy_pack->pmesh ->dt );
201
+ xi_adt = ionization_coeff * (pdriver->a_impl ) * (pmy_pack->pmesh ->dt );
202
+ alpha_adt = recombination_coeff * (pdriver->a_impl ) * (pmy_pack->pmesh ->dt );
203
+ }
204
+
205
+ // Real gamma_adt = drag_coeff*(pdriver->a_impl)*(pmy_pack->pmesh->dt);
206
+ // Real xi_adt = ionization_coeff*(pdriver->a_impl)*(pmy_pack->pmesh->dt);
207
+ // Real alpha_adt = recombination_coeff*(pdriver->a_impl)*(pmy_pack->pmesh->dt)
191
208
auto ui = pmhd->u0 ;
192
209
auto un = phyd->u0 ;
193
210
par_for (" imex_imp" ,DevExeSpace (),0 ,nmb1,0 ,(n3-1 ),0 ,(n2-1 ),0 ,(n1-1 ),
0 commit comments