PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
In the previous tutorial, we ran a simulation where the grid was generated automatically. For complex, real-world geometries, you will typically use a dedicated meshing tool to create a grid and provide it to the solver as a file.
This tutorial will guide you through running the bent_channel
example, which demonstrates how to use a pre-computed curvilinear grid file.
This template simulates incompressible laminar flow through a 90-degree bent channel. The key feature is that the grid is read from a file, demonstrating the workflow for non-trivial geometries.
Physics:
Just like before, we use the pic.flow init
command to create our study directory.
PICurv
project directory.Run the following command:
bash ./bin/pic-flow init bent_channel --dest my_bent_channel_run
This copies the bent_channel
template into a new my_bent_channel_run
directory. If you look inside, you will see a new set of files:
Open the my_bent_channel_run/bent_channel.yml
file and look at the grid
section. It's different from the previous tutorial:
mode: file
**: This tells pic.flow
that the C-solver should not generate its own grid.source_file: ...
**: This provides the path to the coordinate file (.picgrid
) that the solver should use.Notice that the Imp-MG-Standard.yml
and Standard_Output.yml
files are identical to the ones from the flat_channel
example. This highlights a core design principle of PICurv: physical cases, numerical solvers, and monitoring are modular and interchangeable.
The run command is almost identical to the previous tutorial. We just point the --case
flag to our new bent_channel.yml
file.
From the project root directory, execute the run
command:
bash ./bin/pic-flow run \ --case my_bent_channel_run/bent_channel.yml \ --solver my_bent_channel_run/Imp-MG-Standard.yml \ --monitor my_bent_channel_run/Standard_Output.yml \ --post my_bent_channel_run/standard_analysis.yml \ -n 4 --solve --post-process
The output will again be in a timestamped directory inside runs/
, with the final visualization files in the viz/
subdirectory.
File -> Open
and select the Field..vts
series from the viz/
directory.Field..vts
selected, click the Stream Tracer filter icon in the toolbar.U_nodal
vector field magnitude.You will see the flow navigating the bend, with higher velocities on the inner wall and lower velocities on the outer wall, which is the expected physical result.
You have now successfully run a simulation using both a programmatic grid and a file-based grid. You understand the core user workflow of PICurv.Before moving on to create your own cases, it's essential to learn the fundamentals of visualizing and analyzing your results.
Please proceed to the final introductory tutorial: Tutorial: A Guide to Visualizing Your Results.