MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / Conduction

Class Conduction

examples/conduction/conduction.cxx:8–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <bout/physicsmodel.hxx>
7
8class Conduction : public PhysicsModel {
9private:
10 Field3D T; // Evolving temperature equation only
11
12 BoutReal chi; // Parallel conduction coefficient
13
14protected:
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
41BOUTMAIN(Conduction);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected