adaptive-cfd / WABBIT

Wavelet Adaptive Block-Based solver for Interactions with Turbulence
https://www.cfd.tu-berlin.de/
GNU General Public License v3.0
56 stars 27 forks source link

The BASIC CODE STRUCTURE of the Right hand side #23

Open Philipp137 opened 6 years ago

Philipp137 commented 6 years ago

The major structure in a nutshell:

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