fluid_problem.h 1.32 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;
Matthieu Constant's avatar
Matthieu Constant committed
15
  double *node_volume;
16
17
  int n_strong_boundaries;
  StrongBoundary *strong_boundaries;
18
  LinearSystem *linear_system;
19
20
21
22
23
24
25

  int n_particles;
  double *particle_uvw;
  double *particle_position;
  double *particle_volume;
  double *particle_velocity;
  double *particle_mass;
Matthieu Constant's avatar
Matthieu Constant committed
26
  double *node_force;
27
  int *particle_element_id;
28
29
} FluidProblem;

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
30
int fluid_problem_export(const FluidProblem *problem, const char *output_dir, double t, int iter);
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
31
32
// complete force on the particle (including gravity)
void fluid_problem_compute_node_particle_force(FluidProblem *problem, double dt, double *particle_force);
33
void fluid_problem_implicit_euler(FluidProblem *problem, double dt);
34
35
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);
36
void fluid_problem_free(FluidProblem *problem);
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
37
void fluid_problem_adapt_mesh(FluidProblem *problem, double gradmin, double gradmax, double lcmin);
38
#endif