Commit 2f5a1284 authored by Michel Henry's avatar Michel Henry
Browse files

fix pressure term

parent 6532f4c8
Pipeline #9505 failed with stages
in 60 minutes and 46 seconds
......@@ -395,25 +395,17 @@ static void fluid_problem_f(const FluidProblem *problem, const double *sol, doub
divu += du[iD][iD];
}
nold = sqrt(nold);
f0[P] = 0;
f00[P*n_fields+P] = 0;
// f0[P] = (c-cold)/dt;// + (sol[P]-solold[P])/dt*0.1;
//f00[P*n_fields+P] = 1/dt*0.1;
double *g = problem->g;
double rhoreduced = (problem->reduced_gravity ? (rho-problem->rho[0]) : rho);
double drag = problem->volume_drag + problem->quadratic_drag*nold;
for (int i = 0; i < D; ++i) {
f0[U+i] =
f0[U+i] = + dp[i]
- g[i]*rhoreduced;
// - bf[i]*c;
// + drag*u[i];
// f00[(U+i)*n_fields+U+i] = drag;//5.3e5;
f00[(U+i)*n_fields+U+i] = 0;//5.3e5;
f01[(U+i)*n_fields*D+P*D+i] += 1;
if(problem->temporal) {
f0[U+i] += rho*(u[i]-uold[i])/dt;
f00[(U+i)*n_fields+U+i] += rho/dt;
f00[(U+i)*n_fields+U+i] = rho/dt;
}
f01[(U+i)*n_fields*D+P*D+i] = 1;
if (problem->advection) {
for (int j = 0; j < D; ++j) {
f0[U+i] += rho*(uold[j]*du[i][j] + u[i]*duold[j][j]);
......@@ -427,7 +419,6 @@ static void fluid_problem_f(const FluidProblem *problem, const double *sol, doub
// Viscous term
for (int j = 0; j < D; ++j) {
f1[(U+i)*D+j] = -p;
f1[(U+i)*D+j] += mu*c*(du[i][j] + du[j][i]);
f11[((U+i)*D+j)*n_fields*D+(U+j)*D+i] += mu*c;
f11[((U+i)*D+j)*n_fields*D+(U+i)*D+j] += mu*c;
......
......@@ -68,11 +68,11 @@ tic = time.time()
# COMPUTATION LOOP
while t < tEnd :
time_integration.iterate(fluid,None,dt)
if ii >= 1 :
newx = np.copy(fluid.coordinates())
arbitrary_inside_update(fluid, newx, L, H, A, omega,t, Ox, Oy)
fluid.mesh_velocity()[:] = (newx[:,:2] - fluid.coordinates()[:,:2])*fluid.porosity()[:]/dt
fluid.coordinates()[:] = newx[:]
# if ii >= 1 :
# newx = np.copy(fluid.coordinates())
# arbitrary_inside_update(fluid, newx, L, H, A, omega,t, Ox, Oy)
# fluid.mesh_velocity()[:] = (newx[:,:2] - fluid.coordinates()[:,:2])*fluid.porosity()[:]/dt
# fluid.coordinates()[:] = newx[:]
t += dt
# Output files writting
......
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