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

Loading User Code in Simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2021, 13:19
Unhappy Loading User Code in Simulation
  #1
Member
 
Will Crawford-Jones
Join Date: Jan 2021
Posts: 43
Rep Power: 5
wcj1n18 is on a distinguished road
Hi,

I'm trying to load user code in a simulation which is a copy of a simple example in the user manual. In the manual, i'm following a section "Creating a User Library on Windows". In my directory I have uclib.h , UserFunctions.lib and Contact_Script_Code.c . All of which were either found in a directory that comes with installation (UserFunctions.lib) or I copied exactly from Star-CCM+ manual.

I then opened "x86 x64 Cross Tools Command Prompt for VS 2019", went to the correct directory and typed

cl /MD /D_WINDOWS /DDOUBLE_PRECISION -c Contact_Script_Code.c

There are no errors at this point. Contact_Script_Code.obj appears in my directory. I then type

link -dll /out:libuser.dll Contact_Script_Code.obj UserFunctions.lib

There are no errors. I then have libuser.dll , libuser.exp and libuser.lib in my directory.

I then proceed to Star-CCM+ , go to tools, user code, right click, new user library. It gives me the option to upload "libuser.dll" and it simply says "WARNING - Could not load user library registration function"

Any ideas what i'm doing wrong here? Please let me know if you have any questions about my approach.

Thanks

Will
wcj1n18 is offline   Reply With Quote

Old   November 24, 2021, 08:11
Default
  #2
Member
 
Will Crawford-Jones
Join Date: Jan 2021
Posts: 43
Rep Power: 5
wcj1n18 is on a distinguished road
Guys,

Has no one got any ideas here?

Will
wcj1n18 is offline   Reply With Quote

Old   November 26, 2022, 21:32
Smile Have you solved the problem? I have encountered the same situation today.
  #3
lkx
New Member
 
LiuKexin
Join Date: Nov 2022
Posts: 1
Rep Power: 0
lkx is on a distinguished road
Quote:
Originally Posted by wcj1n18 View Post
Hi,

I'm trying to load user code in a simulation which is a copy of a simple example in the user manual. In the manual, i'm following a section "Creating a User Library on Windows". In my directory I have uclib.h , UserFunctions.lib and Contact_Script_Code.c . All of which were either found in a directory that comes with installation (UserFunctions.lib) or I copied exactly from Star-CCM+ manual.

I then opened "x86 x64 Cross Tools Command Prompt for VS 2019", went to the correct directory and typed

cl /MD /D_WINDOWS /DDOUBLE_PRECISION -c Contact_Script_Code.c

There are no errors at this point. Contact_Script_Code.obj appears in my directory. I then type

link -dll /out:libuser.dll Contact_Script_Code.obj UserFunctions.lib

There are no errors. I then have libuser.dll , libuser.exp and libuser.lib in my directory.

I then proceed to Star-CCM+ , go to tools, user code, right click, new user library. It gives me the option to upload "libuser.dll" and it simply says "WARNING - Could not load user library registration function"

Any ideas what i'm doing wrong here? Please let me know if you have any questions about my approach.

Thanks

Will


Have you solved the problem? I have encountered the same situation today.
lkx 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
Error code: 126 loading compiled udf library into fluent Perigee Fluent UDF and Scheme Programming 3 August 25, 2022 15:15
About parallel couple cfx with other code using user fortran Jinzhihui CFX 2 June 6, 2021 00:39
Looking for experts in Starccm+ to help me write user code files highend CFD Freelancers 4 March 11, 2019 04:49
User Code for HPC nalamyogesh STAR-CCM+ 3 March 3, 2019 18:54
How to build a source code for simulation of combustion syoukera Main CFD Forum 0 July 31, 2018 08:13


All times are GMT -4. The time now is 13:50.