CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

ramp inlet velocity initial condition using timeVaryingMappedFixedValue

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

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   July 31, 2012, 05:02
Default ramp inlet velocity initial condition using timeVaryingMappedFixedValue
  #1
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Hi everybody,

I'm trying since days to assign a ramp shape inlet velocity initial condition, that could be crucial for my CFD simulation.
I'm trying to do it using the type timeVaryingMappedFixedValue for the boundaryFields called INLET in the velocity file in the "0" directory.
Unfortunately I'm not been able to use it properly.

Is this the correct tool for such a aim?
Has someone already use the ramp inlet for 3D velocity? If yes, could you post an example please?

Thank you very much for your support. I remain at your disposal for further explanations.

Yours sincerely,

Andrea
pepe.aero is offline   Reply With Quote

Old   July 31, 2012, 05:09
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Andrea,

If I understand you correctly, you want to create a velocity profile that is shaped like a ramp, correct? Then maybe the tutorial "incompressible/simpleFoam/pitzDailyExptInlet" would be a good reference.

In the folder "constant/boundaryData/inlet" is defined the points used as placement for the values to be defined and in the "constant/boundaryData/inlet/0" folder are the values (profiles) defined for the previously mentioned points.

Mmm, the tutorial is indeed using the "timeVaryingMappedFixedValue" BC... then what's the problem exactly?

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   July 31, 2012, 05:40
Default
  #3
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Hi Bruno,
thank you very much for your reply.
I had already noticed the tutorial you mentioned but I now realize that maybe I was using in the wrong way the timeVaryingMappedFixedValue type. So, thanks again for your support.

But in the end my doubt remains: I'm looking for a time-varying inlet condition, not spatial.
To explain it better: I would like that my input inlet boundary velocity condition will start from the 0 value, and grow up to my desired fixed value in a fixed time (it grows iteration by iteration, till the regime value). And this transient should have a ramp shape....or a 1/4 sinusoidal shape...etc...

Can the timeVaryingMappedFixedValue do this in your opinion?

Hope this could help to understand the issue. Thanks again!

Andrea
pepe.aero is offline   Reply With Quote

Old   July 31, 2012, 05:47
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Andrea,

Read this thread: how to use the "tableFile" BC?
In post #7 I make a reference to the polynomial BC...

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   July 31, 2012, 05:52
Default
  #5
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Thank you very much.
I read it soon and I will get back to you if necessary.

Kind regards,

Andrea
pepe.aero is offline   Reply With Quote

Old   July 31, 2012, 06:48
Default
  #6
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Dear Bruno,

trying to use the polynomial BCs, as you suggest, I write the following lines in the 0/U file:

