| 6 | #include <bout/physicsmodel.hxx> |
| 7 | |
| 8 | class Conduction : public PhysicsModel { |
| 9 | private: |
| 10 | Field3D T; // Evolving temperature equation only |
| 11 | |
| 12 | BoutReal chi; // Parallel conduction coefficient |
| 13 | |
| 14 | protected: |
| 15 | // This is called once at the start |
| 16 | int init(bool UNUSED(restarting)) override { |
| 17 | |
| 18 | // Get the options |
| 19 | auto& options = Options::root()["conduction"]; |
| 20 | |
| 21 | // Read from BOUT.inp, setting default to 1.0 |
| 22 | // The doc() provides some documentation in BOUT.settings |
| 23 | chi = options["chi"].doc("Conduction coefficient").withDefault(1.0); |
| 24 | |
| 25 | // Tell BOUT++ to solve T |
| 26 | SOLVE_FOR(T); |
| 27 | |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | int rhs(BoutReal UNUSED(time)) override { |
| 32 | mesh->communicate(T); // Communicate guard cells |
| 33 | |
| 34 | ddt(T) = |
| 35 | Div_par_K_Grad_par(chi, T); // Parallel diffusion Div_{||}( chi * Grad_{||}(T) ) |
| 36 | |
| 37 | return 0; |
| 38 | } |
| 39 | }; |
| 40 | |
| 41 | BOUTMAIN(Conduction); |
nothing calls this directly
no outgoing calls
no test coverage detected