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

Inlet boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2021, 07:56
Default Inlet boundary condition
  #1
New Member
 
Ali Hassan Khan
Join Date: Jan 2018
Location: Tallinn, Estonia
Posts: 2
Rep Power: 0
ali_hassan738 is on a distinguished road
Hello Foamers,
I have been trying to implement a velocity boundary condition in OpenFOAM v2012 following up the groovy boundary condition in swak4FOAM tutorial. As in v2012 there is #eval function instead of former #cal function to specify any function rather a value. I want to specify the inlet boundary condition of a parabola in a 2D pipe as

U = U_max (1 - (h/Total Height)^ 2)

vmax= 0.50
height = 0.40
inflow
{
type fixedValue;
value uniform #eval{
vector(($vmax * (1 - pow( pos().y/ $height ), 2) ,0 ,0))
};
}


The problem I am encountering is that the #eval function is prompting a syntax error as:

--> FOAM FATAL IO ERROR: (openfoam-2012)

Syntax error in expression at position:33
<<<<
vector((0.5000000 * (1 - pow(pos().y/ 0.4000000),2),0,0))
^^^^ near here

>>>>


From void Foam:arsing::genericRagelLemonDriver::reportFata l(const string&, size_t) const
in file primitives/strings/parsing/genericRagelLemonDriver.C at line 170.

FOAM exiting

whereas formerly this boundary condition works fine with the groovyBC. I am sure I am missing some information in the syntax.

Any help in this regard will be appreciated.
ali_hassan738 is offline   Reply With Quote

Old   May 11, 2022, 07:45
Default Same error
  #2
New Member
 
Aditya Rathore
Join Date: May 2022
Posts: 1
Rep Power: 0
Aditya Rathore is on a distinguished road
Did you get the solution? I am getting the same error.
Aditya Rathore is offline   Reply With Quote

Old   May 12, 2022, 13:31
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by ali_hassan738 View Post
Hello Foamers,
I have been trying to implement a velocity boundary condition in OpenFOAM v2012 following up the groovy boundary condition in swak4FOAM tutorial. As in v2012 there is #eval function instead of former #cal function to specify any function rather a value. I want to specify the inlet boundary condition of a parabola in a 2D pipe as

U = U_max (1 - (h/Total Height)^ 2)

vmax= 0.50
height = 0.40
inflow
{
type fixedValue;
value uniform #eval{
vector(($vmax * (1 - pow( pos().y/ $height ), 2) ,0 ,0))
};
}


The problem I am encountering is that the #eval function is prompting a syntax error as:

--> FOAM FATAL IO ERROR: (openfoam-2012)

Syntax error in expression at position:33
<<<<
vector((0.5000000 * (1 - pow(pos().y/ 0.4000000),2),0,0))
^^^^ near here

>>>>


From void Foam:arsing::genericRagelLemonDriver::reportFata l(const string&, size_t) const
in file primitives/strings/parsing/genericRagelLemonDriver.C at line 170.

FOAM exiting

whereas formerly this boundary condition works fine with the groovyBC. I am sure I am missing some information in the syntax.

Any help in this regard will be appreciated.



You are mixing way too many things. The #eval directive is a direct expression evaluation without any mesh information. So you can't start putting in something like pos().y() and expect anything useful to happen. For this type of thing you would normally want to use a uniformFixedValue BC and specify that the PatchFunction1 is an expression type. If you do that you will then have access to mesh data - eg, the face centres as pos() - and other things like time() etc. Note, however, that your original equation had a stray ", 2)," in the middle it seems.
olesen 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
Cyclic boundary condition in foam-extend 4.0 rellumeister OpenFOAM Pre-Processing 2 March 3, 2020 08:03
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 04:39
Radiation interface hinca CFX 15 January 26, 2014 17:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05


All times are GMT -4. The time now is 15:17.