Commit 09e00407 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

fix

parent a390fecf
Pipeline #10146 failed with stages
in 48 minutes and 37 seconds
......@@ -409,7 +409,7 @@ static void particle_force_f(FluidProblem *problem, double *f, double *dfdu, dou
for(int k = 0;k<D;k++){
invmatw += invmat[i][k]*problem->particle_delassus[ip*D*D + k*D + j];
}
dfddp[i*D +j] = -vol*gamma*dt*invmatw;
dfddp[i*D +j] = vol*gamma*dt*invmatw;
}
}
}
......@@ -422,7 +422,7 @@ static void fluid_problem_f(const FluidProblem *problem, const double *sol, doub
double u[D], uold[D], du[D][D], duold[D][D], umesh[D], dp[D], dpold[D];
if(problem->stab_param != 0)
taup = tauc = 0;
double divu = 0;
double divu = 0, divuold = 0;
double divus = 0;
double nold = 0;
for (int iD = 0; iD < D; ++iD) {
......@@ -437,6 +437,7 @@ static void fluid_problem_f(const FluidProblem *problem, const double *sol, doub
duold[iD][jD] = dsolold[(U+iD)*D+jD];
}
divu += du[iD][iD];
divuold += duold[iD][iD];
}
if (problem->usolid) {
for (int iD = 0; iD < D; ++iD)
......@@ -450,7 +451,7 @@ static void fluid_problem_f(const FluidProblem *problem, const double *sol, doub
double *g = problem->g;
double rhoreduced = (problem->reduced_gravity ? (rho-problem->rho[0]) : rho);
double drag = problem->volume_drag + problem->quadratic_drag*nold;
double pstab = 10;
double pstab = 0;
for (int i = 0; i < D; ++i) {
f0[U+i] =
c*dp[i]+ c*(-g[i]*rhoreduced- bf[i])+(1-c)*(dp[i]-dpold[i])*pstab;
......
......@@ -63,7 +63,7 @@ def genInitialPosition(filename, r, H, ly, lx, rhop) :
p.write_vtk(filename,0,0)
# Define output directory
outputdir = "output_incompressible"
outputdir = "output-centered"
if not os.path.isdir(outputdir) :
os.makedirs(outputdir)
......@@ -75,7 +75,7 @@ rho = 1000 # fluid density
nu = 1e-6 # kinematic viscosity
# Numerical parameters
outf = 2 # number of iterations between output files
outf = 100 # number of iterations between output files
dt = 1e-3 # time step
tEnd = 100 # final time
......@@ -119,7 +119,7 @@ tic = time.time()
#
mass = np.pi*p.r()**2*rhop
while t < tEnd :
time_integration.iterate(fluid, p, dt, min_nsub=1, external_particles_forces=g*mass, use_predictor_corrector=False)
time_integration.iterate(fluid, p, dt, min_nsub=1, external_particles_forces=g*mass, use_predictor_corrector=False, check_residual_norm=1)
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