|
[Sponsors] |
Calling an external function beforeafter each time step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 12, 2008, 14:35 |
Hi everybody:
I need to mak
|
#1 |
New Member
Alex Schenkman
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
Hi everybody:
I need to make a call to an external function before and after each time step of the solver. This is to be able to interact with other software. I've seen I can compile my own library (foamUser) so my new functions are available for all applications. But I don't know where to go from here. Any pointers are appreciated. Thanks in advance! |
|
December 12, 2008, 15:46 |
Hi Alex!
What you're lookin
|
#2 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Alex!
What you're looking for is called a functionObject. For an example of the usage of those look at $FOAM_TUTORIASL/oodles/pitzDaily/system/controlDict. For examples on the programming of those look at the doxygen or http://openfoamwiki.net/index.php/Co...unctionObjects Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
December 15, 2008, 14:30 |
Thank you Bernhard for your an
|
#3 |
New Member
Alex Schenkman
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
Thank you Bernhard for your answer.
I've looked a bit into Contrib_simpleFunctionObjetcs but I don't get any smarter, =( The README references the script prepareForCompilation.sh, but I cannot find that script. That script is needed for building simpleFunctionObjects, right? I guess I need to create my own functionObject, and I could use your contributed module as a starting point, right? In other words: HELP, I'm still lost! Thank you for you time! |
|
December 15, 2008, 15:26 |
Ok, let's see If I'm getting t
|
#4 |
New Member
Alex Schenkman
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
Ok, let's see If I'm getting this right:
1) I need to subclass functionObject or, even better, simpleFunctionObject. 2) Overriding the write() method I can (in some way) extract data after the solver is ready with a time step. 3) I could use the flush() method to block, and wait for my external function to return some value. Then OF could continue with the next time step. God!, I'm making progress here, :-) |
|
December 16, 2008, 03:41 |
Hi Alex,
Since it would app
|
#5 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40 |
Hi Alex,
Since it would appear that you are trying to achieve a specific task, why not just reassemble your own solver? Take whichever existing solver, copy it under a new name and within the main time-loop just add in your external calls directly. At a later stage you can rework it all to use functionObjects (if desired), but this would get you going very quickly and is a good bit easier to implement. |
|
December 16, 2008, 08:27 |
Mark, thanks for your input!
|
#6 |
New Member
Alex Schenkman
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
Mark, thanks for your input!
The tool I'm trying to build should, ideally, work with minimal modifications to standard installs. This tool should work for other people than me, and then I cannot tell which solver they will choose. |
|
December 16, 2008, 14:08 |
Hi Alex!
That is definitely
|
#7 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Alex!
That is definitely the definition of a functionObject. But (especially if it is your first FO) Mark's suggestion is good practise: make sure that the functionality works, then rework it into a function object. That way you'll know whether the problems you're experiencing are "functionObject problems" or "other problems" Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
December 16, 2008, 14:47 |
Thanks Bernhard!
I was thin
|
#8 |
New Member
Alex Schenkman
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
Thanks Bernhard!
I was thinking on adding a functionObject to the cavity tutorial, to be sure that the application works. What about the script prepareForCompilation.sh? Where can I find it? Thanks! |
|
December 17, 2008, 05:57 |
Hi Alex!
You're on 1.5 aren
|
#9 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Alex!
You're on 1.5 aren't you? You don't need it there. The README was not properly updated when that code was ported to 1.5 (the functionality it was needed for - surface-plots triggered by a function object - is now part of the distribution) But I'll update the README. Thanks for the hint (and it's nice to know that somebody actually reads READMEs ;) ) Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time step size and max iterations per time step | pUl| | FLUENT | 33 | October 23, 2020 23:50 |
SELECTING TIME STEP SIZE, NUMBER OF TIME STEP | NITUL KALITA | FLUENT | 2 | November 22, 2012 09:28 |
Long time CHT transient simulation time step.... | JP | CFX | 0 | May 9, 2008 04:36 |
time step size in Custom Field Function | Tong | FLUENT | 0 | May 2, 2008 16:51 |
start external programm every time step | Ingolf | FLUENT | 0 | March 3, 2003 05:59 |