Separate solver and discretization modules

This commit is contained in:
2024-02-18 13:45:46 +01:00
parent fe57042556
commit e35aca7037
8 changed files with 595 additions and 519 deletions

View File

@@ -7,41 +7,20 @@
#ifndef __SOLVER_H_
#define __SOLVER_H_
#include "comm.h"
#include "discretization.h"
#include "grid.h"
#include "parameter.h"
enum BC { NOSLIP = 1, SLIP, OUTFLOW, PERIODIC };
typedef struct {
/* geometry and grid information */
double dx, dy;
int imax, jmax;
double xlength, ylength;
/* arrays */
double *p, *rhs;
double *f, *g;
double *u, *v;
Grid* grid;
/* parameters */
double eps, omega;
double re, tau, gamma;
double gx, gy;
/* time stepping */
int itermax;
double dt, te;
double dtBound;
char* problem;
int bcLeft, bcRight, bcBottom, bcTop;
/* communication */
Comm comm;
Comm* comm;
} Solver;
void initSolver(Solver*, Parameter*);
void computeRHS(Solver*);
void solve(Solver*);
void normalizePressure(Solver*);
void computeTimestep(Solver*);
void setBoundaryConditions(Solver*);
void setSpecialBoundaryCondition(Solver*);
void computeFG(Solver*);
void adaptUV(Solver*);
void writeResult(Solver* s, double* u, double* v, double* p);
void initSolver(Solver*, Discretization*, Parameter*);
void solve(Solver*, double*, double*);
#endif