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

How to implement a new limiter function?

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

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By lichmaster

Reply
 
LinkBack Thread Tools Display Modes
Old   February 6, 2013, 11:46
Default How to implement a new limiter function?
  #1
New Member
 
Lorenzo A. Ricciardi
Join Date: Mar 2011
Posts: 27
Rep Power: 6
lichmaster is on a distinguished road
Hi foamers,

I'd like to know how to implement a new kind of limiter function (to be used to interpolate from cell center to face center).

The problem is not the implementation of the limiter itself, but how to link it in the standard OF library, so that it becomes available in the standard interpolation list, like the various Van Albada, Van Leer, minmod, etc...

I tried to follow a tutorial for "implementing my turbulence model" and to understand the undelying philosophy, but when i launched "wmake libso" it said that everything was up to date...

Thanks
lichmaster is offline   Reply With Quote

Old   February 10, 2013, 07:46
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Lorenzo,

Try adding to the case's "system/controlDict" this line:
Code:
libs ("libMyLibrary.so");
This should forcefully load the missing library at run time.

Best regards,
Bruno
lichmaster likes this.
wyldckat is offline   Reply With Quote

Old   February 12, 2013, 07:16
Default
  #3
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
Limiters you mentioned are already there, take a look at:
$FOAM_SRC\finiteVolume\interpolation\surfaceInterp olation\limitedSchemes
and you see vanAlbada, Minmod
They are not just mentioned in the guide
anishtain4 is offline   Reply With Quote

Old   February 19, 2013, 09:11
Default
  #4
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
I need to implement a new limiter, it is not much different from vanLeer so:
1. I copied it to the $WM_PROJECT_USER_DIR
2. changed the files according to what I needed
3. made Make directory and 'file', 'option' files in it
4. Tried 'wmake libso'

but it returns libNULL.so is up to date, and when I want to access my limiter it just complains there is not such a limiter, please let me know what should I do?
anishtain4 is offline   Reply With Quote

Old   February 19, 2013, 09:24
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Mahdi,

What is the content of the file "Make/files" and "Make/options"?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 20, 2013, 04:20
Default [Solved] Implementing and linking your own limiter
  #6
New Member
 
Lorenzo A. Ricciardi
Join Date: Mar 2011
Posts: 27
Rep Power: 6
lichmaster is on a distinguished road
I finally managed to implement and link my own limiter.

Just follow the tutorial for "How to implementi your own turbulence model" you can find on the internet, and code your scheme.
Then, create a Make folder, with a "files" and an "options" file inside it.
In the "files" file you have to write, for instance

Code:
myLimiterSourceCode.C

EXE = $(FOAM_USER_LIBBIN)/libMyLimiter
In your options file you have to link all relevant libraries, for example

Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
    -lfiniteVolume \
    -lmeshTools
When I compiled it with wmake libso I got a new libNULL.so in my Make/Linux64GCCDPOpt folder (probably I could specify the name of my library, I have to figure it out how to do so).

I copied the libNULL.so into my platforms/Linux64GCCDPOpt/lib and renamed it as libMyLimiter.so

Finally, to make it available, as suggested by wyldckat (thank you very much!), i hard linked it into my ControlDict file like

Code:
libs ("libMyLimiter.so");
You will now find it among the available limiters' list, and you will be able to use it
wyldckat likes this.
lichmaster is offline   Reply With Quote

Old   February 21, 2013, 03:47
Default
  #7
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
What I was missing was to copy it to platform, thanks for the step by step guide
anishtain4 is offline   Reply With Quote

Old   February 21, 2013, 04:05
Default
  #8
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
I tired to add this to foamwiki but I couldn't figure out how to do it, any hint?
anishtain4 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
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


All times are GMT -4. The time now is 07:21.