diff --git a/AMDiS/src/parallel/PetscSolverNavierStokes.h b/AMDiS/src/parallel/PetscSolverNavierStokes.h index 8ff4689db5bf8832afe263748dbbfcb745c30911..a43c9732e68b33d17e61b46fedd4710365ab3a95 100644 --- a/AMDiS/src/parallel/PetscSolverNavierStokes.h +++ b/AMDiS/src/parallel/PetscSolverNavierStokes.h @@ -164,6 +164,7 @@ namespace AMDiS { void setStokesData(double *invTauPtr, SystemVector *vec, double *nu1_=NULL, double *nu2_=NULL, double *rho1_=NULL, double *rho2_=NULL) { + nu = new double; (*nu) = 0.0; invTau = invTauPtr; solution = vec; diff --git a/extensions/demo/NavierStokesCahnHilliard_PC/run b/extensions/demo/NavierStokesCahnHilliard_PC/run index dcded400eca103664e4db02d8fb6c77260c1cba5..415d3d470c365e7c6f5f3c6ddf178fd85fbd8cbf 100644 --- a/extensions/demo/NavierStokesCahnHilliard_PC/run +++ b/extensions/demo/NavierStokesCahnHilliard_PC/run @@ -1,3 +1,6 @@ +# This demo implements the Navier-Stokes-Cahn-Hilliard Benchmark from +# S. Aland, A. Voigt. Benchmark computations of diffuse-interface models for two-dimensional bubble dynamics. Int. J. Num. Meth. Fluids (2012) + output="output2_sequentiell" initfile="init/nsch.dat.2d" mkdir $output @@ -6,7 +9,7 @@ mkdir serials cp -r ../src . cp ../$initfile . -mpiexec -n 2 ../drivenCavity ../$initfile -ns_ksp_atol 1e-9 -ns_ksp_rtol 0 -ch_ksp_atol 1e-9 -ch_ksp_rtol 0 -laplace_pc_type hypre -laplace_pc_hypre_boomeramg_relax_type_coarse symmetric-SOR/Jacobi +mpiexec -n 2 ../nsch ../$initfile -ns_ksp_atol 1e-9 -ns_ksp_rtol 0 -ch_ksp_atol 1e-9 -ch_ksp_rtol 0 -laplace_pc_type hypre -laplace_pc_hypre_boomeramg_relax_type_coarse symmetric-SOR/Jacobi # sequentiell (solver noch auf umfpack stellen) -> #../drivenCavity ../$initfile ###### mpiexec -n 2 valgrind --tool=memcheck -q --num-callers=20 --log-file=valgrind.log.%p ../drivenCavity ../$initfile -malloc off -start_in_debugger diff --git a/extensions/demo/NavierStokesCahnHilliard_PC/src/CahnHilliardNavierStokes_.h b/extensions/demo/NavierStokesCahnHilliard_PC/src/CahnHilliardNavierStokes_.h index 605de6ca7dbc9d52537a9dc57b52d1f451294560..338b35704e66264ca6dc52f3b00c75e4afb090b0 100644 --- a/extensions/demo/NavierStokesCahnHilliard_PC/src/CahnHilliardNavierStokes_.h +++ b/extensions/demo/NavierStokesCahnHilliard_PC/src/CahnHilliardNavierStokes_.h @@ -150,10 +150,12 @@ public: nsProb->getProblem(0)->addVectorOperator(opNuGradC, i, &surfaceTension, &surfaceTension); } - // < v * grad(c) , theta > - Operator *opVGradC = new Operator(chProb->getFeSpace(0), chProb->getFeSpace(1)); - opVGradC->addTerm(new WorldVector_FOT(nsProb->getVelocity(), 1.0), GRD_PHI); - chProb->getProblem()->addMatrixOperator(opVGradC, 1, 1, chProb->getTau()); + for (size_t i = 0; i < dow; i++) { + // < v * grad(c) , theta > + Operator *opVGradC = new Operator(chProb->getFeSpace(0), chProb->getFeSpace(1)); + opVGradC->addTerm(new VecAtQP_FOT(nsProb->getSolution()->getDOFVector(i), new ID(), i), GRD_PHI); + chProb->getProblem()->addMatrixOperator(opVGradC, 1, 1, chProb->getTau()); + } /**/ }