@@ -307,6 +307,10 @@ int Hermes::init(bool restarting) {
307307 poloidal_flows = optsc[" poloidal_flows" ]
308308 .doc (" Include ExB flows in X-Y plane" )
309309 .withDefault (true );
310+
311+ revCurlb_B = optsc[" revCurlb_B" ]
312+ .doc (" Reverse the direction of Curl(b/B)" )
313+ .withDefault (true );
310314
311315 OPTION (optsc, ion_velocity, true );
312316
@@ -522,6 +526,12 @@ int Hermes::init(bool restarting) {
522526 // Inflowing density carries momentum
523527 OPTION (optne, density_inflow, false );
524528
529+ auto & optpe = opt[" Pe" ];
530+ PeSource = optpe[" source" ].withDefault (Field3D{0.0 });
531+
532+ auto & optpi = opt[" Pi" ];
533+ PiSource = optpi[" source" ].withDefault (Field3D{0.0 });
534+
525535 // radial buffer setup
526536 if (slab_radial_buffers || radial_buffers) {
527537 // Need to set the sources in the radial buffer regions to zero
@@ -585,13 +595,13 @@ int Hermes::init(bool restarting) {
585595 NeSource /= Omega_ci;
586596 Sn = DC (NeSource);
587597
588- auto & optpe = opt[" Pe" ];
589- PeSource = optpe[" source" ].withDefault (Field3D{0.0 });
598+ // auto& optpe = opt["Pe"];
599+ // PeSource = optpe["source"].withDefault(Field3D{0.0});
590600 PeSource /= Omega_ci;
591601 Spe = DC (PeSource);
592602
593- auto & optpi = opt[" Pi" ];
594- PiSource = optpi[" source" ].withDefault (Field3D{0.0 });
603+ // auto& optpi = opt["Pi"];
604+ // PiSource = optpi["source"].withDefault(Field3D{0.0});
595605 PiSource /= Omega_ci;
596606 Spi = DC (PiSource);
597607
@@ -603,7 +613,7 @@ int Hermes::init(bool restarting) {
603613 for (int y = mesh->ystart ; y <= mesh->yend ; y++) {
604614 Sn (x, y) = 0.0 ;
605615 Spe (x, y) = 0.0 ;
606- Spi (x, y) = 0.0 ;
616+ Spi (x, y) = 0.0 ;
607617 }
608618 }
609619 }
@@ -907,6 +917,10 @@ int Hermes::init(bool restarting) {
907917 }
908918 }
909919 }
920+
921+ if (revCurlb_B) {
922+ Curlb_B = -1.0 * Curlb_B
923+ }
910924
911925 if (Options::root ()[" mesh" ][" paralleltransform" ].as <std::string>() == " shifted" ) {
912926 // Check if the gridfile was created for "shiftedmetric" or for "identity" parallel
0 commit comments