|
[Sponsors] |
March 7, 2022, 11:25 |
Velocity Profile
|
#1 |
New Member
Daniel
Join Date: Feb 2022
Posts: 9
Rep Power: 4 |
I want to add the power law velocity profile as a field function vector,
when I add it it says there's a syntax error. the Velocity is changing in the y coordinate i.e. as y increases so does the velocity. x and z are 0. my input is [0, 12*({Position}/300)^0.28,0] the equation for the y coordinate is V = KnownV at Known Z * (Z/KnownZ) ^0.28. my known z is 300 and known v is 12 can you please help thanks |
|
March 7, 2022, 13:32 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,677
Rep Power: 66 |
Position is a vector.
You need to grab just the y-component it of it using {Position}[1]. I forget off the top of my head if 1 is the y-coordinate, it might be {Position}[2]. You should check. The graphical interface will also let you select (i,j,k components) this if you click in the right places. |
|
March 7, 2022, 15:22 |
|
#3 |
New Member
Daniel
Join Date: Feb 2022
Posts: 9
Rep Power: 4 |
Ive just checked 2 is the y coordinate. so does that mean my vector will just be
[0, 12*(({Position}[2])/300)^0.28, 0] and that will give me a velocity profile on the velocity inlet boundary condition? My domain is from coordinat 0 to 300 so should this be ok for this? Thanks |
|
March 7, 2022, 15:39 |
|
#4 |
New Member
Daniel
Join Date: Feb 2022
Posts: 9
Rep Power: 4 |
Error: function 'User Field Function 1 (UserFieldFunction_1)' compilation error: syntax error
Unable to compile expression "[0,12*(pow((({position}[2])/300),0.28),0]" this is my input and i am getting this error. can you please help ive been trying with the velocity profile all day and im getting nowhere! thanks |
|
March 8, 2022, 22:42 |
|
#5 | |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 436
Rep Power: 17 |
1) Too many parenthesis - also an odd number of them.
2) User '$$' wheh using vector-type Field Function (like Position or Velocity) and single '$' when using scalar-type Field Function. Code:
[0, 12*pow($${Position}[2]/300, 0.28), 0] Quote:
It takes just couple of hourse to read it, I have no idea what you were doing all day. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[UDF] Relative coordinates in logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 25 | July 13, 2017 03:44 |
InterFoam - Validation for velocity profile in simple channel | me.ouda | OpenFOAM Running, Solving & CFD | 0 | October 19, 2015 06:42 |
Logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 0 | April 23, 2009 19:09 |
[boundary condition] logarithmic velocity profile | cfdworker | FLUENT | 2 | April 17, 2009 23:36 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 12:14 |