DroneWISP, or WISP for short, is a project that aims to simulate wind conditions for a given geometry and predict the wind velocity field using a PINN model.
(DroneWISP was previously known as RWDS, or Real Wind Drone Sim (RWDS), but was renamed to better reflect the project's goals.)
DRV, or Drone Req Validator, is a project that aims to streamline the process of validating the requirements of a drone software system. available at here
This project uses OpenFoam to simulate realist wind conditions for a given geometry. Also propose a PINN model to predict the wind velocity field in the given geometry.
- Linux or WSL (WSL preferred)
- OpenFoam 10
- ParaView (optional, for visualization)
- WSL users: Windows ParaView is recommended (see setup below)
- 6+ cores CPU
- 8GB+ RAM
- 20GB+ available storage
- DRV REST: port 5000
- WISP REST: port 5001
- WISP UDP inbound: port 3001
- UE UDP inbound port: 8008
- UE UDP outbound target port: 3001
install linux subsystem, ignore if you are using linux natively
wsl --install
Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
After installing WSL, open the terminal and run setup.sh
sudo bash setup.shVerify the installation by running the following command
foamVersionShould return
OpenFOAM 10
If that didn't work, follow the following steps to install OpenFoam 10 on WSL manually
sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo apt-get update
sudo apt-get install openfoam10
sudo apt-get install --only-upgrade openfoam10next add the following line to the end of file .bashrc
source /opt/openfoam10/etc/bashrc
or run the following command
echo "source /opt/openfoam10/etc/bashrc" >> ~/.bashrcsource the new bashrc file
source ~/.bashrccd python
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtNOT SUPPORTED
Docker is recommended for Mac users.
build the docker image
cd python
docker build -t wisp_server .run the docker image
(assume you are in python directory)
docker compose upUse compose.workflow-runner.yaml to run a one-shot CFD job that accepts an STL terrain, one simulation config JSON, and a target CSV path.
Local example:
bash run_wr_job.sh \
--stl /home/bohanzhang/DroneWISP/4drone_Test_site_V36_mono_smooth.stl \
--config /home/bohanzhang/DroneWISP/wr_examples/sim_config_3_drone_new.json \
--output /home/bohanzhang/DroneWISP/out/wind.csvThe runner reads wind definitions from the single config file, using environment.wind.sources in the current schema. The older environment.wind array remains supported.
Compose contract:
WR_INPUT_STL_DIR: host directory that contains the STL fileWR_INPUT_STL_FILE: STL basename inside that directoryWR_INPUT_CONFIG_DIR: host directory that contains the simulation config JSONWR_INPUT_CONFIG_FILE: config filename inside that directoryWR_OUTPUT_DIR: host directory where the merged CSV should be writtenWR_OUTPUT_FILE: output CSV basename
Current wind config shape:
environment.wind.sources: array of wind source objectsenvironment.wind.height_cells: integer number of CFD cells in the vertical direction, defaults to10environment.wind.scale: uniform mesh scale factor in(0, 1], defaults to1.0environment.origin.radius: region radius, unchanged from the simulation config
Multi-source wind handling:
- wind vectors are averaged component-wise
- the merged run is treated as
Turbulent Windif any source is turbulent fluctuation_percentageis taken as the maximum source value when turbulence is enabled
Notes:
- the exported CSV contains only the final time step with columns
x,y,z,u,v,w wind.scalecontrols mesh scaling and therefore the horizontal CFD cell count- there is no hardcoded maximum effective
xorycell count in the runner wind.height_cellsdirectly controls the CFDzcell count and is not multiplied bywind.scale- the solver adds a small fixed clearance around the STL, so exported coordinates can extend slightly beyond the STL extents after inverse scaling
- the WR-side input STL is expected to be box-like in most runs, with
zbeing the least predictable dimension
all OpenFOAM research scenarios are in the run directory
cd rundetailed description of each example is in the readme.md file in each directory
In general, run the following command to run the simulation
cd run
cd {example directory}
bash ./Allrunstart WISP side flask server: python3 cfd_server.py -h "0.0.0.0" -p 5001
preprocess velocity csv: auto_preprocess_all_for_sim.py, auto_preprocess_all_for_train.py. for sim uses weak preprocessing, for train uses strong preprocessing.
prepare training data: pinn/prepare_training_dataset.py
train the model: pinn/dnn_train.py
test the model: pinn/dnn_test.py
If you're using WSL and have ParaView installed on Windows, you can configure the system to use Windows ParaView instead of the WSL version. This avoids segfault issues with WSL ParaView and provides better performance.
Run the setup script from the main directory:
cd /path/to/DroneWISP
bash ./setup_paraview_windows.shThis script will:
- Configure your shell to use Windows ParaView (
G:\ParaView 5.13.2\bin\paraview.exe) by default - Automatically convert WSL paths to Windows network paths
- Fall back to WSL paraFoam if Windows ParaView is not found
After running the script, either:
- Open a new terminal window, or
- Run
source ~/.bashrcin your current terminal
Note: If your ParaView installation is in a different location, edit setup_paraview_windows.sh and update the PARAVIEW_EXE path.
To visualize the results of the simulation, you can use ParaView.
cd run
cd {example directory}
# Assuming you have already run the simulation
paraFoamSince all Allrun scripts create an empty results.foam file, when you run paraFoam under a case directory, it will open the case in ParaView.
But the results will not be visible, you need to change the view option to display the U, p, and other fields.
click on this bar and select the fields you want to display. U in this case.
now it will display the velocity field from top-down view, to see the inside of the geometry, you can use the clip filter.
to view the result at a different time, you can use the time slider at the top of the window.
The resulting visualization looks like this

You can save each wind velocity field as a .csv file by using paraView, or use openFoam's built-in command
postProcess -func writeCellCentresto postprocess the results by export each cell's center to a C file. the index of C will bijectionally map to the values in the U file in each time step folder.
Or, alternatively, you can use the paraView:
This will save all the wind velocity field and cell coordinate at each time step as a .csv file in the postProcessing folder in the case directory.
If your CPU has less than 6 cores, you need to change the runParallel to runApplication in the Allrun file in each example directory, otherwise the simulation may not run.
Or change your available cores in the decomposeParDict file in the system folder in each example directory by changing numberOfSubdomains 6 to your available cores.
If you are using WSL, the storage is limited to the 100GB, and once allocated, it cannot be freed. to free up the storage after simulating large cases, we need to delete the old cases to free up the storage for windows.
First locate the WSL image in the windows file system it should be in the following directory
C:\Users\{username}\AppData\Local\Packages\CanonicalGroupLimited.Ubunto{hash}\LocalState\ext4.vhdx
Then free up the storage by optimizing the image
wsl --shutdown
optimize-vhd -Path {path to ext4.vhdx} -Mode fullIf you cannot open ParaView using the command paraFoam:
-
WSL users with segfault issues: Use the Windows ParaView setup script (see "Setting up Windows ParaView for WSL" above). The WSL version of ParaView may segfault due to OpenGL issues.
-
Unusual folder names: Sometimes it's because of unusual folder names in the case folder. Delete any folders that are not the default OpenFOAM folder names and try again.
-
results.foam file issues: If OpenFOAM aborts with "invalid fileName results.foam", ensure the
results.foamfile is removed before running simulations. TheAllcleanscript should handle this automatically.
if you see
./Allclean: line 3: $'\r': command not found
It is because the file is not in the correct format, change the file line separator to LF using any text editor.
IMPORTANT:
if you already ran the Allrun script in CRLF format, there will be a results.foam file with LF at the end of the file name, and it will cause OpenFoam to crash.
Just remove it and run the Allrun script again in LF format.




