STSTOP Project - Hanger
# Generate mesh files with different resolutions
python 3dhanger.py --res <10,50,100>Run the command with different values separately to generate three mesh files of different resolutions.
# Run the resolution script
python 3dhanger_run_res.pyImportant: Make sure you run these commands in CMD and not PowerShell, as OpenCFS is not supported in PowerShell.
- Download the OpenCFS software from the official website
- Install to the root of your user directory:
C:\Users\<me>\openCFS - Add the following environment variables:
PYTHONPATHwith valueC:\Users\<me>\openCFS\share\pythonCFSwith valueC:\Users\<me>\openCFS\share\pythonCFS_QUIETwith value1
- Add
C:\Users\<me>\binto your PATH - Create a directory
binin your user home and add the .bat files from "Windows .bat files" - Install Python 3.12 from https://www.python.org/downloads/ (Note: This specific version works better than Anaconda)
- Ensure Python is in your PATH by testing in cmd:
python --version - Install required packages:
(Note: scipy and vtk are not critical)
pip install numpy matplotlib h5py lxml Pillow scipy vtk
- Test Python: Run
create_mesh --res 20 --type bulk2din cmd - Test OpenCFS: Run
cfs --versionin cmd
If you encounter an error during installation:
- Go to System Settings → Privacy and Security
- Scroll down to the "Security" heading and click "Open Anyway" to override Apple's security block
Installation steps:
- Install Homebrew from https://brew.sh/
- Unpack OpenCFS to
/Users/<ME>/openCFS - Edit the hidden
.zshrcfile and add the following lines:export PATH=$PATH:$HOME/openCFS/bin:$HOME/openCFS/share/python export PYTHONPATH=$PYTHONPATH:$HOME/openCFS/share/python export CFS_QUIET=1
- Install the required Python packages as listed in the Windows section
Download and install the latest version of Paraview from https://www.paraview.org/download/
Get the available options via cfs --help. You are encouraged to experiment with these options.
Example commands:
-
Basic simulation:
cfs -m cantilever2d_20.mesh mech2d_cholmod- This looks for
mech2d_cholmod.xmlas the problem file - Output files will start with
mech2d_cholmod
- This looks for
-
To keep result files for comparison:
cfs -m cantilever2d_20.mesh -p mech2d_cholmod.xml problem- Output files will start with
problem
- Output files will start with
-
To visualize a mesh file:
cfs -g -m cantilever2d_20.mesh mech2d_cholmod- Generates a
.cfsoutput file with mesh visualization - Skips the simulation (the settings in the
<pde>section of the problem xml file are not read)
- Generates a
CFS++ may generate large output files, especially when performing optimization and parameter studies. To save disk space:
- In the simulation part in
<storeResults>:- Have no region output in
<nodeResult>and<elemResult>
- Have no region output in
- Remove the HDF5 output writer
- In the optimization part, use a large stride for
<commit>, e.g., 9999