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

Read boundary data from files with swak4Foam (groovyBC)

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 10, 2014, 18:13
Default Read boundary data from files with swak4Foam (groovyBC)
  #1
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 25
Rep Power: 5
Hugoles is on a distinguished road
Hello,

I'm using timeVaryingMappedFixedValue to import some pre-generated velocity field into my domain. As required by this BC, these data are stored as planes (with a geometry equal to the inlet surface) inside folders named according to the time step. Thus, the simulation looks for the velocity values at a given time step (and interpolates in between) under the corresponding folder under boundaryData.

What I need is to do something similar to the above but for the side boundaries, This is, to make the boundaries to look for the velocity data in stored files, assuming that the flow is advected at a certain mean velocity. My computational domain is a simple rectangular box, so the flow moves tangentially to the side boundaries.

Does someone knows if this can be done using swak4Foam (i.e. groovyBC) or any other utility? From what I have seen in the examples, groovyBC can search for field values within lookuptables but unlike what I need, they would be fixed in time or change according to an expression

Thanks !
Hugoles is offline   Reply With Quote

Old   March 11, 2014, 16:24
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,809
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Hugoles View Post
Hello,

I'm using timeVaryingMappedFixedValue to import some pre-generated velocity field into my domain. As required by this BC, these data are stored as planes (with a geometry equal to the inlet surface) inside folders named according to the time step. Thus, the simulation looks for the velocity values at a given time step (and interpolates in between) under the corresponding folder under boundaryData.

What I need is to do something similar to the above but for the side boundaries, This is, to make the boundaries to look for the velocity data in stored files, assuming that the flow is advected at a certain mean velocity. My computational domain is a simple rectangular box, so the flow moves tangentially to the side boundaries.

Does someone knows if this can be done using swak4Foam (i.e. groovyBC) or any other utility? From what I have seen in the examples, groovyBC can search for field values within lookuptables but unlike what I need, they would be fixed in time or change according to an expression

Thanks !
No. This kind of multidimensional lookup is not implemented in swak. I understand that it would be nice for some people but I haven't needed it yet.

I don't quite understand what are the lookup-variables in your case (or why timeVaryingMapped should not work for "side boundaries")
__________________
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   March 11, 2014, 20:42
Default
  #3
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 25
Rep Power: 5
Hugoles is on a distinguished road
The variables to be read are only velocity values of the pre-generated field at its boundaries (as they coincide to the side boundaries of the computational domain).

TimeVaryingM should also work for the sides, although I haven't tried it there yet. It just requires some more pre-processing to create the planes for each time step. I was curious about how groovyBC could handle this, for example, if it could read the pre-generated field (something like a 0/U file) at the desired regions and from there, set the boundary values at any given time. That would save some pre-processing (or programming an ad hoc BC).

Thanks,
Hugoles is offline   Reply With Quote

Old   March 12, 2014, 18:29
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,809
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Hugoles View Post
The variables to be read are only velocity values of the pre-generated field at its boundaries (as they coincide to the side boundaries of the computational domain).

TimeVaryingM should also work for the sides, although I haven't tried it there yet. It just requires some more pre-processing to create the planes for each time step. I was curious about how groovyBC could handle this, for example, if it could read the pre-generated field (something like a 0/U file) at the desired regions and from there, set the boundary values at any given time. That would save some pre-processing (or programming an ad hoc BC).
I'm sorry. Your question is very vague. So I'm going to answer alike: maybe

(maybe I'm to stupid to understand what you want, but it is my impression that there is some information missing that is obvious to you because it is your problem but for someone not sitting at your desk is unclear. Usually it is a good idea to reread the question before sending it and think "Would somebody who never worked on this problem understand the question?")

If the question was asked like this "I have precomputed velocity values v(x,y,t) for two boundaries at z=1 and z=0. I can't use timeMapped because these values are only the absolute value of the velocity in tangential direction and I want groovyBC to calculate the vector using the patch orientation" (that is one possible interpretation of what you asked) THEN I could give a yes or no answer
__________________
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   March 17, 2014, 10:34
Default
  #5
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 25
Rep Power: 5
Hugoles is on a distinguished road
Hello Bernhard,

What I said in my previous post was intended to be just a comment, rephrasing a bit what I originally asked. You had already replied to my question.

Thanks again for your help,
Hugoles is offline   Reply With Quote

Old   March 19, 2014, 06:11
Default
  #6
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 204
Rep Power: 9
jherb is on a distinguished road
Hello Bernhard,

how hard would it be to add the ability to use Python code in groovyBC (e.g. like in function objects)? Then the lookup (in this example) could be handled by Python.

Joachim
jherb is offline   Reply With Quote

Old   March 19, 2014, 19:16
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,809
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jherb View Post
Hello Bernhard,

how hard would it be to add the ability to use Python code in groovyBC (e.g. like in function objects)? Then the lookup (in this example) could be handled by Python.

Joachim
Not terribly hard. Basically create a boundary condition that double inherits from a regular fvpatchField and the PythonInterpreterWrapper. I even thought about it but the problems I saw are
- exposing the relevant information (face centers etc) to the Python-code
- parallelism
(didn't need it yet and didn't want to start something were testing might be more work than coding it)

Don't see myself doing that in the near future, but of course I accept contributions
__________________
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

Reply

Tags
groovybc, swak4foam, timevaryingfixedmapped

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
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
UDF issue MASOUD Fluent UDF and Scheme Programming 14 December 6, 2012 13:39
External Input Data read as Boundary Conditions uwsa CFX 2 August 12, 2010 03:34
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


All times are GMT -4. The time now is 10:40.