CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   ramp inlet velocity initial condition using timeVaryingMappedFixedValue (http://www.cfd-online.com/Forums/openfoam-solving/105438-ramp-inlet-velocity-initial-condition-using-timevaryingmappedfixedvalue.html)

pepe.aero July 31, 2012 04:02

ramp inlet velocity initial condition using timeVaryingMappedFixedValue
 
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

wyldckat July 31, 2012 04:09

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.

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

Best regards,
Bruno

pepe.aero July 31, 2012 04:40

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

wyldckat July 31, 2012 04:47

Hi Andrea,

Read this thread: http://www.cfd-online.com/Forums/ope...lefile-bc.html ;)
In post #7 I make a reference to the polynomial BC...

Best regards,
Bruno

pepe.aero July 31, 2012 04:52

Thank you very much.
I read it soon and I will get back to you if necessary.

Kind regards,

Andrea

pepe.aero July 31, 2012 05:48

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

wyldckat July 31, 2012 06:38

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

pepe.aero July 31, 2012 06:48

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....

wyldckat July 31, 2012 17:37

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

pepe.aero August 1, 2012 03:58

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

wyldckat August 1, 2012 05:05

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: http://www.cfd-online.com/Forums/ope...ross-wind.html - read the whole thread, because there are some details that need to be taken into account ;)
Best regards,
Bruno

pepe.aero August 2, 2012 11:19

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

maalan March 4, 2013 14:16

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!!

Raymond.Leoi July 31, 2013 05:50

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

wyldckat August 17, 2013 13:35

Greetings Raymond,

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

Raymond.Leoi August 19, 2013 04:59

Quote:

Originally Posted by wyldckat (Post 446337)
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

wyldckat August 22, 2013 07:17

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: http://www.cfd-online.com/Forums/ope...tml#post447189 post #8

Best regards,
Bruno


All times are GMT -4. The time now is 09:03.