Commit 8a45ef55 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

porosity in bnd

parent 174762ba
......@@ -286,7 +286,7 @@ static void f_boundary(WeakBoundary *wbnd, FluidProblem *problem,const double *n
f[P] = unext;
for (int id = 0; id < D; ++id) {
f[U+id] = p*n[id] + (un> 0 ? rho*u[id]*un : rho_ext*unext*uext[id]); // TODO : /c
f[U+id] = p*n[id] + (un> 0 ? rho*u[id]*un/c : rho_ext*unext*uext[id]/data[cid]);
}
}
}
......
......@@ -143,23 +143,24 @@ class FluidProblem :
Raises:
ValueError -- if the number of values set in the list callback_or_value do not match what is expected for the boundary type : wall do not take any values; pressure takes a value for the pressure and concentration if any; velocity takes values for each velocity dimension and the concentration if any.
"""
if porosity != 1 :
raise NameError("Only porosity=1 is implemented")
if porosity < 1e-3 :
raise NameError("Inflow porosity too small!")
if (velocity is None and pressure is None) or (velocity is not None and pressure is not None) :
raise NameError("Pressure or Velocity (but not both) should be specified at open boundaries")
if (velocity is not None and len(velocity) != self._dim) :
raise NameError("len(velocity) != dimension at open boundaries")
cid = -1
if velocity is not None :
cb_or_value = velocity
cb_or_value = velocity+[porosity]
vid = 0
cid = self._dim
pid = -1
n = self._dim
n = self._dim+1
else :
cb_or_value = [pressure]
cb_or_value = [pressure]+[porosity]
pid = 0
cid = 1
vid = -1
n = 1
n = 2
if self._n_fluids == 2 :
cb_or_value += [concentration]
aid = n
......
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