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

[swak4Foam] Read boundary data from files with swak4Foam (groovyBC)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2014, 17:13
Default Read boundary data from files with swak4Foam (groovyBC)
  #1
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 27
Rep Power: 15
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, 15:24
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 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, 19:42
Default
  #3
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 27
Rep Power: 15
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, 17:29
Default
  #4
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 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, 09:34
Default
  #5
New Member
 
Hugo
Join Date: Jan 2011
Location: Montreal
Posts: 27
Rep Power: 15
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, 05:11
Default
  #6
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
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, 18:16
Default
  #7
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 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


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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 21:00
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
CFD by anderson, chp 10.... supersonic flow over flat plate varunjain89 Main CFD Forum 18 May 11, 2018 07:31
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15


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