CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Implementation of rpm as function of time in SRF module results in solver error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By user_HH

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2021, 12:29
Default Implementation of rpm as function of time in SRF module results in solver error
  #1
New Member
 
HH
Join Date: Apr 2019
Posts: 17
Rep Power: 7
user_HH is on a distinguished road
Hi,

I am trying to change the functionality of SRF in OF v1806 to input rpm as function of time.

I created a new folder "varSRF" in src/finiteVolume/cfdtools/general/

After making the required changes, I added the destination for .C files in the src/finiteVolume/Make/files. The folder compiled without any errors

However, when I made all the required changes to my solver and compiled it, I get the following error:

OpenFOAM-v1806/build/linux64GccDPInt32Opt/applications/solvers/grooveAsperityFoam_generic_reversed_SRF_var/grooveAsperityFoam_generic_reversed_SRF_var.o: In function `main':
grooveAsperityFoam_generic_reversed_SRF_var.C.te xt.startup+0x1690): undefined reference to `Foam::varSRF::varSRFModel::New(Foam::GeometricFie ld<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)'
grooveAsperityFoam_generic_reversed_SRF_var.C.te xt.startup+0x39e1): undefined reference to `Foam::varSRF::varSRFModel::New(Foam::GeometricFie ld<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)'
collect2: error: ld returned 1 exit status
make: *** [/home/hharia/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin/grooveAsperityFoam_generic_reversed_SRF_var] Error 1



I have been struggling with this error related to autoPtr and suspect that this is associated with the additional lines in the createFields.H. I have read several of posts on this error and tried various things to resolve it. However, I have not been successful and currently stuck.

I originally posted the question in the following thread: rpm as function of time in SRF model ?

But i haven't received any answers for the same.

Any help will be highly appreciated. Thanks in advance!

Additional Information:
OF version: v1806
Solver: It is a user defined solver built using PimpleFOAM as a reference (the solver has been tested with constant SRF speed and works. It crashes with this new modification for rpm as a function of time)
Lines in createFields. H:
autoPtr<varSRF::varSRFModel> varSRF
(
varSRF::varSRFmodel::New(Urel)
);

Modifications to original SRF functionality
1. Changed names from SRF to varSRF wherever relevant
2. Modified rpm.H to varrpm.H along with the following lines in the file
Old: scalar rpm_;
New: autoPtr<Function1<scalr>> rpm_;
3. Added appropriate header file

Best,
Hiral
user_HH is offline   Reply With Quote

Old   January 12, 2021, 07:42
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Hiral,

its a long time ago that I was programming in FOAM but

Code:
undefined reference to `Foam::varSRF::varSRFModel::New(Foam::GeometricFie ld<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)'
Tells you that you are calling a function named New(..) which is derived from your new class which does not exist.

I guess that you did not include the new source (varSRF) file to the library you compiled and hence, in the library the solver loads, the reference is not available.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 12, 2021, 08:42
Default Thanks Tobi
  #3
New Member
 
HH
Join Date: Apr 2019
Posts: 17
Rep Power: 7
user_HH is on a distinguished road
Tobi,

Thanks for your reply. Really appreciate your help.
I had been going through the log file I created while compiling the varSRF functionality and realized that varSRFNew.C was not included in Make/files.
I also added EXE_LIBS to the options file with -lfiniteVolume

The functionality and the solver compiled without errors. However, I am not sure if adding EXE_LIBS made any difference or not.

I also tried updating the post earlier after I discovered this error but couldn't find a way to reach the post when under moderator review.

Thank you for the help.

P.S. Your blogs and book on pimpleFoam have been very helpful in my solver development activity.

Best,
Hiral
Tobi likes this.
user_HH is offline   Reply With Quote

Reply

Tags
autoptr, compilation error, rpm, srf


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
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 13:21
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 20:30
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34


All times are GMT -4. The time now is 20:38.