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

[swak4Foam] timevaryingmappedFixedValue inside groovyBC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 7, 2016, 07:59
Default timevaryingmappedFixedValue inside groovyBC
  #1
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Hi foamers,

i am trying to define a boundary condition, between my fluid and a solid, on the temperature. This BC needs a spatial dependent value of the convection coefficient h and a time-dependent value of the solid temperature.

To define the spatial dependence of the h coefficient i have used the groovyBC utility and i have succeed to make my job work with a constant value of Tp.

But for Tp, can i use timeVaryingMappedFixedValue, inside the groovyBC?
Because i don't see another way to do the time-dependence.

Thank you evrybody.
Laurent
laurentD is offline   Reply With Quote

Old   October 8, 2016, 12:39
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by laurentD View Post
Hi foamers,

i am trying to define a boundary condition, between my fluid and a solid, on the temperature. This BC needs a spatial dependent value of the convection coefficient h and a time-dependent value of the solid temperature.

To define the spatial dependence of the h coefficient i have used the groovyBC utility and i have succeed to make my job work with a constant value of Tp.

But for Tp, can i use timeVaryingMappedFixedValue, inside the groovyBC?
Because i don't see another way to do the time-dependence.

Thank you evrybody.
Laurent
No. You can't use one boundary condition inside of another. But you can always use the time() function to get the current time. If your time dependence is from a data file you can use a lookup-table in groovyBC. For an example see Examples/groovyBC/wobbler
__________________
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
gschaider is offline   Reply With Quote

Old   October 10, 2016, 07:34
Default
  #3
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Thank you for this answer.

Can i imagine use the timeVaryingMappedFixedValue.C in the groovyBC block ?
I know that it implies to make available the various dependencies of it but the first step is : is it possible ?

Maybe by an include, pointing on the timeVaryingMappedFixedValue.C, previously copied in the right directory...
I feel that swak4foam is much more powerful that it seems.

Thank you very much for your help, i couldn't imagine a better person to discuss about this topic.

Laurent
laurentD is offline   Reply With Quote

Old   October 11, 2016, 06:34
Default
  #4
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
To be as clear as possible, i would like to plug T values directly on points for each time, like with timeVaryingMappedFixedValue, but the process of plugging on points is a bit too complex to be written in the groovyBC block, isn't it ?

It is why i would like to use the existing C++ file to this step.
laurentD is offline   Reply With Quote

Old   October 11, 2016, 08:28
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by laurentD View Post
To be as clear as possible, i would like to plug T values directly on points for each time, like with timeVaryingMappedFixedValue, but the process of plugging on points is a bit too complex to be written in the groovyBC block, isn't it ?

It is why i would like to use the existing C++ file to this step.
I don't quite know what you mean with "plugging on points"? You mean: setting the T-value depending on the time and the position? That is possible.
__________________
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
gschaider is offline   Reply With Quote

Old   October 11, 2016, 10:10
Default
  #6
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Quote:
That is possible
Yes i think so...

My current idea is to re-use the data files used by 'timeVaryingMappedFixedValue' (with a file with temperatures for all points of a patch for each time-step, associated with another file which contains the global coordinates of these points) in a groovyBC process using timelines and lookuptables.

Maybe it will need a light adaptation to make them compatible with groovyBC but curently i think i can do something good.

I have succeed to use groovyBC with lookuptables this summer but i have never used the 'timelines' utility. So i will begin my work by an understanding of the way of use of it.

I will warn you about my adventures.

Thanks a lot.
Laurent
laurentD is offline   Reply With Quote

Old   October 12, 2016, 05:48
Default
  #7
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Does a complete documentation of the groovyBC exist ?
laurentD is offline   Reply With Quote

Old   October 13, 2016, 06:45
Default
  #8
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
To achieve my objective, i have to define a value for the temperature for each time and for each point.
How can i do it ?

Because the 'lookuptable' utility doesn't want file with ((x,y,z) T) for example.

So can i use the numbering of the points ?
Or another method that anybody knows ?

Thanks.
Laurent
laurentD is offline   Reply With Quote

Old   October 14, 2016, 05:33
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by laurentD View Post
I have succeed to use groovyBC with lookuptables this summer but i have never used the 'timelines' utility. So i will begin my work by an understanding of the way of use of it.
"timeline()" is basically a shorthand for "lookup1D(time())"

