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

Accessing a member function in a class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2006, 05:52
Default Hello, I'm trying to access t
  #1
Member
 
Fabian Peng Karrholm
Join Date: Mar 2009
Posts: 61
Rep Power: 17
fabianpk is on a distinguished road
Hello,
I'm trying to access the dragmodel of the spray, when I'm in the spray class (more precisely I'm in sprayFunctions.H). I have written a member function which has parcel and cell as input. To access mass of droplet for instance, I just did:

parceli.m();

but I have had problems accessing the Cd function of the dragModel class. I don't think I should need to initialize it, since that should have been made in the constructor of spray?

I typed

scalar Cd = drag_.Cd(ReynoldsNumber,fraction);

but then I get:

error: 'const class Foam::autoPtr<foam::dragmodel>' has no member named 'Cd'

What can I do about this?

/Fabian
fabianpk is offline   Reply With Quote

Old   June 14, 2006, 10:16
Default If someone is interested, I fo
  #2
Member
 
Fabian Peng Karrholm
Join Date: Mar 2009
Posts: 61
Rep Power: 17
fabianpk is on a distinguished road
If someone is interested, I found out that it's done by:

scalar CD = (*this).drag().Cd(ReDrop,0.0);


/Fabian
fabianpk is offline   Reply With Quote

Old   June 14, 2006, 10:20
Default Or a bit prettier: scalar C
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Or a bit prettier:

scalar CD = this->drag().Cd(ReDrop,0.0);

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak 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
Access private data member lr103476 OpenFOAM Running, Solving & CFD 3 May 5, 2018 22:44
Accessing member functions of class cell jaswi OpenFOAM Running, Solving & CFD 6 August 26, 2008 18:34
FoamPtrList%2360FoamcoordSet%e2%80%99 has no member named %e2%80%98hook%e2%80%99 msrinath80 OpenFOAM Installation 0 August 14, 2007 16:13
Re: Interested in being a member for Wiki Navraj Hanspal CFD-Wiki 1 April 12, 2006 20:10
Accessing function definitions for UDF Karl FLUENT 2 February 14, 2002 09:29


All times are GMT -4. The time now is 01:22.