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

Time varying velocity inlet boundary conditions using TableFile.H

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 27, 2015, 16:22
Default Time varying velocity inlet boundary conditions using TableFile.H
  #1
Member
 
Pruthvi
Join Date: Feb 2014
Posts: 38
Rep Power: 3
pruthvi1991 is on a distinguished road
Hello everybody,

I want to give time varying velocity BC at the inlet, top and bottom as v = v*sin(w*t) for an accelerating frame of reference problem.

My topAndBottom BC looks like this:

Code:
topAndBottom
{
        type uniformFixedValue;
        uniformValue tableFile;
        tableFileCoeffs
        {
            dimensions          [0 1 -1 0 0]; // optional dimensions
            fileName           "/home/jujja/OpenFOAM/root-2.3.x/run/tutorials/incompressible/pimpleDyMFoam/onemeterplate/coarseMesh/pimpleFoam_heavingframe/data/dataFile";    // name of data file
            outOfBounds         repeat;       // optional out-of-bounds handling
            interpolationScheme linear;      // optional interpolation method
        };
}
My dataFile looks as follows

Quote:
(
0 (0.025 0.0 0)
0.1 (0.025 0.00313333083911 0)
0.2 (0.025 0.00621724717912 0)
0.3 (0.025 0.00920311381712 0)
. . . . .
);
Here is the description found on the OpenFOAM github. TableFile.H

Code:
    Templated table container data entry where data is read from file.
    \verbatim
        <entryName>   tableFile;
        tableFileCoeffs
        {
            dimensions          [0 0 1 0 0]; // optional dimensions
            fileName            dataFile;    // name of data file
            outOfBounds         clamp;       // optional out-of-bounds handling
            interpolationScheme linear;      // optional interpolation method
        }
    \endverbatim
    Items are stored in a list of Tuple2's. First column is always stored as
    scalar entries.  Data is read in the form, e.g. for an entry \<entryName\>
    that is (scalar, vector):
    \verbatim
        (
            0.0 (1 2 3)
            1.0 (4 5 6)
        );
    \endverbatim
When I ran the case I'm getting an error at the end of decomposePar. Full file is attached decomposePar.txt

Quote:
--> FOAM FATAL IO ERROR:
Expected a '(' while reading Tuple2, found on line 2 the label 0

file: /home/jujja/OpenFOAM/root-2.3.x/run/tutorials/incompressible/pimpleDyMFoam/onemeterplate/coarseMesh/pimpleFoam_heavingframe/data/dataFile at line 2.

From function Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 94.

FOAM exiting[
So I added parenthesis before the scalar entry. This is how my table looks like this now.

Quote:
(
( 0 ( 0.0378 0.0 0 ))
( 0.05 ( 0.0378 0.00012138386402 0 ))
( 0.1 ( 0.0378 0.000242766115999 0 ))
. . . . . .
);
log.decomposePar shows the following error

Quote:
--> FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 2 the punctuation token '('

file: /home/jujja/OpenFOAM/root-2.3.x/run/tutorials/incompressible/pimpleDyMFoam/onemeterplate/coarseMesh/pimpleFoam_heavingframe/data/dataFile at line 2.

From function operator>>(Istream&, Scalar&)
in file lnInclude/Scalar.C at line 93.

FOAM exiting
Does anyone know how to get past this? This seems like a cat and mouse game. Please help people.
pruthvi1991 is offline   Reply With Quote

Old   February 27, 2015, 19:38
Default
  #2
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 178
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Well, according to that error message it would expect a scalar but you are giving a vector. On the quick run I see two things I would try (I had used flowrates only, which obviously are scalars only) :
1. Try, if it works when putting the vector values in quotation marks, e.g.
(
(0 "1 0 0")
);

2. Try if it works to use "uniformFixedVelocity" instead of "uniformFixedValue". I do not know if that BC exists or if it accepts the tableFile-format!

Please let us know if these trials work!
Linse is offline   Reply With Quote

Old   February 28, 2015, 03:26
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,112
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Maybe you should provide example case, as this format of dataFile:

Code:
(
(0 (0.025 0.0 0))
(0.1 (0.025 0.00313333083911 0))
(0.2 (0.025 0.00621724717912 0))
(0.3 (0.025 0.00920311381712 0))
)
passes decomposePar without any errors. Though maybe it is a feature of 2.3.1, and in 2.3.x this functionality is somehow broken.
alexeym is offline   Reply With Quote

Old   March 29, 2015, 01:35
Default Solved
  #4
Member
 
Pruthvi
Join Date: Feb 2014
Posts: 38
Rep Power: 3
pruthvi1991 is on a distinguished road
Hey guys!

Sorry for the late response. I was able to fix the problem by building the case from scratch. I think the issue was with using the same datafile for more than one boundary. The correct format for the values is this

Code:
(
( 0 ( 0.0378 0.0 0 ))
( 0.05 ( 0.0378 0.00012138386402 0 ))
( 0.1 ( 0.0378 0.000242766115999 0 ))
. . . . . .
);
I think this has to be changed in TableFile.H

Thanks,
Pruthvi.
pruthvi1991 is offline   Reply With Quote

Reply

Tags
table data, timevarying

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 6 April 17, 2010 23:40
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 13:36.