CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Rectangular pulse as field function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2014, 08:30
Default Rectangular pulse as field function
  #1
New Member
 
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12
Jul1731 is on a distinguished road
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
Jul1731 is offline   Reply With Quote

Old   April 3, 2014, 09:09
Default
  #2
Senior Member
 
Robert
Join Date: Jun 2010
Posts: 117
Rep Power: 17
RobertB is on a distinguished road
Velocity is a vector, you will need something like $$Velocity[1] (Y velocity) or use $VelocityMagnitude if you want a scalar.
RobertB is offline   Reply With Quote

Old   April 4, 2014, 09:32
Default
  #3
New Member
 
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12
Jul1731 is on a distinguished road
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 ?
Jul1731 is offline   Reply With Quote

Old   April 4, 2014, 12:54
Default
  #4
New Member
 
Jul
Join Date: Feb 2014
Posts: 4
Rep Power: 12
Jul1731 is on a distinguished road
I have found the solution !!
Thank you for your help !
Jul1731 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
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


All times are GMT -4. The time now is 08:44.