PLUTO
init.c File Reference

Taylor-Couette Flow in 2D cylindrical coordinates. More...

#include "pluto.h"
Include dependency graph for init.c:

Go to the source code of this file.

Functions

void Init (double *v, double x1, double x2, double x3)
 
void Analysis (const Data *d, Grid *grid)
 
void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
 

Detailed Description

Taylor-Couette Flow in 2D cylindrical coordinates.

This problem considers a fluid rotating between two concentric cylinders situated at $ R_{\rm int}$ and $ R_{\rm ext}$ (fixed by the computational domain in pluto.ini). The outer cylinder is not rotating while the inner one rotates with anular velocity $\omega$. Viscous effects are controlled by the Reynolds number defined in visc_nu.c as

\[ {\rm Re} = \Omega R_{int}\left(R_{\rm ext} - R_{\rm int}\right) \frac{\rho}{\nu_1} \]

For Reynolds numbers ${\rm Re} > {\rm Re}_{\rm critical}\sim 130$ vortices are formed, the axial distribution of which is controlled by the wave-number of the initial perturbation $\kappa = 2 \pi / \lambda$. For small Reynolds numbers, viscosity suppresses the vortex formation.

The input parameters for this problem are:

  • g_inputParam[OMEGA]: the angular velocity of the inner cylinder.
  • g_inputParam[REYN]: the Reynolds number.
Author
P. Tzeferacos (petro.nosp@m.s.tz.nosp@m.efera.nosp@m.cos@.nosp@m.ph.un.nosp@m.ito..nosp@m.it)
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
June 4, 2010

References

  • "Stability of a viscous liquid contained between two rotating cylinders", Taylor G.I., 1923, Philos. Trans. R. Soc. London, Ser. A, 223, 289
  • "Taylor vortex formation in axial through-flow: Linear and weakly nonlinear analysis", Recktenwald A., L"ucke M., M"uller H.W., 1993, Phys. Rev. E, 48, 4444

Definition in file init.c.

Function Documentation

void Analysis ( const Data d,
Grid grid 
)

Perform runtime data analysis.

Parameters
[in]dthe PLUTO Data structure
[in]gridpointer to array of Grid structures

Definition at line 65 of file init.c.

70 {
71 
72 }
void Init ( double *  v,
double  x1,
double  x2,
double  x3 
)

The Init() function can be used to assign initial conditions as as a function of spatial position.

Parameters
[out]va pointer to a vector of primitive variables
[in]x1coordinate point in the 1st dimension
[in]x2coordinate point in the 2nd dimension
[in]x3coordinate point in the 3rdt dimension

The meaning of x1, x2 and x3 depends on the geometry:

\[ \begin{array}{cccl} x_1 & x_2 & x_3 & \mathrm{Geometry} \\ \noalign{\medskip} \hline x & y & z & \mathrm{Cartesian} \\ \noalign{\medskip} R & z & - & \mathrm{cylindrical} \\ \noalign{\medskip} R & \phi & z & \mathrm{polar} \\ \noalign{\medskip} r & \theta & \phi & \mathrm{spherical} \end{array} \]

Variable names are accessed by means of an index v[nv], where nv = RHO is density, nv = PRS is pressure, nv = (VX1, VX2, VX3) are the three components of velocity, and so forth.

Definition at line 42 of file init.c.

