#ifndef FLUID_PROBLEM_H #define FLUID_PROBLEM_H #include "mesh.h" #include "mesh_find.h" #include "hxt_linear_system.h" #if DIMENSION==2 #define N_N 3 #else #define N_N 4 #endif typedef struct { char *tag; int field; void (*apply)(int n, const double *x, double *bnd); }StrongBoundary; typedef struct { double epsilon; double rho; double mu; double alpha; double g; Mesh *mesh; MeshTree *mesh_tree; double *porosity; double *new_porosity; double *solution; double *solution_explicit; double *node_volume; int n_strong_boundaries; StrongBoundary *strong_boundaries; HXTLinearSystem *linear_system; int n_particles; double *particle_uvw; double *particle_position; double *particle_volume; double *particle_velocity; double *particle_new_velocity; double *particle_drag; double *particle_mass; double *particle_force; int *particle_element_id; } FluidProblem; int fluid_problem_export(const FluidProblem *problem, const char *output_dir, double t, int iter); int fluid_problem_export_vtk(const FluidProblem *problem, const char *output_dir, double t, int iter); int fluid_problem_import_vtk(FluidProblem *problem, const char *filename); // complete force on the particle (including gravity) void fluid_problem_compute_node_particle_force(FluidProblem *problem, double dt, double *particle_force); int fluid_problem_implicit_euler(FluidProblem *problem, double dt); void fluid_problem_set_particles(FluidProblem *problem, int n, double *mass, double *volume, double *position, double *velocity, long int *elid); void fluid_problem_free(FluidProblem *problem); FluidProblem *fluid_problem_new(const char *mesh_file_name, double g, double mu, double rho, double epsilon, int n_strong_boundaries, StrongBoundary *strong_boundaries); void fluid_problem_adapt_mesh(FluidProblem *problem, double lcmax, double lcmin, double n_el); int *fluid_problem_particle_element_id(FluidProblem *problem); int fluid_problem_n_particles(FluidProblem *problem); void fluid_problem_after_import(FluidProblem *problem); #endif