Quote:
Originally Posted by laurentD View Post
Does a complete documentation of the groovyBC exist ?
There is a complete documentation of the expressions (which is the most important part) in the Documentation-folder (the incomplete reference guide). All other parts (description of function objects etc) will get written when I have the time

Quote:
Originally Posted by laurentD View Post
To achieve my objective, i have to define a value for the temperature for each time and for each point.
How can i do it ?

Because the 'lookuptable' utility doesn't want file with ((x,y,z) T) for example.

So can i use the numbering of the points ?
Or another method that anybody knows ?
The maximum I can offer ist the 2D-lookuptables. Look for lookuptables2D in the reference guide (you seem to need 4 dimensions)

Using point numbering is not a good idea as that would break with a change of the mesh (or even a simple renumbering. Or decomposition). You can get the face number with "id()" but I don't think this is practical
__________________
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
gschaider is offline   Reply With Quote

Old   October 14, 2016, 10:26
Default
  #10
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Quote:
Originally Posted by gschaider View Post
"timeline()" is basically a shorthand for "lookup1D(time())"
Ok i understand.

Quote:
Originally Posted by gschaider View Post
There is a complete documentation of the expressions (which is the most important part) in the Documentation-folder (the incomplete reference guide). All other parts (description of function objects etc) will get written when I have the time
Hope you will have the time because your tool is very powerful but need a documentation to spread in the OF community. It is not a critic, i know time is expensive.

Quote:
Originally Posted by gschaider View Post
The maximum I can offer ist the 2D-lookuptables. Look for lookuptables2D in the reference guide (you seem to need 4 dimensions)
Yes i have seen that. Maybe a part of the soluce.

Quote:
Originally Posted by gschaider View Post
Using point numbering is not a good idea as that would break with a change of the mesh (or even a simple renumbering. Or decomposition). You can get the face number with "id()" but I don't think this is practical
I am thinking about a special numbering based on the coordinates x, y and z and in a scalar-form. I will inform you if i have results.

For the moment, two questions :
- Can i ask to a valueExpression to use an integer part of a variable ? (int() doesn't work)
- I am trying to use pts() but i have an error (unexpected TOKEN points). What do i have to do to use it ? Because my input datas used to define the BC are defined on points...

Have a good day,
Laurent
laurentD is offline   Reply With Quote

Old   October 17, 2016, 06:09
Default
  #11
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Concerning the integer part, the fonctionality i have to use is floor(). But it needs to include math.h.
Can i do that ? I mean inside groovyBC.
laurentD is offline   Reply With Quote

Old   October 17, 2016, 06:45
Default
  #12
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Concerning the integer part, the fonctionality i have to use is floor(). But it needs to include math.h.
Can i do that ? I mean inside groovyBC.
laurentD is offline   Reply With Quote

Old   October 17, 2016, 09:54
Default
  #13
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Concretely, i have to take into account the time but in seconds, so the integer part of the current time. How can i do that ?
Any ideas are welcome.
L.
laurentD is offline   Reply With Quote

Old   October 17, 2016, 11:09
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by laurentD View Post
Concretely, i have to take into account the time but in seconds, so the integer part of the current time. How can i do that ?
Any ideas are welcome.
L.
There currently is neither ceil nor floor implemented in swak4Foam as 'I rarely see the need for it. You can work around it using the modulo-operator % (note that a%b maps to [-b/2,b/2]). Getting the interger part of time() should work with something like "time()-((time()-0.5)%1+0.5)" (but check that before really using it)
__________________
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
gschaider is offline   Reply With Quote

Old   October 17, 2016, 11:22
Default
  #15
Senior Member
 
Laurent DASTUGUE
Join Date: May 2014
Location: Chartres, France
Posts: 122
Rep Power: 11
laurentD is on a distinguished road
Thank you very much, i will take a look on it.

By my side i was thinking about a kind of tabular with (1 1) (2 2).
By this way if i define the second value depending of the first by B(A), i can expect an integer as a result.

But i need a constant result (and not a ramp) between two bounds and i don't really trust on the outOfBounds utility.
For example when i use "outOfBounds toto;"
it seems to work...

L.
laurentD 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] SHM error: inside mesh not possible Naresh yathuru OpenFOAM Meshing & Mesh Conversion 1 January 10, 2017 23:58
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
Modelling the Heat flow inside the curing oven Marios Vlad CFX 1 February 6, 2008 07:11
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 09:29.