|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Ali Hassan Khan
Join Date: Jan 2018
Location: Tallinn, Estonia
Posts: 2
Rep Power: 0 ![]() |
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: ![]() 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. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Aditya Rathore
Join Date: May 2022
Posts: 1
Rep Power: 0 ![]() |
Did you get the solution? I am getting the same error.
|
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 ![]() ![]() |
Quote:
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. |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
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 |