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

Time varying velocity inlet boundary conditions using TableFile.H

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pruthvi1991

Reply
 
LinkBack Thread Tools Search this Thread 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: 41
Rep Power: 12
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: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 16
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,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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: 41
Rep Power: 12
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.
lth likes this.
pruthvi1991 is offline   Reply With Quote

Old   November 4, 2015, 01:22
Default
  #5
Member
 
methma Rajamuni
Join Date: Jul 2015
Location: Victoria, Australia
Posts: 40
Rep Power: 11
meth is on a distinguished road
Quote:
Originally Posted by pruthvi1991 View Post
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.
Hi Pruthvi,

I also want to impose a similar boundary condition (time varying fixed value taken from a table) on the inlet patch. Can you please tell me how your datafile looks like from head to tail. Do we need to put an openFoam header on top or else how should it begin? When I try to do it as you mentioned, got the following error massage when I run the decomposePar
Code:
--> FOAM FATAL IO ERROR: 
Cannot open file.

file: /home/rajamunr/OpenFOAM/rajamunr-2.3.1/old/VIVBad/VIVtest-cylinder-2/cylinder-icoFoam/dataofsolid/distable at line 1.

    From function TableFile<Type>::TableFile(const word&, const dictionary&)
    in file lnInclude/TableFile.C at line 54.

FOAM exiting
meth is offline   Reply With Quote

Reply

Tags
table data, timevarying


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 14:06
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 08:47
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
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 12:55.