Nueral Network boosted Moment of Fluid
The code need several run-time libraries:
- HDF5
- hypre
- Two external MOF libraries (Use to compare with my algorithm)
When you work with UNIX based OS, for example, Ubuntu/Linux Mint,
with gcc, gfortran, mpich/openmpi installed from apt-get,
you should be able to build the essential run-time libraries by
bash libs-install.shAll libraries are located in libs directory.
You may compile your own hdf5 and hypre,
and manually compile two external MOF libraries in libs directory.
It is important to make sure the C,
Fortran compiler and MPI version are consistent
while compiling all those libraries.
There are visualization tool available,
which replies on h5py and mayavi library with Python.
To use it, Python and correcponding library should be installed as well.
Anaconda is recommanded to install Python and libraries.
The repository is under frequent update,
it is recommended to make a new directory outside the NNMOF directory.
To compile outside the NNMOF directory, one can simply copy a case from
case dir and change the path of MOF_DIR in Makefile.
See the Makefile in test/basics directory as the example to see how to customize makefile.
The code in src directory does not contain main file,
the main file and other extra code file should be added to the name
CASE_SRCS and makefile.
Execute with command
mpirun -np (X) (executable) (input)(X)should be consistant withpx*pyin input file(executable)is generated by Makefile(input)is the name of the input namelist file and the field file based on hdf5, without suffix for example, for filetest3.namelist, and the initial field file istest3.h5,(input)should betest3. If no(input)is given, it will search for the default input fileinput.namelistandinput.h5.- By default, both
namelistandh5files are essential, however, one can call theInitfunction withinitfield = .false., so that the executable will no longer require initialh5file. - The variables in initial field
h5file should correcponds with the variables in thenamelistfile.
| Name | Description | Type | Rank |
|---|---|---|---|
| px, py | number of processors in |
Integer | 1 |
| nx, ny, nz | number of grid in |
Integer | 1 |
| dx, dy, dz | grid size in |
float | 1 |
| preiodx(or y,z) | periodic boudary | logical | 1 |
| tstart, end, dt | start, end time and time step | float | 1 |
| n_vars | number of input/output field variable | integer | 1 |
| io_x | whether use the variable as input/output | logical | 1 |
| Name | Description | Type | Rank |
|---|---|---|---|
| tstart | start of simulation time | float | 1 |
| tend | End of simulation time | flost | 1 |
| dt | time step | float | 1 |
| hotstart | hotstart flag | logical | 1 |
| hotstart_type | 0 for automatic, 1 for manual | integer | 1 |
| hotstart_time | when hotstart_type = 1, specify the start time | float | 1 |
| outptu_inteval | frequency of output | float | 1 |
| startoutputtime | the time that output will start | float | 1 |
| output_format | ‘tecplot’, ‘paraview’, or ‘hdf5’ | float | 1 |
Note: Then hotstart = .true., tstart will not work, instead, will be determined by
the hotstart parameters
| Name | Description | Type | Rank |
|---|---|---|---|
| rho_l,rho_r | density of liquid and gas | float | 1 |
| mu_l, mu_g | viscosity of liquid and gas | float | 1 |
| body_force | body foece in x, y, z dierections | float | 3 |
| rk_order | Order of Runge-Kutta integration, should be 1, 2 or 3 | integer | 1 |
| iter_max | Maximum iteration step | integer | 1 |
| iter_tolerance | Tolerance of the iterationq | float | 1 |
| hypre_solver | Choice of hypre solver | integer | 1 |
| hypre_preconditioner | Choice of hypre preconsitioner | integer | 1 |
| bc_left | Lower boundary type at x direction | integer | 3 |
| bc_right | Upper boundary type at x direction | integer | 3 |
| bc_back | Lower boundary type at y direction | float | 3 |
| bc_front | Upper boundary type at y direction | float | 3 |
| bc_bottom | Lower boundary type at z direction | float | 3 |
| bc_top | Upper boundary type at z direction | float | 3 |
The choice of hypre solver and preconditioner only works with specific combination:
| preconditioner => | 0 | 1 | 2 | |
|---|---|---|---|---|
| solver | None | SMG | PFMG | |
| 1 | SMG | Yes | ||
| 2 | PFMG | Yes | ||
| 3 | BiCGSTAB | Yes | Yes | Yes |
| 4 | GMRES | Yes | Yes | Yes |
Notes: Seems that SMG without preconditioner or SMG conditioner with GMRES work best.
| value | type |
|---|---|
| 1 | No-slip Wall |
| 2 | Slip Wall |
The output data is stored at hdf5 format.
The input file provide options to export paraview and Tecplot supported format.
It can also be done manuall by copying the python script from utils.
Several inline visualiation functions are available in src/tools.f90,
it allows you to visualize the field while calling the funcion.
This is very useful in debugging.