Andrew Moa Blog Site

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:

7 minutes to read
Andrew Moa

Use VSCode to develop STAR-CCM+ user library: Calculate physical properties through CoolProp

STAR-CCM+ user program (user library)1 is a dynamic link library compiled and constructed according to certain rules by an external compiler (usually C/C++, but also supports Fortran in Linux). By registering the constructed dynamic link library in the sim file, certain custom functions can be implemented. A user library usually contains one or more user-defined functions, which are generally used to implement special configuration or field functions.

Uer library need to register dynamic link libraries before they can be called, and the format of dynamic link libraries is often closely related to the operating system, hardware platform, etc. Therefore, user library are usually compiled for specific platforms and cannot run across platforms.

14 minutes to read
Andrew Moa

Develop STAR-CCM+ simulation assistant using VSCode

The STAR-CCM+ Simulation Assistant is equivalent to a plug-in that encapsulates Java macro commands. By calling macro commands, some procedural operations are performed. Compared with directly executing Java macro files, it can interact with users better and is obviously more friendly to users who are not familiar with Java. Because the simulation assistant is mostly used in pre- and post-processing, many consulting companies tend to adopt the same approach when developing customized plug-ins for this purpose.
4 minutes to read
Andrew Moa