CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

how to use the "tableFile" BC?

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

Like Tree6Likes
  • 2 Post By wyldckat
  • 1 Post By sawyer86
  • 3 Post By sawyer86

Reply
 
LinkBack Thread Tools Display Modes
Old   March 21, 2012, 09:43
Default how to use the "tableFile" BC?
  #1
Member
 
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 5
sawyer86 is on a distinguished road
Hi there,

I am quiete new in OF and I saw that the feauteres i am going to discuss about was set in the last release of OF, the 2-1-0.

My idea is to set a table of value (the three components of the velocity field) as a boundary condition just in the INLET.

My question are:

-What's the type of file request to use this feauteres (CSV, FoamFile, something else...?), and how can I get it?
-How specify the points or the faces where the values must be applied?


uniformValue tableFile;
tableFileCoeffs
{
fileName "$FOAM_CASE/myDataFile"
outOfBounds clamp;
}


Thank you very much in advance...And really, if you can, give me an help because i am really freaking out...

Regards
sawyer86 is offline   Reply With Quote

Old   March 21, 2012, 18:12
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 Tom,

If I remember correctly, the example you are using is from here: http://www.openfoam.org/version2.1.0...conditions.php

Namely this one:
Quote:
OpenFOAM table file
Code:
uniformValue     tableFile;       
tableFileCoeffs       
{       
    fileName     "$FOAM_CASE/myDataFile"       
    outOfBounds  clamp;       
}
The file "myDataFile" is placed in the folder of your case and should have contents like these:
Code:
(       
    (  0   0.0)       
    (100  10.0)       
);
As you can see, this content is the same as using the inline table!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   March 22, 2012, 07:23
Default
  #3
Member
 
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 5
sawyer86 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Tom,

If I remember correctly, the example you are using is from here: http://www.openfoam.org/version2.1.0...conditions.php

Namely this one:
The file "myDataFile" is placed in the folder of your case and should have contents like these:
Code:
(       
    (  0   0.0)       
    (100  10.0)       
);
As you can see, this content is the same as using the inline table!

Best regards,
Bruno
Hi Bruno,

Thank you very much for your answer! i really appreciate!

By the way I realize that this features doesn't match exactly with what I woul like to do,,,In first istance I though it could.

By the way my problem is to set a velocity field, extract from a y-z plane at a given x-position, as BC at the inlet without timeVarying, that is constant in time...Do you know how is it possible to do it in OF? do you even know how can I extract the plane in the same format as OF want it to be read?

Thank you in advance and I am sorry to disturb you but even If I saw something similar in the previous thread I am not able to manage it
vivekcfd likes this.
sawyer86 is offline   Reply With Quote

Old   July 13, 2012, 08:06
Default read and interpolate CSV data to inlet
  #4
Member
 
Vivek Kumar
Join Date: Mar 2009
Location: Switzerland
Posts: 34
Blog Entries: 1
Rep Power: 8
vivekcfd is on a distinguished road
Hi Tom

I am facing exactly the same problem as you did. I found OpenFoam quite impressive, however got stuck in handling things.

I have a csv file which contains information on velocity profile, coordinates etc. My problem is that I am unable to find how to read and interpolate the values of velocity profile data from this csv file to a inlet boundary.
This requires following two steps:

1. read the csv file which contains velocity etc. fields for a given plane

2. interpolate variable from the mesh in the csv to the inlet boundary patch.

Could some help in this matter. This would be highly helpful.


Many thanks
Quote:
Originally Posted by sawyer86 View Post
Hi Bruno,

Thank you very much for your answer! i really appreciate!

By the way I realize that this features doesn't match exactly with what I woul like to do,,,In first istance I though it could.

By the way my problem is to set a velocity field, extract from a y-z plane at a given x-position, as BC at the inlet without timeVarying, that is constant in time...Do you know how is it possible to do it in OF? do you even know how can I extract the plane in the same format as OF want it to be read?

