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

how to use the "tableFile" BC?

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

Like Tree16Likes
  • 4 Post By wyldckat
  • 1 Post By sawyer86
  • 11 Post By sawyer86

Reply
 
LinkBack Thread Tools Search this Thread 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: 14
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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: 14
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, 09:06
Default read and interpolate CSV data to inlet
  #4
Member
 
Vivek Kumar
Join Date: Mar 2009
Location: Switzerland
Posts: 35
Blog Entries: 1
Rep Power: 17
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, 12:20
Default
  #5
Member
 
Tom
Join Date: Jan 2012
Location: France
Posts: 43
Rep Power: 14
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, 23:18
Default
  #6
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
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, 19:34
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 01:27
Default
  #8
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
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

Old   April 24, 2016, 22:07
Default
  #9
Senior Member
 
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13
harsha_kulkarni is on a distinguished road
Quote:
Originally Posted by tomloh View Post
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
I use the same syntax but got following error

Please supply either 'volumetricFlowRate' or 'massFlowRate' and 'rho'
harsha_kulkarni is offline   Reply With Quote

Old   May 1, 2016, 20:17
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by harsha_kulkarni View Post
I use the same syntax but got following error

Please supply either 'volumetricFlowRate' or 'massFlowRate' and 'rho'
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.
__________________
wyldckat is offline   Reply With Quote

Old   May 3, 2016, 05:47
Default
  #11
Senior Member
 
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13
harsha_kulkarni is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
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.
I am using OpenFOAM version 2.3.1

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);
    }
and one more thing is OutputtoFile is in OpenFOAM format genarate during runtime
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
harsha_kulkarni is offline   Reply With Quote

Old   May 8, 2016, 08:38
Default
  #12
Senior Member
 
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13
harsha_kulkarni is on a distinguished road
Quote:
Originally Posted by harsha_kulkarni View Post
I am using OpenFOAM version 2.3.1

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);
    }
and one more thing is OutputtoFile is in OpenFOAM format genarate during runtime
I want to generate .txt file during runtime, how should I do that
I am using a function object in controldict that will gives a mass flow rate at outlet . values are generating at post processing folder. I want to redirect this value to inlet. So I'm using this table file BC

Last edited by wyldckat; May 8, 2016 at 16:02. Reason: Added [CODE][/CODE] markers
harsha_kulkarni is offline   Reply With Quote

Old   December 28, 2017, 12:03
Default
  #13
New Member
 
Qihao Jiang
Join Date: Dec 2017
Posts: 20
Rep Power: 8
Qihao 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, have you solved this problem now? I face the same problem now.
Qihao is offline   Reply With Quote

Old   December 28, 2017, 12:29
Default Solved
  #14
Member
 
Vivek Kumar
Join Date: Mar 2009
Location: Switzerland
Posts: 35
Blog Entries: 1
Rep Power: 17
vivekcfd is on a distinguished road
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.@
vivekcfd is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On



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