CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to express sin(w*t) in openFoam (https://www.cfd-online.com/Forums/openfoam/108639-how-express-sin-w-t-openfoam.html)

Chandler October 29, 2012 08:57

How to express sin(w*t) in openFoam
 
Hello everyone. I want to add sin(w*t) in my openFoam solver, but I have no idea about using the current time value. Can anyone help? Thank you!

adhiraj October 29, 2012 10:08

Does this work?
Code:

scalar t=runTime.value();
f=Foam::sin(w*t);


Chandler October 29, 2012 23:25

It helps, thank you!


All times are GMT -4. The time now is 05:06.