CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   SU2 (http://www.cfd-online.com/Forums/su2/)
-   -   Simulating flow for rotating cylinders with a stationary body in the annulus (http://www.cfd-online.com/Forums/su2/125781-simulating-flow-rotating-cylinders-stationary-body-annulus.html)

 diwakaranant October 31, 2013 02:41

Simulating flow for rotating cylinders with a stationary body in the annulus

1 Attachment(s)
Hi,

I wanted to ask that can Rotating frame of reference approach
be used to solve a flow problem consisting of a stationary body located
in the annulus of two rotating cylinders ?

The schematic of the problem is attached with the post.

Thanks
Anant

 economon November 5, 2013 19:44

Hi Anant,

You may want to give the new moving walls option in V2.0.8 a try for this problem. You could impose the two rotational velocities of the outer walls and leave the body fixed in the internal portion of the domain.

For some examples of these new options, please see the presentation and materials from our workshop that are posted here: http://su2.stanford.edu/documents/SU...edAnalysis.pdf & http://su2.stanford.edu/documents/SU...ced_Topics.zip.

All the best,
Tom

 diwakaranant November 14, 2013 11:19

3 Attachment(s)
Hi Thomas

I was trying to run the case for flow in the annulus of two rotating
cylinders using the moving wall strategy. But the solver is showing
"non-physical points" during the run.

I wanted to know how we can give user defined initial conditions
(like exponentially increasing pressure from inner to outer rotating wall)
for the simulation ? something like

Pressure initialization
P = p_inner_wall*exp(A*(r^2/r_inner^2-1)) where p_inner = 3.29 N/m2
and A = 0.284 ;
r = radius of any point in the annulus;
r_inner = radius of inner rotating wall

Velocity initialization
V_swirl = r * angular_velocity

I tried modifying restart file and rerunning the case, but that didn't work.

I am attaching the log file and the .cfg file with the post.

Thanks
Anant

 economon November 19, 2013 18:14

Hi Anant,

We regularly use the routine CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) in the file solver_direct_mean.cpp in order to set initial conditions. Please see that routine for more details, as I suspect that you can easily add your custom initial conditions there.

All the best,
Tom

 diwakaranant November 23, 2013 06:52

1 Attachment(s)
Hi Tom

I tried to implement user defined initial condition by adding
following lines in the routine

CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) in the file solver_direct_mean.cpp

Code:

``` if ((ExtIter == 0) && (!restart)) {         if (nDim == 2){         cout << "2D not allowed " << endl;         exit(0);         }         cout << " DEBUG : setting initial conditions for rotating flow " << endl;         double xCoords, yCoords, zCoords, radius, pressure, v_swirl_y, v_swirl_z;         double p_inner = 3.29, A = 0.284, omega = 628.57, radius_inner = 0.3;         for (iMesh = 0; iMesh <= config->GetMGLevels(); iMesh++) {         for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) {             xCoords = geometry[iMesh]->node[iPoint]->GetCoord(0);             yCoords = geometry[iMesh]->node[iPoint]->GetCoord(1);             zCoords = geometry[iMesh]->node[iPoint]->GetCoord(2);             radius = sqrt( yCoords * yCoords + zCoords * zCoords );             v_swirl_y = -1.0 * omega * zCoords;             v_swirl_z = 1.0 * omega * yCoords;             pressure = p_inner * exp( A * ( ( radius * radius ) / ( radius_inner * radius_inner ) - 1.0) );             //cout << " pressure = " << pressure << " radius : " << radius << endl;             solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution(0, pressure);             solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution(1, 0.0);             solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution(2, v_swirl_y);             solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution(3, v_swirl_z);             //solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution_Old(0, pressure);             //solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution_Old(1, 0.0);             //solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution_Old(2, v_swirl_y);             //solver_container[iMesh][FLOW_SOL]->node[iPoint]->SetSolution_Old(3, v_swirl_z);         }         solver_container[iMesh][FLOW_SOL]->Set_MPI_Solution(geometry[iMesh], config);         solver_container[iMesh][FLOW_SOL]->Set_MPI_Solution_Old(geometry[iMesh], config);         }     }```
But it doesn't seems to initialize the pressure and velocity values
as intended. Am I doing it correctly ?

The mesh and the configuration files can be found here
https://www.dropbox.com/sh/n55obxgicmwfwfk/911XVD-CFW

The run.log file is also attached.

Thanks
Anant

 diwakaranant December 10, 2013 06:09

Hi Tom

Did you see my previous post ?
I am still facing the problem regarding setting initial conditions.

Anant

 All times are GMT -4. The time now is 15:22.