CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

how to define velocity for a circular inlet from a file

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 2 Post By Tobi
  • 2 Post By wyldckat
  • 3 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2014, 04:00
Default how to define velocity for a circular inlet from a file
  #1
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Fellows

I have a circular inlet with a radius R=4 mm which is surrounded by an annulus and I have an inlet boundary file from experimental data as:

PHP Code:
r[m]        <U>[m/s]      <u">[m/s]     <V>[m/s]     <u"v">[m2/s2] 
    0.0000       51.3500        2.4271        0.3063       -0.9264 
    0.0003       51.5537        2.5904        0.3310        0.9904 
    0.0005       51.1199        2.6052        0.2284        0.7745 
    0.0008       50.7026        2.7016        0.2807        0.7238 
    0.0010       50.2622        2.9098        0.3242        2.5900 
    0.0013       49.8528        3.2504        0.2703        3.2164 
    0.0015       49.1442        3.4229        0.2676        2.9736 
    0.0018       48.3404        3.6807        0.2456        3.7594 
    0.0020       47.4366        3.7990        0.2525        4.2001 
    0.0022       46.1662        4.0460        0.1636        4.9178 
    0.0025       44.9207        4.1902        0.2234        4.8890 
    0.0027       43.1457        4.5092        0.0299        5.3801 
    0.0030       41.5304        4.6757        0.0201        5.1691 
    0.0032       39.2590        4.8087       -0.0004        5.5684 
    0.0035       36.2186        5.1897       -0.0851        5.6541 
    0.0037       31.1781        6.2540       -0.0154        5.8344 
    0.0040       15.5284        5.9890        0.2606        2.1353 
    0.0043        1.8618        0.5309       -1.2781        0.0585 
    0.0045        0.6689        0.2316       -1.8449       -0.0291 
    0.0050        0.5267        0.2335       -1.0840        0.0122 
    0.0060        0.3520        0.0847       -0.1164        0.0057 
would somebody PLZ hint me how can I define my velocity inlet values in OpenFOAM correctly from this file?

Best,
Bobi
babakflame is offline   Reply With Quote

Old   September 10, 2014, 04:41
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Bobi,

you can handle some inlet bc with groovy.
At the moment I think you have the ability to do it by your own that means defining all velocitys manual in groovy. Maybe you also have some abilitys to get access to your data file and make it easier. At least may be there is some available BC for OpenFOAM like codedFixedValue.

My first suggestion is using groovy BUT I remember that there was some BC that uses values out of a file (maybe just time dependend variables).

For groovy you should have sth. like:
Code:
type groovyBC;
valueExpression "pos().x < 0.0003 ? vector(0 51.35 0) : pos().x < 0.0005 ? vector(0 51.5531 0) . . . : 0.3520";
value uniform (0 0 0);
You also can use some variables etc. I think Bernhard has much more nicer solutions in groovy than mine. But it will work.
If you can make a fitting curve (polynomial or other function), then you can implement the function and let the function do all the work like:
Code:
type groovyBC;
variables "f= 42*pow(e,pos().x-0.23);e=2.71828182845904";   // just an example
valueExpression "vector(0, f, 0)";
value uniform (0 0 0);
babakflame and zhanglh13 like this.
__________________
Keep foaming,
Tobias Holzmann

Last edited by Tobi; September 10, 2014 at 05:46.
Tobi is offline   Reply With Quote

Old   September 13, 2014, 10:07
Default
  #3
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Tobi

Many thanks for your kind hints.

Actually, I was familiar with groovyBC. Accordingly, I have used this formulation which is derived from poiseuille fully developed flow. However, this formulation is not sufficiently accurate. (In this formulation Y-axis is the axis of Cylinder). This is the formulation I have used:

Code:
FUEL
    {
        type                groovyBC;
        variables        "Vm=54;Xp=pos().x;Zp=pos().z;h=0.004;a=-Vm/(h*h);b=Vm;";    
    fractionExpression    "1";
    valueExpression        "vector(0, a*((Xp*Xp)+(Zp*Zp))+b, 0)";
    value            uniform (0 0 0);

    }
