fluid_problem.h 1.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef FLUID_PROBLEM_H
#define FLUID_PROBLEM_H

#include "mesh.h"
#include "linear_system.h"

typedef struct {
  double epsilon;
  double rho;
  double mu;
  Mesh *mesh;
  double *porosity;
13
  double *old_porosity;
14
  double *solution;
15
16
  int n_strong_boundaries;
  StrongBoundary *strong_boundaries;
17
  LinearSystem *linear_system;
18
19
20
21
22
23
24
25
26

  int n_particles;
  double *particle_uvw;
  double *particle_position;
  double *particle_volume;
  double *particle_velocity;
  double *particle_mass;
  double *particle_force; // complete force on the particle (including gravity)
  int *particle_element_id;
27
28
29
30
} FluidProblem;

int fluid_problem_export(const FluidProblem *problem, const char *output_dir, double t, double iter);
void fluid_problem_implicit_euler(FluidProblem *problem, double dt);
31
32
FluidProblem *fluid_problem_new(const char *mesh_file_name, double mu, double rho, double epsilon, int n_strong_boundaries, StrongBoundary *strong_boundaries);
void fluid_problem_set_particles(FluidProblem *problem, int n, double *mass, double *volume, double *position, double *velocity);
33
34
void fluid_problem_free(FluidProblem *problem);
#endif