CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to use the "tableFile" BC? (http://www.cfd-online.com/Forums/openfoam-solving/98889-how-use-tablefile-bc.html)

sawyer86 March 21, 2012 09:43

how to use the "tableFile" BC?
 
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

wyldckat March 21, 2012 18:12

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

sawyer86 March 22, 2012 07:23

Quote:

Originally Posted by wyldckat (Post 350763)
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 July 13, 2012 08:06

read and interpolate CSV data to inlet
 
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 (Post 350863)
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


sawyer86 July 13, 2012 11:20

Quote:

Originally Posted by vivekcfd (Post 371293)
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

tomloh July 26, 2012 22:18

Quote:

Originally Posted by wyldckat (Post 350763)
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

wyldckat July 29, 2012 18:34

Greetings Tom,

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

Best regards,
Bruno

tomloh July 30, 2012 00:27

Hi Bruno,

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

Kind Regards,
Thomas Loh


All times are GMT -4. The time now is 06:45.