CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Vortex simulation using field function (https://www.cfd-online.com/Forums/star-ccm/235437-vortex-simulation-using-field-function.html)

mc73 April 14, 2021 14:43

Vortex simulation using field function
 
Hi everyone,


I m currently stuck on my project. I have to simulate 2 vortex. They are created from the Lamb-Oseen equation (tangential velocity).


The equation is : https://www.cfd-online.com/Forums/da...BJRU5ErkJggg==Vtheta(r,t)=(A*(1-exp(-r^2/B^2))/2PI*r
Only 'r' is not a constant.


Therefore, I have to play with the initial velocity.


I tried to practice to simplify the problem: Vtheta(r,t=0)=r



I created a new cylindrical coordinate system. The middle of the vortex is the middle of the system.


Following the user guide, I tried to create a field function but I m stuck on applying it tangentially. I also have the error message: Unable to compute field function on body ... Please check that function is defined here.





I also wonder if it is possible on StarCCM + to have two initial conditions, one linked to a different coordinate system to simulate the two vortices.

If you have any idea of ​​solution for any of the problems, I will be grateful to you.

mc

LuckyTran April 14, 2021 17:22

You can reference local coordinate systems in field functions but it might make your scratch your head A LOT.

$$Position[0] would normally return the x-coordinate

$$Position(@CoordinateSystem("Laboratory.Cylindric al 01 - Popcorn"))[0]

would return the 1st coordinate in my laboratory coordinate system which I have named Cylindrical 01 - Popcorn. You need to replace that string with the literal name of your coordinate system. The rest is properly using the marked flags $ versus $$ and [] depending on whether you want to return a scalar or a vector and so on. Star will do the conversions from one vector representation into another for you, you just need to figure out the syntax.


You can define your vortex initial condition in the local coordinate system as well (define the tangential velocity). Then you can just apply the tangential velocity field at as the initial condition, Star will convert from tangential velocity to x,y,z velocity. Vectors are easy for Star to convert because you are only converting their representations (i.e. projecting them onto different coordinate systems).


All times are GMT -4. The time now is 17:18.