Nonetheless, My preference is using input files since I am working on LES error simulation. I have read this link:
http://www.openfoam.org/version2.1.0...conditions.php

However, My problem is the format of input file I tried some but the file format was not accepted. Have you ever done this before, If hopefully yes is it possible to upload a file according to the following :

CSV file

uniformValue csvFile;
csvFileCoeffs
{
fileName "$FOAM_CASE/myDataFile"
outOfBounds clamp;
hasHeaderLine true;
refColumn 0;
componentColumns (0 1 2); // vector example
}



polynomial

uniformValue polynomial // y = 0.1 + 1.3x^2 + 2.7x^3
(
(0.1 0)
(1.3 2.0)
(2.7 3.0)
);



Best Regards
Bobi

Last edited by babakflame; September 13, 2014 at 11:20.
babakflame is offline   Reply With Quote

Old   September 13, 2014, 15:57
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
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 to all!

@Bobi:
  1. Which OpenFOAM version are you using?
  2. Have you read this thread: http://www.cfd-online.com/Forums/ope...ross-wind.html - it gives details on how to use CSV for a boundary condition.
Best regards,
Bruno
babakflame and M.W.G. like this.
__________________
wyldckat is offline   Reply With Quote

Old   September 13, 2014, 16:26
Default
  #5
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Bruno

Many thanks for your quick reply.

1. I am using OpenFOAM 2.1.x

2. I am going to take a deep look at your link.

Best Regards
Bobi
babakflame is offline   Reply With Quote

Old   September 14, 2014, 08:36
Default
  #6
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Bruno

Many thanks for your link. I read your link carefully. Nonetheless, your link was about time dependent inlet velocities. I think this does not work out for me quite well, since my case (the uploaded file in the first post of this thread) does not vary with time but vary with location. The only thing that comes to my mind is changing the header of your example from:

Code:
Time, Ux, Uy, Uz
to:

Code:
X, Y, Z, Ux, Uy, Uz
and put the vectors of location in the columns related to space coordinates ( I mean X, Y, Z)

However, is it correct ,i mean is this the way to define space dependent inlet boundary files?

Any hint is appreciated.

Best Regards
Bobi
babakflame is offline   Reply With Quote

Old   September 14, 2014, 09:29
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
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
Hi Bobi,

Oh, sorry, I didn't notice that important detail

OK, then AFAIK, there isn't a BC ready made in OpenFOAM 2.1.x to do that.
You'll have to code your own BC. You can use as references the following BCs:
  • "parabolicVelocity", for ideas on how to build your own BC: Compile boundary condition as a new dynamic library post #10
  • "uniformFixedValue", for ideas on how to use the table values, i.e. from CSV file. This BC is located at "src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue".
  • There is a BC introduced in OpenFOAM 2.2 or 2.3, named "externalCoupledMixed". The related tutorial is "heatTransfer/buoyantSimpleFoam/externalCoupledCavity".
There is also the tutorial "incompressible/simpleFoam/pitzDailyExptInlet", but this requires you to change from CSV to the specific format that OpenFOAM uses.

I don't have enough time to look further into this myself

Good luck! Best regards,
Bruno
fumiya, babakflame and jadidi.cfd like this.
wyldckat is offline   Reply With Quote

Old   September 23, 2015, 02:31
Default
  #8
New Member
 
Mitchell Baum
Join Date: Sep 2015
Location: Australia
Posts: 7
Rep Power: 11
Mitchell Baum is on a distinguished road
Hi Bobi,

I also require a similar application of a time independent, spatially varying inlet velocity profile which I have determined from experimental data. Have you made any further progress on this since your last post?

Any guidance is greatly appreciated!

Kind regards,
Mitchell
Mitchell Baum is offline   Reply With Quote

Reply


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
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 12:32
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
2.0.x on Mac OSX niklas OpenFOAM Installation 74 March 28, 2012 17:46
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 11:19


All times are GMT -4. The time now is 23:56.