-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLidDrivenCavity.h
88 lines (72 loc) · 1.88 KB
/
LidDrivenCavity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
High Performane Computing Coursework
LidDrivenCavity.h
Purpose: Defines the LidDrivenCavity class.
@author Sean Chai
@version 1.0 23/03/20
*/
#ifndef LIDDRIVENCAVITY_H
#define LIDDRIVENCAVITY_H
#pragma once
#include <string>
using namespace std;
class LidDrivenCavity
{
public:
// Constructor Destructor
LidDrivenCavity();
~LidDrivenCavity();
// Setting functions
void SetDomainSize(double xlen, double ylen);
void SetGridSize(unsigned int nx, unsigned int ny);
void SetPartitionSize(unsigned int px, unsigned int py);
void SetTimeStep(double deltat);
void SetFinalTime(double finalt);
void SetReynoldsNumber(double Re);
void SetGridSpacing(double deltax, double deltay);
void SetMPIConfig();
// Main class functions
void Initialise();
void Integrate();
void GeneratePlotData();
private:
// Given constants
const double U = 1.0;
// Defined parameters
double dt;
double T;
unsigned int Nx;
unsigned int Ny;
unsigned int Px;
unsigned int Py;
double Lx;
double Ly;
double Re;
// Calculated parameters
double dx;
double dy;
// Discretised grids for omega
double* w;
double* s;
// Additional variables
unsigned int narr;
unsigned int interiorNx;
unsigned int interiorNy;
unsigned int interiorNarr;
// Variables for MPI
int MPIRank;
int MPISize;
// Variables for individual partitions to work on
int coordArrLen;
int* iInnerCoords;
int* jInnerCoords;
// Variables for poisson solver
double* scalapackMatrix = nullptr;
int scalapackMatrixNx;
int scalapackMatrixNy;
// Private functions for solving vorticity and streamfunction
void SetVorticityBoundaryConditions();
void SetInteriorVorticity();
void UpdateInteriorVorticity();
};
#endif