|
[Sponsors] |
March 21, 2012, 09:43 |
how to use the "tableFile" BC?
|
#1 |
Member
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 14 |
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 |
|
March 21, 2012, 18:12 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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:
Code:
( ( 0 0.0) (100 10.0) ); Best regards, Bruno
__________________
|
||
March 22, 2012, 07:23 |
|
#3 | |
Member
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 14 |
Quote:
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 |
||
July 13, 2012, 09:06 |
read and interpolate CSV data to inlet
|
#4 | |
Member
|
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:
|
||
July 13, 2012, 12:20 |
|
#5 | |
Member
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 14 |
Quote:
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 |
||
July 26, 2012, 23:18 |
|
#6 | |
New Member
Join Date: Mar 2012
Posts: 27
Rep Power: 14 |
Quote:
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 |
||
July 29, 2012, 19:34 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Tom,
Have you tried the "uniformValue polynomial" instead of tabulated values? http://www.openfoam.org/version2.1.0...conditions.php Best regards, Bruno
__________________
|
|
July 30, 2012, 01:27 |
|
#8 |
New Member
Join Date: Mar 2012
Posts: 27
Rep Power: 14 |
Hi Bruno,
I managed to get my previous code working. Thank you very much for your help and replies though. Kind Regards, Thomas Loh |
|
April 24, 2016, 22:07 |
|
#9 | |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Quote:
Please supply either 'volumetricFlowRate' or 'massFlowRate' and 'rho' |
||
May 1, 2016, 20:17 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick question: Please provide the complete boundary condition you aer using, to make it easier to diagnose the problem. In addition, please specify which OpenFOAM version you are using.
__________________
|
|
May 3, 2016, 05:47 |
|
#11 | |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Quote:
Code:
Inner { type zeroGradient; } Outer { type flowRateInletVelocity; flowRate tableFile; tableCoeffs. { fileName "$FOAM_CASE/system/OutputtoFile"; outOfBounds clamp; } value uniform (1 0 0); // rho 1000; } Bottom { type fixedValue; value uniform (0 0 0); } Baffle { type fixedValue; value uniform (0 0 0); } Top { type fixedValue; value uniform (0 0 0); } I want to generate .txt file during runtime, how should I do that Last edited by wyldckat; May 8, 2016 at 16:02. Reason: Added [CODE][/CODE] markers |
||
May 8, 2016, 08:38 |
|
#12 | |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Quote:
Last edited by wyldckat; May 8, 2016 at 16:02. Reason: Added [CODE][/CODE] markers |
||
December 28, 2017, 12:03 |
|
#13 | |
New Member
Qihao Jiang
Join Date: Dec 2017
Posts: 20
Rep Power: 9 |
Quote:
|
||
December 28, 2017, 12:29 |
Solved
|
#14 |
Member
|
Yes I indeed solved the problem by making them best decision: not to use openFoam anymore. My time is also money and there is nothing free in the world. Cant afford losing days solving such trivial problems. OF is no go for me although I have developed CFD codes myself, I donot recommend to use in a commercial environment.@
|
|
|
|