-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiffu_solver.h
42 lines (33 loc) · 1 KB
/
diffu_solver.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
#pragma once
const double beta = 1.43e-3;
int iter;
int numberOfGridPoints;
int numberOfTimeSteps;
int numberOfEquations;
double a, b, c;
double totalTime;
double dt;
double ds;
double sigma;
double physicalTime = 0;
double residual;
string outFile;
vector< double > qField;
vector< double > qField_N1;
vector< double > xCoordinates;
void initialize_parameter();
void set_time_march_method();
void flow_initialization();
void load_qField();
typedef void (*Time_Marching_Pointer)(); //×Ô¶¨ÒåvoidÀàÐ͵ÄÖ¸Õ뺯Êý
Time_Marching_Pointer time_marching;
void time_marching_FTCS();
void time_marching_full_implicit();
void time_marching_Crank_Nicolson();
void boundary_condition();
void compute_residual();
void output_residual();
void output_results(string outFile);
void generate_grid_1D(int numberOfGridPoints);
void solve_TDMA_method(double a, double b, double c, vector<double>& VD, vector<double>& solution);
void solve_TDMA_method_version2(double a, double b, double c, vector<double>& VD, vector<double>& solution);