ParMooN
 All Classes Functions Variables Friends Pages
amc.h
1 // #define __UREA__
2 // #define __SIMPATURS__
3 //
4 // #include <Urea_3d4d.h>
5 // #include <MacroCell.h>
6 
7 void ExampleFile()
8 {
9 
10  OutPut("Example: amc.h" << endl); //OutPut("GRID_TYPE set to " << TDatabase::ParamDB->GRID_TYPE << endl);
11 }
12 
13 // ========================================================================
14 // definitions for the temperature
15 // ========================================================================
16 
17 void Exact(double x, double y, double z, double *values)
18 {
19  double t = TDatabase::TimeDB->CURRENTTIME;
20  double k = 0.1;
21 
22  values[0] = (exp(-k*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);
23  values[1] = Pi*(exp(-k*t))*cos(Pi*x)*cos(Pi*y)*cos(Pi*z);
24  values[2] = -Pi*(exp(-k*t))*sin(Pi*x)*sin(Pi*y)*cos(Pi*z);
25  values[3] = -Pi*(exp(-k*t))*sin(Pi*x)*cos(Pi*y)*sin(Pi*z);
26  values[4] = -3.*Pi*Pi*(exp(-k*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);
27 }
28 
29 // initial conditon
30 void InitialCondition(double x, double y, double z, double *values)
31 {
32  double t = 0;
33  double k = 0.1;
34 
35  values[0] = (exp(-k*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);
36  /* values[1] = Pi*(exp(-k*t))*cos(Pi*x)*cos(Pi*y)*cos(Pi*z);
37  values[2] = -Pi*(exp(-k*t))*cos(Pi*x)*sin(Pi*y)*cos(Pi*z);
38  values[3] = -Pi*(exp(-k*t))*cos(Pi*x)*cos(Pi*y)*sin(Pi*z);
39  values[4] = -3.*Pi*Pi*(exp(-k*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);*/
40 }
41 
42 void BoundCondition(double x, double y, double z, BoundCond &cond)
43 {
44  cond = DIRICHLET;
45 }
46 
47 // value of boundary condition
48 void BoundValue(double x, double y, double z, double &value)
49 {
50  double t = TDatabase::TimeDB->CURRENTTIME;
51  double k = 0.1;
52 
53  value = (exp(-k*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);
54 }
55 
56 // ========================================================================
57 // BilinearCoeffs for Heat
58 // ========================================================================
59 void BilinearCoeffs(int n_points, double *X, double *Y, double *Z,
60  double **parameters, double **coeffs)
61 {
62 // double eps= 1.0/TDatabase::ParamDB->RE_NR;
63  double eps= 1.0;
64  int i;
65  double *coeff; // *param;
66  double x, y, z, c, a[3], b[3], s[3], h;
67  double t = TDatabase::TimeDB->CURRENTTIME;
68 
69  b[0] = 0;
70  b[1] = 0;
71  b[2] = 0;
72  c = 0;
73 
74  for(i=0;i<n_points;i++)
75  {
76  coeff = coeffs[i];
77  // param = parameters[i];
78 
79  x = X[i];
80  y = Y[i];
81  z = Z[i];
82 
83  // diffusion
84  coeff[0] = eps;
85  // convection in x direction
86  coeff[1] = b[0];
87  // convection in y direction
88  coeff[2] = b[1];
89  // convection in z direction
90  coeff[3] = b[2];
91  // reaction
92  coeff[4] = c;
93  // rhs
94  coeff[5] = (3.*eps*Pi*Pi - 0.1)*(exp(-0.1*t))*sin(Pi*x)*cos(Pi*y)*cos(Pi*z);
95  coeff[6] = 0;
96 
97  }
98 }
static TTimeDB * TimeDB
Definition: Database.h:1137