|
[Sponsors] |
April 3, 2014, 08:30 |
Rectangular pulse as field function
|
#1 |
New Member
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12 |
Hi guys,
I am trying to create a field function (first time I am doing that on Star) to make a velocity inlet depending of the time. I want to create a rectangular pulse so I am using a sinusoidal function, and when this function is positive the velocity will be like 80m/s and when it is negative, the velity will be zero. So here is the field function I have created: (sin(352*$Time)>=0) ? $$Velocity=80 : (sin(352*$Time)<0) ? $$Velocity=0 Unfortunately, this function doest not compile. I can't find what I have did wrong ... do you have any ideas where I have done a mistake ? Thank you |
|
April 3, 2014, 09:09 |
|
#2 |
Senior Member
Robert
Join Date: Jun 2010
Posts: 117
Rep Power: 17 |
Velocity is a vector, you will need something like $$Velocity[1] (Y velocity) or use $VelocityMagnitude if you want a scalar.
|
|
April 4, 2014, 09:32 |
|
#3 |
New Member
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12 |
Thank you for your answer.
My code is now compiling but still not working. So I tried to set a field funtion very simple as: $VelocityMagnitude==80 And the velocity keeps to zero ... Do you have any idea where I am doing wrong ? |
|
April 4, 2014, 12:54 |
|
#4 |
New Member
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12 |
I have found the solution !!
Thank you for your help ! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
foamToTecplot360 | thomasduerr | OpenFOAM Post-Processing | 121 | June 11, 2021 11:05 |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 07:27 |