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

Best way to maintain additional functionality between versions

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 5, 2008, 11:50
Default Hello, This could be a gene
  #1
New Member
 
Kian Mehravaran
Join Date: Mar 2009
Location: London, U.K
Posts: 22
Rep Power: 7
kian is on a distinguished road
Hello,

This could be a general programming question, and similar to the one asked by Sergio Ferraris (Feb.27, 2008), but left without an elegant solution.
Similar to his question, I have added virtual functions to classes and unlike his case, I don't mind dirtying the original OpenFOAM code. However, upgrading to a new release would require going to all the .H and .C files and copy/pasting them in the new release files, which would've been fine if I only had a handful of functions.

As an example, I have defined the virtual function probeL() in LESmodel, and later defined it GenEddyVisc and GenSGSStress. In the main code an instance of compressible::LESmodel is created and called "turbulence". Now I can easily do turbulence->probeL() to access my function.
Please note that if I had created a subclass of LESmodel (call it LESmodel2) and added my function there, it won't be seen by GenEddyVisc, GenSGSStress or their subclasses, unless I had created their subclasses, inheriting from LESmodel2.
I appreciate any ideas.

Best Regards,

Kian Mehravaran
kian is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 8 September 17, 2014 18:40
how to maintain constant presure in a tank? JB FLUENT 5 July 31, 2008 05:12
How to maintain the total gravity? panpan1202 FLUENT 0 March 12, 2008 03:43
How to maintain spacing along a new curve? KB Main CFD Forum 2 June 5, 2007 16:45
Turbo functionality is not enabled! nancy FLUENT 0 October 9, 2003 15:44


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