46 {
47  double rmin = g_domBeg[IDIR];
48  double rmax = g_domEnd[IDIR];
49  double eta = rmin/rmax;
50  double lambda = (rmax-rmin);
51  double A = -g_inputParam[OMEGA]*eta*eta/(1.0 - eta*eta);
52  double B = g_inputParam[OMEGA]*rmin*rmin/(1.0 - eta*eta);
53  double SPER = sin(2.*CONST_PI*x2/lambda);
54  double CPER = cos(2.*CONST_PI*x2/lambda);
55 
56  v[RHO] = 1.0;
57  v[PRS] = 10.+ 0.5*(A*A*x1*x1 +4.*A*B*log(x1) - B*B/x1/x1)
58  + 0.01*0.5*(A*A*x1*x1 +4.*A*B*log(x1) - B*B/x1/x1)*CPER;
59  v[VX1] = 0.01*(A*x1 + B/x1)*CPER;
60  v[VX2] = 0.01*(A*x1 + B/x1)*SPER;
61  v[VX3] = A*x1 + B/x1 + 0.01*(A*x1 + B/x1)*CPER;
62  v[TRC] = 1.0;
63 }
#define VX2
Definition: mod_defs.h:29
#define RHO
Definition: mod_defs.h:19
static double *** eta[3]
Definition: res_functions.c:94
#define TRC
Definition: pluto.h:581
#define VX1
Definition: mod_defs.h:28
#define IDIR
Definition: pluto.h:193
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
double g_domBeg[3]
Lower limits of the computational domain.
Definition: globals.h:125
#define OMEGA
#define VX3
Definition: mod_defs.h:30
#define CONST_PI
.
Definition: pluto.h:269
double g_domEnd[3]
Upper limits of the computational domain.
Definition: globals.h:126
double * A
Right interface area, A[i] = .
Definition: structs.h:87
void UserDefBoundary ( const Data d,
RBox box,
int  side,
Grid grid 
)

Assign user-defined boundary conditions at inner and outer radial boundaries. Reflective conditions are applied except for the azimuthal velocity which is fixed.

Definition at line 74 of file init.c.

81 {
82  int i, j, k, nv;
83  double *x1, *x2, *x3;
84 
85  x1 = grid[IDIR].x;
86  x2 = grid[JDIR].x;
87  x3 = grid[KDIR].x;
88 
89  if (side == 0) { /* -- check solution inside domain -- */
90  DOM_LOOP(k,j,i){};
91  }
92 
93  if (side == X1_BEG){ /* -- X1_BEG boundary / Cylinder @ R = R_INT -- */
94  X1_BEG_LOOP(k,j,i){
95  d->Vc[RHO][k][j][i] = d->Vc[RHO][k][j][2*IBEG - i - 1];
96  d->Vc[PRS][k][j][i] = d->Vc[PRS][k][j][2*IBEG - i - 1];
97  d->Vc[VX1][k][j][i] = - d->Vc[VX1][k][j][2*IBEG - i - 1];
98  d->Vc[VX2][k][j][i] = d->Vc[VX2][k][j][2*IBEG - i - 1];
99  d->Vc[VX3][k][j][i] = g_inputParam[OMEGA]*x1[i];
100  }
101  }
102 
103  if (side == X1_END){ /* -- X1_END boundary / Cylinder @ R = R_EXT -- */
104  X1_END_LOOP(k,j,i){
105  d->Vc[RHO][k][j][i] = d->Vc[RHO][k][j][2*IEND - i + 1];
106  d->Vc[PRS][k][j][i] = d->Vc[PRS][k][j][2*IEND - i + 1];
107  d->Vc[VX1][k][j][i] = - d->Vc[VX1][k][j][2*IEND - i + 1];
108  d->Vc[VX2][k][j][i] = d->Vc[VX2][k][j][2*IEND - i + 1];
109  d->Vc[VX3][k][j][i] = 0.0;
110  }
111  }
112 }
#define X1_BEG
Boundary region at X1 beg.
Definition: pluto.h:146
DOM_LOOP(k, j, i)
Definition: analysis.c:22
#define VX2
Definition: mod_defs.h:29
#define RHO
Definition: mod_defs.h:19
double **** Vc
The main four-index data array used for cell-centered primitive variables.
Definition: structs.h:31
#define X1_END
Boundary region at X1 end.
Definition: pluto.h:147
#define VX1
Definition: mod_defs.h:28
#define KDIR
Definition: pluto.h:195
#define IDIR
Definition: pluto.h:193
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
int j
Definition: analysis.c:2
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:37
int k
Definition: analysis.c:2
double * x
Definition: structs.h:80
#define X1_END_LOOP(k, j, i)
Definition: macros.h:50
#define X1_BEG_LOOP(k, j, i)
Definition: macros.h:46
#define OMEGA
int i
Definition: analysis.c:2
#define VX3
Definition: mod_defs.h:30
#define JDIR
Definition: pluto.h:194
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:35

Here is the call graph for this function: