Commit 41e31208 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

extraa

parent 51416b11
Pipeline #4603 passed with stage
in 36 seconds
......@@ -451,7 +451,7 @@ static void f_wall(FluidProblem *problem,const double *n, double *f,const double
}
static double pow2(double a) {return a*a;}
static void compute_stab_parameters(FluidProblem *problem, double dt) {
void compute_stab_parameters(FluidProblem *problem, double dt) {
const Mesh *mesh = problem->mesh;
problem->taup = realloc(problem->taup,sizeof(double)*mesh->n_elements);
......@@ -1628,6 +1628,11 @@ double *fluid_problem_porosity(const FluidProblem *p)
return p->porosity;
}
double *fluid_problem_extraa(const FluidProblem *p)
{
return p->extraa;
}
double *fluid_problem_old_porosity(const FluidProblem *p)
{
return p->oldporosity;
......@@ -1690,3 +1695,4 @@ void fluid_problem_private_add_physical(FluidProblem *p, int tag, int dim, const
m->phys_boundaries[i] = malloc(n_bnd*sizeof(int)*2);
memcpy(m->phys_boundaries[i],bnd,n_bnd*sizeof(int)*2);
}
......@@ -106,6 +106,7 @@ int fluid_problem_n_elements(const FluidProblem *p);
int *fluid_problem_elements(const FluidProblem *p);
double *fluid_problem_old_porosity(const FluidProblem *p);
double *fluid_problem_porosity(const FluidProblem *p);
double *fluid_problem_extraa(const FluidProblem *p);
void fluid_problem_set_wall_boundary(FluidProblem *p, const char *tag, BoundaryCallback *pressurecb);
int fluid_problem_private_n_physical(const FluidProblem *p);
......
......@@ -198,6 +198,8 @@ class FluidProblem :
("porosity",self.porosity()),
("old_porosity",self.old_porosity())
]
self._lib.compute_stab_parameters(self._fp,c_double(1))
celldata = [("extraa",self.extraa())]
if self._n_fluids == 2 :
data.append(("concentration",self.solution()[:,[self._dim+1]]))
field_data = []
......@@ -205,7 +207,7 @@ class FluidProblem :
name,dim,pid,nodes,bnd = self._physical(i)
field_data.append((b"Physical %i %i %s" % (dim,pid,name),nodes[:,None]))
field_data.append((b"Boundary %i %i %s" % (dim,pid,name),bnd))
VTK.write(output_dir+"/fluid",it,t,self.elements(),self.coordinates(),data,field_data)
VTK.write(output_dir+"/fluid",it,t,self.elements(),self.coordinates(),data,field_data,celldata)
def import_vtk(self, filename) :
"""Read output file to reload computation.
......@@ -321,6 +323,10 @@ class FluidProblem :
"""Return the porosity at nodes"""
return self._get_matrix("porosity", self.n_nodes(), 1)
def extraa(self):
"""Return the porosity at nodes"""
return self._get_matrix("extraa", self.n_elements(), 1)
def old_porosity(self):
"""Return the porosity at previous time step"""
return self._get_matrix("old_porosity", self.n_nodes(), 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment