CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[waves2Foam] volVectorField& U = db().lookupObject<volVectorField>("U") , runtime error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2014, 20:21
Default volVectorField& U = db().lookupObject<volVectorField>("U") , runtime error
  #1
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
Hi Niels and all Foamers,

I have a question on modifying the linearSpring class when applying to floating bodies in waveDyMFoam. I am trying to modify linearSpring.C
so that the code sees the finite volume mesh and can access all points in it.

I did the following modifications in linearSpring.C and was able to make the
modified dynamic library, mylibforcesNEW.so.
///////////////////////////////////Modifications to linearSpring.C //////////////
const objectRegistry& db();
const volVectorField& U = db().lookupObject<volVectorField>("U");
const fvMesh & mesh = U.mesh();
const pointField & pp = mesh.points(); // Thanks to Niels post
(http://www.cfd-online.com/Forums/ope...tml#post275193)
/////////////////////////////////////////////////////////
I then used this library in waveDyMFoam by including the
name in system/controlDict. But when I run the solver, I get the following
error
////////RUNTIME ERROR ///////////////
waveDyMFoam: symbol lookup error: /share/gecko/krishnak/OpenFOAM/krishnak-2.1.0/
platforms/linux64GccDPOpt/lib/mylibforcesNEW.so: undefined symbol: _Z2dbv
///////////////////////////////////////

Also the run time error disappears if I do not include lines starting from const volVectorField& U = db().lookupObject<volVectorField>("U");

Any help is welcome. Also if there is a better way to access the mesh within linearSpring.C, please let me know.

Thanks and best regards

Kumar

PS: Runtime include libs for waveDyMFoam:
libs
(
"libOpenFOAM.so"
"libfvMotionSolvers.so"
"mylibforcesNEW.so"
);
kumar2 is offline   Reply With Quote

Old   August 1, 2014, 16:11
Default accessing streamFunction class from main
  #2
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
Hi Niels and all,

I was trying to access member function printCoeffs() of class streamFunction from main (waveFoam). In waveFoam, I write,
///CODE BELOW///
Info<< " Coeff = " << Foam::waveTheories::streamFunction.printCoeffs() << nl << endl;

And the error I get is

error: 'streamFunction' is not a member of 'Foam::waveTheories' .


( I checked streamFunction.H where it is given Foam::waveTheories::streamFunction )

Thanks in advance

Kumar
kumar2 is offline   Reply With Quote

Old   August 1, 2014, 18:56
Default accessing streamFunction class from main
  #3
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
I posted the wrong error in the post just before !

This is the error...

error: expected primary-expression before '.' token


Thanks again

Kumar
kumar2 is offline   Reply With Quote

Old   August 2, 2014, 04:55
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Kumar,

What you are trying does not make sense. You will have to construct the object, before you use the method.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 2, 2014, 20:41
Default
  #5
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
Hi Niels,

Thank so much for your reply. I see what you mean ( for example in createFields.H , i see an example for trubulence, interface, also this link helped me ; http://eprints.soton.ac.uk/200155/1/WorkShopFOAM.pdf) .

I hope I can bug you with one other question: Suppose I create an object of streamFunction class in my main program. I think this object will be another object that will be DIFFERENT from the object (of streamFunction class) created by the waves2foam lib. Am I correct ?(this means there is no way of accessing the object of streamFunction class from main !!)

Best regards

Kumar
kumar2 is offline   Reply With Quote

Old   August 3, 2014, 02:13
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hallo Kumar,

Yes, it will be another, but identical object, if you create it with the same properties. For instance, both the relaxation zones and boundary conditions have separate but identical waveTheory objects.

Besides that, there is no way of accessing the wave theory from the waveFoam-solver, unless you perform a somewhat large re-write of the code.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Reply


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
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 09:00
DPM udf error haghshenasfard FLUENT 0 April 13, 2016 06:35
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 20:30
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 10:46.