This ST4SD experiment runs flow simulations in a capillary network, including the geometry modification effects caused by erosion, precipitation, dissolution and deposition.
- A recent version of python 3 - python 3.7+
- A container runtime like docker and podman
- The git command-line utility
You can try out the Geometry Modification Module experiment on your laptop by:
- creating a python virtual environment, activating it, and installing the python module
st4sd-runtime-core[deploy]
- cloning this repository
- creating
simulations-data
folder to be used as an application dependency - launching the experiment
For example, if you are using docker
you can run :
: Download virtual experiment
git clone https://github.com/st4sd/flow-simulator-experiment.git
cd flow-simulator-experiment
: Setup ST4SD Core
python3 -m venv --copies venv
. venv/bin/activate
python3 -m pip install "st4sd-runtime-core[develop]"
: Run a Geometry Modification Module Experiment
cat <<EOF >variables.yaml
global:
s3Folder: "my_simulation_folder"
centerlinesFile: "centerlines"
csvFile: "my_cases_file.csv"
numberOfCases: 3
binaryImage: "binary_image"
EOF
time elaunch.py -l 40 --platform docker \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_gmm.yaml
: See outputs of experiment
output_dir=$(ls -td flowir_package_gmm*.instance | head -1)
results_dir=${output_dir}stages/stage2/AggregateGMMResults/
echo The outputs of the experiment are in ${results_dir}
ls -lth ${results_dir}
Note: The above should take just a couple of minutes from start to finish.
If you are using podman
as your container runtime, you should configure it like this before running the experiment:
podman machine set --rootful
before running
podman machine start
Also, include
--dockerExecutableOverride=`which podman`
to the command line arguments like so:
time elaunch.py -l 40 --platform docker --dockerExecutableOverride=`which podman` \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_gmm.yaml
- Create a new folder inside
simulations-data
with acenterlines.json
file. - To create the
variables.yaml
file, run the following command replacing the values if needed:
cat <<EOF >variables.yaml
global:
numberOfNetworks: 30
s3Folder: "my_simulation_folder"
sampleFileName: "centerlines.json"
voxelSize_m: 2.25e-6
capillaryLength_m: 4.5e-5
sampleSize_m: 3.0e-4
dynamicViscosity_Pas: 1.002e-3
temperature_K: 340.0
absolutePressure_Pa: 101325.0
pressureGradient_Pa: 10132.5
EOF
- Run
elaunch.py
command replacing the path to yoursimulations-data
folder. If you are usingdocker
, run:
time elaunch.py -l 40 --platform docker \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_static.yaml
If you are using podman
, run:
time elaunch.py -l 40 --platform docker --dockerExecutableOverride=`which podman` \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_static.yaml
- Create a new folder inside
simulations-data
with acenterlines.tar
file (see instructions about this file below). It is possible to usecenterlines.tar
files generated by previous executions of static simulations. To use thecenterlines.tar
from the latest execution and copy it tosimulation-data/my_simulation_folder
, run:
output_dir=$(ls -td flowir_package_static-*.instance | head -1)
cp "${output_dir}/stages/stage2/AggregateStaticResults/centerlines.tar" "simulations-data/my_simulation_folder/centerlines.tar"
- To create the
variables.yaml
file, run the following command replacing the values if needed:
cat <<EOF >variables.yaml
global:
numberOfCenterlines: 30
s3Folder: "my_simulation_folder"
voxelSize_m: 2.25e-6
capillaryLength_m: 4.5e-5
sampleSize_m: 3.0e-4
contactAngle_deg: 0.0
linearMK: 0.0
interfacialTension_Nm: 0.04
temperature_K: 400.0
absolutePressure_Pa: 10000000.0
pressureGradient_Pa_m: 10e6
dynamicViscosityWater_Pas: 0.000260196
dynamicCiscosityCO2_Pas: 3.26e-5
initialTime_s: 0.0
finalTime_s: 0.05
timeStepSize_s: 0.001
EOF
- Run
elaunch.py
command replacing the path to yoursimulations-data
folder. If you are usingdocker
, run:
time elaunch.py --platform docker \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_dynamic.yaml
If you are using podman
, run:
time elaunch.py --platform docker --dockerExecutableOverride=`which podman` \
-s simulations-data:simulations-data:copy \
-a variables.yaml --manifest manifest.yaml conf/flowir_package_dynamic.yaml
To perform dynamic simulations it is required to provide the centerlines to be used. They should be all in a single compressed file named centerlines.tar
and each centerline must follow the following name convenction:
centerlines
centerlines_0000.json
centerlines_0001.json
centerlines_0002.json
...