Commit 881f8934 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

still broken

parent dcffb101
......@@ -689,7 +689,11 @@ int fluid_problem_implicit_euler(FluidProblem *problem, double dt)
else if(norm/norm0 < newton_rtol)
break;
clock_get(&tic);
hxtLinearSystemSolve(problem->linear_system, rhs, dx);
hxtLinearSystemSolve(problem->linear_system, rhs, dx);
for (int i = 0; i < mesh->n_nodes*n_fields; ++i)
printf("%g\n", dx[i]);
printf("\n");
exit(0);
clock_get(&toc);
//break;
totaltime += clock_diff(&tic, &toc);
......@@ -759,7 +763,7 @@ FluidProblem *fluid_problem_new(const char *mesh_file_name, double g, double *mu
hxtInitializeLinearSystems(0, NULL);
initialized = 1;
#ifdef HXT_HAVE_PETSC
hxtPETScInsertOptions("-pc_type ilu -ksp_max_it 30", NULL);
hxtPETScInsertOptions("-pc_type lu -ksp_max_it 30 -ksp_monitor", NULL);
#endif
}
FluidProblem *problem = (FluidProblem*)malloc(sizeof(FluidProblem));
......
......@@ -59,7 +59,45 @@ outf = 10 # number of iterations between o
#Object fluid creation + Boundary condition of the fluid (field 0 is horizontal velocity; field 1 is vertical velocity; field 2 is pressure)
#Format: strong_boundaries = [(Boundary tag, Fluid field, Value)
strong_boundaries = [("Top",1,1,0.),("Bottom",1,1,0.),("LeftUp",1,1,0),("RightUp",1,1,0),("LeftDown",1,1,0),("RightDown",1,1,0),("Top",0,0,0),("Bottom",0,0,0),("RightUp",6,6,0),("RightDown",6,6,0),("LeftUp",0,0,lambda x : 1/(20*nu1*rho)*x[:,1]*(1-x[:, 1])),("LeftDown",0,0,lambda x : 1/(20*nu0*rho)*x[:,1]*(1-x[:, 1])),("LeftUp",2,2,1),("RightUp",2,2,1),("Top",2,2,0.5),("LeftDown",5,5,0.5),("RightDown",5,5,0.5),("Bottom",5,5,0.5),("LeftUp",5,5,0.5),("RightUp",5,5,0.5),("Top",5,5,0.5),("LeftDown",2,2,0.5),("RightDown",2,2,0.5),("Bottom",2,2,0.5)]
u0,v0,q0 = 0,1,2
u1,v1,q1 = 3,4,5
p = 6
strong_boundaries = [
("Bottom",u0,u0,0),
("Bottom",v0,v0,0.),
#("Bottom",q0,q0,0.5),
("Bottom",u1,u1,0),
("Bottom",v1,v1,0.),
#("Bottom",q1,q1,0.5),
("Top",u0,u0,0),
("Top",v0,v0,0.),
#("Top",q0,q0,0.5),
("Top",u1,u1,0),
("Top",v1,v1,0.),
#("Top",q1,q1,0.5),
("LeftDown",u0,u0,lambda x : 1/(20*nu0*rho)*x[:,1]*(1-x[:, 1])),
("LeftDown",v0,v0,0),
("LeftDown",q0,q0,0.5),
("LeftDown",u1,u1,lambda x : 1/(20*nu1*rho)*x[:,1]*(1-x[:, 1])),
("LeftDown",v1,v1,0),
("LeftDown",q1,q1,0.5),
("LeftUp",u0,u0,lambda x : 1/(20*nu0*rho)*x[:,1]*(1-x[:, 1])),
("LeftUp",v0,v0,0),
("LeftUp",q0,q0,0.5),
("LeftUp",u1,u1,lambda x : 1/(20*nu1*rho)*x[:,1]*(1-x[:, 1])),
("LeftUp",v1,v1,0),
("LeftUp",q1,q1,0.5),
("RightDown",v0,v0,0),
("RightDown",v1,v1,0),
#("RightDown",q0,q0,0.5),
#("RightDown",q1,q1,0.5),
("RightDown",p,p,0),
("RightUp",v0,v0,0),
("RightUp",v1,v1,0),
#("RightUp",q0,q0,0.5),
#("RightUp",q1,q1,0.5),
("RightUp",p,p,0)
]
fluid = fluid.fluid_problem("mesh.msh",g,[nu0*rho,nu1*rho],[rho,rho],epsilon,strong_boundaries,1,2)
ii = 0
t = 0
......
Supports Markdown
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