CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

User code tutorial (Fortran)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ian0103

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2023, 01:54
Default User code tutorial (Fortran)
  #1
New Member
 
Join Date: Sep 2014
Posts: 18
Rep Power: 12
ian0103 is on a distinguished road
Hello all.

I'm trying to utilize a user library in star-ccm+ that I created using Fortran source code, following a tutorial. However, I'm stuck.

My environment is as follows:

O/S: Windows10
CCM+: 2206.0001 (17.04.008-R8)
Fortran IDE: VScode
Compiler: gfortran

Following the tutorial, I created five files:
1. StarReal.f
2. uflib.f
3. zeroGrad.f
4. initVelocity.f
5. sutherlandViscosity.f

I tried to create a dynamic library (libuser.dll) using the following command:

gfortran -shared -fPIC -o libuser.dll ./StarReal.f ./uflib.f ./zeroGrad.f ./initVelocity.f ./sutherlandViscosity.f


However, I'm getting an "undefined reference to uffunc_, ufarg_" error.
It seems like it can't find (link?) the uffunc and ufarg called in uflib.f

(Because, when I used the following command, the library was created without any problems:

gfortan -shared -fPIC -o libuser.dll ./StarReal.f
)


I'm not sure how to resolve this.
ian0103 is offline   Reply With Quote

Old   December 12, 2023, 22:02
Default FORTRAN is not supported on Windows.
  #2
New Member
 
Join Date: Sep 2014
Posts: 18
Rep Power: 12
ian0103 is on a distinguished road
Sorry, I missed this sentence in manual :<
ian0103 is offline   Reply With Quote

Old   December 14, 2023, 20:29
Default Compiler option
  #3
New Member
 
Join Date: Sep 2014
Posts: 18
Rep Power: 12
ian0103 is on a distinguished road
Sorry to keep repeating myself.
I added the CCM+ installation path to the compile options, and the library created with the Fortran code on Windows was imported into CCM+ correctly.
cwl likes this.
ian0103 is offline   Reply With Quote

Reply

Tags
user code


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding velocity fluctuations on inlet by user fortran Sergeyevichsky CFX 2 May 18, 2017 23:42
User fortran to input/output file in a parallel run doublestrong CFX 5 March 31, 2017 09:15
CFD Code Conversion from Intel Fortran to GNU Fortran pitto Main CFD Forum 4 August 4, 2016 15:51
User fortran routines, DEBUG AND OUTPUT Bloshchitsyn Vladimir CFX 5 October 29, 2007 02:31
Context of user fortran functions Bloshchitsyn Vladimir CFX 0 October 17, 2007 07:28


All times are GMT -4. The time now is 14:06.