Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The BASIC CODE STRUCTURE of the Right hand side #23

Open
Philipp137 opened this issue Sep 10, 2018 · 0 comments
Open

The BASIC CODE STRUCTURE of the Right hand side #23

Philipp137 opened this issue Sep 10, 2018 · 0 comments
Assignees
Labels
for the newcomers Stuff to read before starting to program in WABBIT

Comments

@Philipp137
Copy link
Member

Philipp137 commented Sep 10, 2018

The major structure in a nutshell:

  • a physics module goes in its own folder (EQUATION/MYPHYSMODEL/).
  • All its internal routines are PRIVATE and cannot be
    seen from wabbit. Only a handful of interface routines are made PUBLIC
    with an explicit statement. The parameter struct is a
    module global (and of course not visible in wabbit).

Every module has at least the following PUBLIC routines:

READ_PARAMETERS_MYPHYSMODEL -- main level wrapper routine to read parameters in
the physics module. It reads from the same ini-file as wabbit what it
needs to know. caled only once. note in physics modules the parameter
struct for wabbit is not available.

PREPARE_SAVE_DATA_MYPHYSMODEL -- save data. Since you might want to save
derived data, such as the vorticity, the divergence etc., which are not
in your state vector, this routine has to copy and compute what you want
to save to the work array. In the main code, save_fields than saves the
first N_fields_saved components of the work array to file.

FIELD_NAMES_MYPHYSMODEL -- the main routine save_fields has to know how you
label the stuff you want to store from the work array, and this routine
returns those strings

RHS_MYPHYSMODEL -- main RHS. it must be valid for all dimensions (2d/3d). The
idea is that the physics modules are not aware of the GRID. that's for
wabbit. physics modules see only blocks. that's their deal. Now, it is
possible for the RHS to depend on global stuff, such as integrals, for
example for forcing terms. therefore, I suggest a staging concept for
the RHS calls, see RHS_wrapper.f90 and the new module. RHS's that do not
require such integrals can just skip the steps internally.

GET_DT_BLOCK_MYPHYSMODEL -- returns the dt for a block. wabbit selects the
smallest dt of all blocks.

INICOND_MYPHYSMODEL -- sets on one block the initial condition.

All additional routines accessible from WABBIT can be found in module_physics_metamodule

@Philipp137 Philipp137 added the for the newcomers Stuff to read before starting to program in WABBIT label Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for the newcomers Stuff to read before starting to program in WABBIT
Projects
None yet
Development

No branches or pull requests

2 participants