Thank you in advance and I am sorry to disturb you but even If I saw something similar in the previous thread I am not able to manage it
vivekcfd is offline   Reply With Quote

Old   July 13, 2012, 11:20
Default
  #5
Member
 
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 5
sawyer86 is on a distinguished road
Quote:
Originally Posted by vivekcfd View Post
Hi Tom

I am facing exactly the same problem as you did. I found OpenFoam quite impressive, however got stuck in handling things.

I have a csv file which contains information on velocity profile, coordinates etc. My problem is that I am unable to find how to read and interpolate the values of velocity profile data from this csv file to a inlet boundary.
This requires following two steps:

1. read the csv file which contains velocity etc. fields for a given plane

2. interpolate variable from the mesh in the csv to the inlet boundary patch.

Could some help in this matter. This would be highly helpful.


Many thanks

Hi,

i started this thread a long time ago, and I have solved the problem in the followinf way:

(as I said I needed to extract a slice in the plane y-z at a given x and make it boundary condition at the inlet)

First of all I do a sample of the plane I need...comand "sample -..." in OpenFOAM to get a slice...To do that you need the sampleDict file where you can specify many things. The most important is to set the variable to get the output as "FoamFile".

In that case for you case a "surfaces" folder will be create. Inside it you can find a new folder with many files: "points", "faceCenter" and then a folder where there is the field you decide to extract. Now the real issue is to understand how the data are printed. Infact if you compare the faceCenter file and the field you get, they have the same number of rows and the number at line 3 should be the same. Well, as I understood, but do not ask me why it does that, this number is just the double of the cell in that plane you extract; and the points in the "faceCenter" file are the vertex staggered of the cell. If you want to use the file you extracted as BC you should just select the half number or rows and read only the 1line, the 3th line, the 5th line and so on, since you can easy realize they are the same each two lines.

Once you do that this is the field as openFOAM want to read it. To add this last as Bc you should put in the BC file:

inlet
{
type fixedValue;
value nonuniform List<vector>
1600
(
...
)

};
...

in my case for example "1600" was the number of cell (you can check with the "checkMesh" command in your case), while what I found in the extracted file was just 3200.

I do not know if your problem is just the one I had. But since I started this thread I wanted to give the solution I found which maybe is not geek-able but it works!

Cheers
sawyer86 is offline   Reply With Quote

Old   July 26, 2012, 22:18
Default
  #6
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 5
tomloh is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Tom,

If I remember correctly, the example you are using is from here: http://www.openfoam.org/version2.1.0...conditions.php

Namely this one:
The file "myDataFile" is placed in the folder of your case and should have contents like these:
Code:
(       
    (  0   0.0)       
    (100  10.0)       
);
As you can see, this content is the same as using the inline table!

Best regards,
Bruno
Hi Bruno,

You seem to know a bit about how to use unsteady BC. I am using flowRateInletVelocity BC and would like to ramp the flow rate from 0.00 to 0.00397. I was wondering if you could help me, so far I have the following for my 0/U BC at the inlet:

inlet
{
type flowRateInletVelocity;
flowRate tableFile;
tableCoeffs
{
fileName "turbxitFlowRate";
outOfBounds clamp;
}
value uniform (1 0 0);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
turbxitFlowRate.dat file:
(
(0 0)
(1000 0.00397)
);

Any help you could offer me is greatly appreciated,
Tom
tomloh is offline   Reply With Quote

Old   July 29, 2012, 18:34
Default
  #7
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 Tom,

Have you tried the "uniformValue polynomial" instead of tabulated values? http://www.openfoam.org/version2.1.0...conditions.php

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 30, 2012, 00:27
Default
  #8
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 5
tomloh is on a distinguished road
Hi Bruno,

I managed to get my previous code working. Thank you very much for your help and replies though.

Kind Regards,
Thomas Loh
tomloh 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



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