INLET
{
type uniformFixedValue;
uniformValue polynomial
(
(0.1 0)
(1.3 2.0)
(2.7 3.0)
);

to reproduce the example of your post. http://www.openfoam.org/version2.1.0...conditions.php

I've tried on two different system: on my notebook, where the 2.1.1 version is installed the following error is reported:

Reading field U



--> FOAM FATAL ERROR:
Unknown DataEntry type polynomial for DataEntry uniformValue

Valid DataEntry types are:

5
(
CompatibilityConstant
constant
csvFile
table
tableFile
)



From function DataEntry<Type>::New(const word&, const dictionary&)
in file /home/andrea/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/DataEntryNew.C at line 57.

FOAM exiting



while on the cluster on which I'm working, where the v2.1.0 is installed:

Reading field U



--> FOAM FATAL ERROR:
Unknown DataEntry type polynomial for DataEntry uniformValue

Valid DataEntry types are:

4
(
constant
csvFile
table
tableFile
)



From function DataEntry<Type>::New(Istream&)
in file /data/apps_exa/bin/OpenFOAM//OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/DataEntryNew.C at line 48.

FOAM exiting


This sounds me really odd, because in the page you posted to me it is clearly stated that this new feature has been implemented in the OpenFOAM v2.1.0

What is your opinion about it?
Thanks again, I really appreciate you help!

Andrea
pepe.aero is offline   Reply With Quote

Old   July 31, 2012, 07:38
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Andrea,

It looks like the polynomial option is only valid for scalar fields. Which means that vector fields such as "U" will not work

Checking the header in "src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H":
Quote:
Polynomial container data entry for scalars. Items are stored in a list of Tuple2's. Data is input in the form, e.g. for an entry <entryName> that describes y = x^2 + 2x^3
Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   July 31, 2012, 07:48
Default
  #8
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Hi,

I've tried to apply the polynomial law to a scalar field for the same problem but the error reported is the same posted above. I really don't understand....
pepe.aero is offline   Reply With Quote

Old   July 31, 2012, 18:37
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Andrea,

Looks like this is a bug... I've reported this here: http://www.openfoam.org/mantisbt/view.php?id=607

I'm going to look into the code to see if I can figure out why it's not working as intended... but I doubt I'll be able to figure it out

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   August 1, 2012, 04:58
Default
  #10
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Thank you Bruno.

In the meantime I will try to use the csv file with my tabulated data. About this, I think I should fill the table just with the 3 components of velocity (3 columns) and each row correspond to a single time step. Is this right in your opinion?

Have you already tested the csv file mode?

Kind regards, Andrea
pepe.aero is offline   Reply With Quote

Old   August 1, 2012, 06:05
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Andrea,

OK, the polynomial bug has been fixed in the latest 2.1.x: https://github.com/OpenFOAM/OpenFOAM...a3f4646a560477

As for tabled data:
  • When using OpenFOAM's table format, you would use this structure:
    • For scalars:
      Code:
      (       
          (  0   0.0)       
          (100  10.0)       
      );
    • For vectors:
      Code:
      (       
          (  0   (0.0 0.0 0.0))       
          (100  (10.0 10.0 10.0))       
      );
  • When using CSV... I think I've already given an example somewhere in this forum... here we go: Oscilating cross-wind - read the whole thread, because there are some details that need to be taken into account
Best regards,
Bruno
cfdonline2mohsen likes this.
wyldckat is online now   Reply With Quote

Old   August 2, 2012, 12:19
Default
  #12
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 5
pepe.aero is on a distinguished road
Thank you Bruno,

on my notebook, where the 2.1.x is working, everything seems to running well.
On the cluster with OF v2.1.0 the already-known error of the parallel mode is reported.

Thanks for your support, I will work on this unsteady condition and I will get back to you if necessary.

Kind regards,

Andrea
pepe.aero is offline   Reply With Quote

Old   March 4, 2013, 15:16
Default
  #13
Member
 
Join Date: Jun 2011
Posts: 59
Rep Power: 5
maalan is on a distinguished road
Hi there, pepe!

I was wondering if you finally managed this issue as I'm trying to run a ramp velocity inlet past a cylinder but unfortunately I don't get nice results in the pressure field until the ramp has finished... I am using the unifomrFixedValue type and the table. About the table, I guess one must to write the ramp extrema... am I correct?? where is the problem??

Best regards!!
maalan is offline   Reply With Quote

Old   July 31, 2013, 06:50
Default
  #14
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 4
Raymond.Leoi is on a distinguished road
Hi wyldckat,

I'm trying to set up a velocity component varying with y locations (say u_x = -100*y^2 + 200). Can you give me any suggestion for it?

Thanks a lot.
Raymond
Raymond.Leoi is offline   Reply With Quote

Old   August 17, 2013, 14:35
Default
  #15
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings Raymond,

Quick answer: GroovyBC comes to mind:
Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   August 19, 2013, 05:59
Default
  #16
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 4
Raymond.Leoi is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Raymond,

Quick answer: GroovyBC comes to mind:
Best regards,
Bruno
Hi Bruno,

Thanks for your reply. I made up a parabolic profile for velocity inlet like
Code:
    inletL
    {
        type            groovyBC;
        variables       "yp=pts().y;minY=min(yp);maxY=max(yp);rad=0.5*(maxY-minY);vavg=0.23;";
        valueExpression "2.0*vavg*(1.0-pow(pos().y/rad,2))*normal()";
        value           uniform (10 0 0);
    }
Also,
Code:
libs ( "libOpenFOAM.so" "libgroovyBC.so" );
is declared in controlDict. But I got the following error
Code:
Create mesh for time = 0
Reading field p
Reading field U

--> FOAM FATAL IO ERROR: 
keyword boundaryField is undefined in dictionary "/home/parallels/OpenFOAM/..../0/U"

file: /home/parallels/OpenFOAM/..../0/U from line 17 to line 48.

    From function dictionary::subDict(const word& keyword) const
    in file db/dictionary/dictionary.C at line 461.

FOAM exiting
Any suggestion?

Cheers,
Raymond

Last edited by wyldckat; August 22, 2013 at 08:15. Reason: Added [CODE][/CODE]
Raymond.Leoi is offline   Reply With Quote

Old   August 22, 2013, 08:17
Default
  #17
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,517
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Raymond,

Since you asked the same question on two different threads, several days apart, I'll answer to the latest post there, namely at: how to set up inlet velocity profile post #8

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Reply

Tags
inlet, ramp, velocity

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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
transsonic nozzle with rhoSimpleFoam Unseen OpenFOAM Running, Solving & CFD 7 April 16, 2014 04:38
Compressible Nozzle Flow sebastian OpenFOAM Running, Solving & CFD 13 October 21, 2010 06:25
Error log vw.cfd OpenFOAM 6 August 7, 2009 06:44
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


All times are GMT -4. The time now is 08:24.