forked from deepmodeling/deepflame-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dfEEqn.H
72 lines (59 loc) · 2.12 KB
/
dfEEqn.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
#pragma once
#include "AmgXSolver.H"
#include <amgx_c.h>
#include "dfMatrixDataBase.H"
class dfEEqn
{
private:
dfMatrixDataBase &dataBase_;
cudaStream_t stream;
//cudaEvent_t event;
AmgXSolver *ESolver = nullptr;
int num_iteration;
// common variables
int num_cells, cell_bytes, num_faces, num_surfaces, cell_vec_bytes, csr_value_vec_bytes, num_boundary_cells;
int num_boundary_faces, boundary_face_bytes;
int *d_A_csr_row_index, *d_A_csr_diag_index, *d_A_csr_col_index;
// Matrix variables
double *d_A_csr, *d_b = nullptr;
double *h_A_csr, *h_b = nullptr;
double *d_he_old = nullptr;
double *h_he_new = nullptr;
// fields used by EEqn
double *d_alphaEff = nullptr;
double *d_K = nullptr;
double *d_K_old = nullptr;
double *d_dpdt = nullptr;
double *d_boundary_K_init = nullptr;
double *d_boundary_K = nullptr;
double *d_boundary_alphaEff_init = nullptr;
double *d_boundary_alphaEff = nullptr;
double *d_value_internal_coeffs_init = nullptr;
double *d_value_boundary_coeffs_init = nullptr;
double *d_gradient_internal_coeffs_init = nullptr;
double *d_gradient_boundary_coeffs_init = nullptr;
double *d_value_internal_coeffs = nullptr;
double *d_value_boundary_coeffs = nullptr;
double *d_gradient_internal_coeffs = nullptr;
double *d_gradient_boundary_coeffs = nullptr;
double *d_boundary_gradient_init = nullptr;
double *d_boundary_gradient = nullptr;
public:
dfEEqn();
dfEEqn(dfMatrixDataBase &dataBase, const std::string &modeStr, const std::string &cfgFile);
~dfEEqn();
void prepare_data(const double *he_old, const double *K, const double *K_old, const double *alphaEff,
const double *dpdt, const double *boundary_K, const double *boundary_alphaEff, const double *boundary_gradient);
void initializeTimeStep();
void fvm_ddt();
void fvm_div();
void fvm_laplacian();
void fvc_ddt();
void fvc_div_phi_scalar();
void fvc_div_vector();
void add_to_source();
void solve();
void checkValue(bool print);
void updatePsi(double *Psi);
void sync();
};