@@ -31,7 +31,19 @@ NeutralMixed::NeutralMixed(const std::string& name, Options& alloptions, Solver*
31
31
// Evolving variables e.g name is "h" or "h+"
32
32
solver->add (Nn, std::string (" N" ) + name);
33
33
solver->add (Pn, std::string (" P" ) + name);
34
- solver->add (NVn, std::string (" NV" ) + name);
34
+
35
+
36
+ evolve_momentum = options[" evolve_momentum" ]
37
+ .doc (" Evolve parallel neutral momentum?" )
38
+ .withDefault <bool >(true );
39
+
40
+ if (evolve_momentum) {
41
+ solver->add (NVn, std::string (" NV" ) + name);
42
+ } else {
43
+ output_warn.write (" WARNING: Not evolving neutral parallel momentum. NVn and Vn set to zero\n " );
44
+ NVn = 0.0 ;
45
+ Vn = 0.0 ;
46
+ }
35
47
36
48
sheath_ydown = options[" sheath_ydown" ]
37
49
.doc (" Enable wall boundary conditions at ydown" )
@@ -328,35 +340,42 @@ void NeutralMixed::finally(const Options& state) {
328
340
}
329
341
ddt (Nn) += Sn; // Always add density_source
330
342
331
- // ///////////////////////////////////////////////////
332
- // Neutral momentum
333
- TRACE (" Neutral momentum" );
343
+ if (evolve_momentum) {
334
344
335
- ddt (NVn) =
336
- -AA * FV::Div_par_fvv<hermes::Limiter>(Nnlim, Vn, sound_speed) // Momentum flow
337
- - Grad_par (Pn) // Pressure gradient
338
- + FV::Div_a_Grad_perp (DnnNVn, logPnlim) // Perpendicular diffusion
339
- ;
345
+ // ///////////////////////////////////////////////////
346
+ // Neutral momentum
347
+ TRACE (" Neutral momentum" );
340
348
341
- if (neutral_viscosity) {
342
- // NOTE: The following viscosity terms are are not (yet) balanced
343
- // by a viscous heating term
349
+ ddt (NVn) =
350
+ -AA * FV::Div_par_fvv<hermes::Limiter>(Nnlim, Vn, sound_speed) // Momentum flow
351
+ - Grad_par (Pn) // Pressure gradient
352
+ + FV::Div_a_Grad_perp (DnnNVn, logPnlim) // Perpendicular diffusion
353
+ ;
344
354
345
- // Relationship between heat conduction and viscosity for neutral
346
- // gas Chapman, Cowling "The Mathematical Theory of Non-Uniform
347
- // Gases", CUP 1952 Ferziger, Kaper "Mathematical Theory of
348
- // Transport Processes in Gases", 1972
349
- // eta_n = (2. / 5) * kappa_n;
350
- //
355
+ if (neutral_viscosity) {
356
+ // NOTE: The following viscosity terms are are not (yet) balanced
357
+ // by a viscous heating term
351
358
352
- ddt (NVn) += AA * FV::Div_a_Grad_perp ((2 . / 5 ) * DnnNn, Vn) // Perpendicular viscosity
353
- + AA * FV::Div_par_K_Grad_par ((2 . / 5 ) * DnnNn, Vn) // Parallel viscosity
354
- ;
355
- }
359
+ // Relationship between heat conduction and viscosity for neutral
360
+ // gas Chapman, Cowling "The Mathematical Theory of Non-Uniform
361
+ // Gases", CUP 1952 Ferziger, Kaper "Mathematical Theory of
362
+ // Transport Processes in Gases", 1972
363
+ // eta_n = (2. / 5) * kappa_n;
364
+ //
365
+
366
+ ddt (NVn) += AA * FV::Div_a_Grad_perp ((2 . / 5 ) * DnnNn, Vn) // Perpendicular viscosity
367
+ + AA * FV::Div_par_K_Grad_par ((2 . / 5 ) * DnnNn, Vn) // Parallel viscosity
368
+ ;
369
+ }
356
370
357
- if (localstate.isSet (" momentum_source" )) {
358
- Snv = get<Field3D>(localstate[" momentum_source" ]);
359
- ddt (NVn) += Snv;
371
+ if (localstate.isSet (" momentum_source" )) {
372
+ Snv = get<Field3D>(localstate[" momentum_source" ]);
373
+ ddt (NVn) += Snv;
374
+ }
375
+
376
+ } else {
377
+ ddt (NVn) = 0 ;
378
+ Snv = 0 ;
360
379
}
361
380
362
381
// ///////////////////////////////////////////////////
@@ -533,6 +552,8 @@ void NeutralMixed::precon(const Options& state, BoutReal gamma) {
533
552
inv->setCoefD (coef);
534
553
535
554
ddt (Nn) = inv->solve (ddt (Nn));
536
- ddt (NVn) = inv->solve (ddt (NVn));
555
+ if (evolve_momentum) {
556
+ ddt (NVn) = inv->solve (ddt (NVn));
557
+ }
537
558
ddt (Pn) = inv->solve (ddt (Pn));
538
559
}
0 commit comments