Skip to content

Commit

Permalink
Merge branch 'MFlowCode:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
haochey authored Nov 5, 2024
2 parents cb5e977 + 8aaf0d6 commit cb8d647
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 22 deletions.
25 changes: 20 additions & 5 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ If `file_per_process` is true, then pre_process, simulation, and post_process mu

- `probe_wrt` activates output of state variables at coordinates specified by `probe(i)%[x;y,z]`.


### 8. Acoustic Source {#acoustic-source}

| Parameter | Type | Description |
Expand Down Expand Up @@ -683,7 +682,7 @@ Implementation of the parameters into the model follow [Ando (2010)](references.

| Parameter | Type | Description |
| ---: | :----: | :--- |
| `perturb_flow` | Logical | Perturb the initlial velocity field by random noise |
| `perturb_flow` | Logical | Perturb the initial velocity field by random noise |
| `perturb_flow_fluid` | Integer | Fluid density whose flow is to be perturbed |
| `perturb_flow_mag` | Real | Set the magnitude of flow perturbations |
| `perturb_sph` | Logical | Perturb the initial partial density by random noise |
Expand All @@ -698,7 +697,7 @@ The parameters are optionally used to define initial velocity profiles and pertu

- `perturb_flow` activates the perturbation of initial velocity by random noise.

- `perturb_flow_fluid` specifies the fluid component whose flow is to be perturbed.
- `perturb_flow_fluid` specifies the fluid component whose flow will be perturbed.

- `perturb_flow` activates the perturbation of initial velocity by random noise.

Expand Down Expand Up @@ -738,7 +737,7 @@ $$ u = patch\_icpp(1)\%vel(1) * tanh(y\_cc * mixlayer\_vel\_profile) $$
| `pi_fac` | Real | Ratio of artificial and true `pi_\infty` values|

- `pi_fac` specifies the ratio of artificial and true `pi_\infty` values (`=` artificial `pi_\infty` / true `pi_\infty`).
This parameter enables the use of true `pi_\infty` in bubble dynamics models, when the `pi_\infty` given in the `case.py` file is an artificial value.
This parameter enables the use of true `pi_\infty` in bubble dynamics models when the `pi_\infty` given in the `case.py` file is an artificial value.

### 13. Body Forces

Expand All @@ -754,7 +753,23 @@ This parameter enables the use of true `pi_\infty` in bubble dynamics models, wh

$$ a_{x[y,z]} = g_{x[y,z]} + k_{x[y,z]}\sin\left(w_{x[y,z]}t + p_{x[y,z]}\right). $$

Positive accelerations are in the `x[y,z]` direction are in the positive `x[y,z]` direction by convention.
By convention, positive accelerations in the `x[y,z]` direction are in the positive `x[y,z]` direction.

### 14. Cylindrical Coordinates

When ``cyl_coord = 'T'`` is set in 3D the following constraints must be met:

- `bc_y%beg = -14` enables the axis boundary condition

- `bc_z%beg = bc_z%end = -1` enables periodic boundary conditions in the azimuthal direction

- `z_domain%beg = 0` sets the azimuthal starting point to 0

- `z_comain%end = 2*math.pi` to set the azimuthal ending point to $2\pi$ (note, requires `import math` in the case file)

When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:

- `bc_y%beg = -2` to enable reflective boundary conditions

## Enumerations

Expand Down
59 changes: 44 additions & 15 deletions docs/documentation/visualization.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
# Flow visualization

Post-processed database in Silo-HDF5 format can be visualized and analyzed using VisIt.
VisIt is an open-source interactive parallel visualization and graphical analysis tool for viewing scientific data.
A post-processed database in Silo-HDF5 format can be visualized and analyzed using Paraview and VisIt.
After the post-processing of simulation data (see section [Running](running.md#running-1)), a directory named `silo_hdf5` contains a silo-HDF5 database.
Here, `silo_hdf5/` includes a directory named `root/` that contains index files for flow field data at each saved time step.

### Visualizing with Paraview

Paraview is an open-source interactive parallel visualization and graphical analysis tool for viewing scientific data.
Paraview 5.11.0 has been confirmed to work with the MFC databases for some parallel environments.
Nevertheless, the installation and configuration of Paraview can be environment-dependent and are left to the user.

The user can launch Paraview and open the index files under `/silo_hdf5/root`.
Once the database is loaded, flow field variables contained in the database can be added to the render view.
Further information on Paraview can be found in its [documentation](https://docs.paraview.org/en/latest/).
The figure below shows the iso-contour of the liquid void fraction (`alpha1`) in the database generated by the example case `3D_sphbubcollapse`.

![](../res/paraview.png)

### Visualizing data in cylindrical coordinates

Visualizing data in cylindrical coordinates requires a coordinate transformation of the raw data in the database file.
In Paraview, this coordinate transformation can be accomplished with the following steps:

1. Apply a `clean to grid` filter to the raw data

2. Apply a `calculator` filter to the cleaned data
- Set the calculator `attribute type` to point data
- Check the box for `Coordinate Results`
- Enter the formula `coordsX*cos(coordsY)*iHat + coordsX*sin(coordsY)*jHat + coordsZ*kHat`
- click apply

These steps will transform the raw data into cylindrical coordinates.
For many cases, this step will require resizing the render view window.

## Visualizing with VisIt

VisIt is an alternative open-source interactive parallel visualization and graphical analysis tool for viewing scientific data.
Versions of VisIt after 2.6.0 have been confirmed to work with the MFC databases for some parallel environments.
Nevertheless, installation and configuration of VisIt can be environment-dependent and are left to the user.
Further remarks on parallel flow visualization, analysis, and processing of the MFC database using VisIt can also be found in [Coralic (2015)](references.md#Coralic15) and [Meng (2016)](references.md#Meng16).

## Procedure

After the post-processing of simulation data (see section [Running](running.md#running-1)), a directory named `silo_hdf5` contains a silo-HDF5 database.
Here, `silo_hdf5/` includes a directory named `root/` that contains index files for flow field data at each saved time step.
The user can launch VisIt and open the index files under `/silo_hdf5/root`.
Once the database is loaded, flow field variables contained in the database can be added to the plot.

The figure below shows the iso-contour of the liquid void fraction (`alpha1`) in the database generated by the example case `3D_sphbubcollapse`.
For analysis and processing of the database using VisIt's capability, the user is encouraged to address [VisIt user manual](https://wci.llnl.gov/simulation/computer-codes/visit/manuals).

Expand All @@ -22,9 +51,9 @@ For analysis and processing of the database using VisIt's capability, the user i

## Serial data output

If `parallel_io = F` then MFC will output the conservative variables to a directory `D/`.
If ``parallel_io = 'F'``, MFC will output the conservative variables to a directory `D/`.
If multiple cores are used ($\mathtt{ppn > 1}$), then a separate file is created for each core.
If there is only one coordinate dimension (`n = 0` and `p = 0`), the primitive variables will also be written to `D/`.
If only one coordinate dimension (`n = 0` and `p = 0`) exists, the primitive variables will also be written to `D/`.
The file names correspond to the variables associated with each equation solved by MFC.
They are written at every `t_step_save` time step.
The conservative variables are
Expand All @@ -39,7 +68,7 @@ where $N_c$ are the number of components `num_fluids` and $N_d$ is the number of
There are exceptions: if `model_eqns = 3`, then the six-equation model appends these variables with the internal energies of each component.
If there are sub-grid bubbles `bubbles = T`, then the bubble variables are also written.
These depend on the bubble dynamics model used.
If `polytropic = T`, then the conservative variables are appended by
If ``polytropic = 'T'``, then the conservative variables are appended by

$$ n\_b R\_1, n\_b {\\dot R}\_1, \dots, n\_b R\_{N\_b}, n\_b {\\dot R}\_{N\_b} $$

Expand All @@ -62,11 +91,11 @@ Place the file `paceParview.zip` in your scratch direction on Phoenix and unzip
Enter the new directory `paceParaview` and run `tar -xvf ParaView-5.11.0-egl-MPI-Linux-Python3.9-x86_64.tar.gz` to decompress the compiled binary.
Now that you have the binary on Phoenix, you must download Paraview 5.11 on your local machine.
Paraview binaries can be downloaded [here](https://www.paraview.org/download/).
Be sure to select `v5.11` from the version drop-down bar and install a `5.11.0` version of Paraview.
Select `v5.11` from the version drop-down bar and install a `5.11.0` version of Paraview.

### Step 2: Customizing the script

While all of the options for the bash script could be passed as command-line arguments, hardcoding certain unlikely-to-change options saves time.
While all of the bash script's options could be passed as command-line arguments, hardcoding certain unlikely-to-change options saves time.
The following is a list of required and suggested updates to make to `pace-paraview-server`.

- (Optional) Update line 4 to customize the job name that will show up in the scheduler
Expand All @@ -80,7 +109,7 @@ Before running `pace-paraview-server` for the first time, you must update its pe
Once this has been done, you can run `./pace-paraview-server` with the following options:

- `--account` specifies the charge account for the job.
If you updated line 51 of `pace-paraview-server` to reflect a default account, this option is optional, otherwise it is required.
If you updated line 51 of `pace-paraview-server` to reflect a default account, this option is optional; otherwise, it is required.
- `--nodes` specifies the number of nodes to request (default 1)
- `--mem` specifies the memory per node to request (default is to request all memory)
- `--gres` specifies the GPU resources to request.
Expand All @@ -96,7 +125,7 @@ Submitted batch job <job #>
Waiting for ParaView server to start. This may take several minutes ...
```

When it's done initializing, you should see a dialogue with some recommended next steps numbered 1-4.
When initializing is done, you should see a dialogue with some recommended next steps, numbered 1-4.
Below is a slightly altered version of that dialogue:

1) Create the appropriate port forwarding for your local ParaView session to connect with.
Expand All @@ -105,7 +134,7 @@ Below is a slightly altered version of that dialogue:
* `ssh -L 8722:<nodeIdentifier>:53723 <paceSystemIdentifier>`

2) Once you have `Paraview5.11.0` on your machine, select `File -> Connect..` to open the remote connection dialogue box.
* If you've already set up the pace connection, simply double-click the existing configuration.
* Double-click the existing configuration if you've already set up the PACE connection.
* Click `Add Server` If you have not set up the PACE connection.
This will create a new dialogue box where you can specify a configuration name and set the `Port` to `8722`.
Once this is done, click `configure` and then `save` on the next dialogue box.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@
<a class="px-4 flex flex-row items-center py-4 border-b-2 hover:border-amber-400" href="https://github.com/MFlowCode/MFC/releases/latest">
<i class="pr-4 fa-solid fa-download"></i>
<div class="flex-1">
<span class="hidden sm:inline-block">Download </span>
<span class="hidden sm:inline-block">Download</span>
<span id="release-ver"></span>
</div>
</a>
<a class="px-4 flex flex-row items-center py-4 border-b-2 hover:border-amber-400" href="documentation/md_getting-started.html">
<i class="pr-4 fa-solid fa-rocket"></i>
<span class="flex-1">Quick Start</span>
</a>
<a class="px-4 flex flex-row items-center py-4 border-b-2 hover:border-amber-400" href="documentation/index.html">
<a class="px-4 flex flex-row items-center py-4 border-b-2 hover:border-amber-400" href="documentation/md_readme.html">
<i class="pr-4 fa-solid fa-book"></i>
<span class="flex-1">Documentation</span>
</a>
Expand Down
Binary file added docs/res/paraview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb8d647

Please sign in to comment.