Use VSCode to develop STAR-CCM+ user library: build dynamic link library through Fortran
Although the official STAR-CCM+ documentation specifically states that FORTRAN is not supported under Windows1. But in fact, as long as the compiler supports it, user library compiled using Fortran under Windows can be loaded and run normally in STAR-CCM+.
1. Build CMake Project
First, we refer to the tutorial case in the official documentation 2 and build a CMake project. The project structure is as follows:
STARCCM_FORTRAN_SAMPLE
│ CMakeLists.txt # CMake Configuration File
│ README.md # Description document, not required
├───.vscode
│ launch.json # Automatically generated file when starting debug mode, not required
│ settings.json # Define CMake related variables
└───src
initVelocity.f
StarReal.f.in
sutherlandViscosity.f
uflib.f
zeroGradT.f
The main content of CMake configuration file CMakeLists.txt
is as follows: