CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Help creating a field function to create a sine pressure wave (https://www.cfd-online.com/Forums/star-ccm/85052-help-creating-field-function-create-sine-pressure-wave.html)

 Pleb February 16, 2011 07:56

Help creating a field function to create a sine pressure wave

Hi all, i'm having problems creating a fluctuating pressure inlet through a pipe.
I need to create a sine wave of around 1000 Hz with an amplitude of 10 Pa and a mean pressure of 100 Pa.

This is what i have done below in Matlab:

t=0:0.01:10;
Pmean=100;
Pamplitude=10;
f=1000;
w=2*3.14*f;

Ptime=Pmean+Pamplitude*sin(w*t);

How on earth do i transfer this into a field function? Is a field function the right way to go about this?

 and_ February 16, 2011 10:24

Yes a field function is the right way.
The definition of your field function should be something like the following:

100+10*sin(2*3.14*1000*\$Time)

 Pleb February 17, 2011 13:16

Quote:
 Originally Posted by and_ (Post 295529) Yes a field function is the right way. The definition of your field function should be something like the following: 100+10*sin(2*3.14*1000*\$Time)

That appears to work perfectly, thanks a lot! :)

 All times are GMT -4. The time now is 16:23.