From 2e2d7450a14884f19f3ba5e23adb8a1ba614c289 Mon Sep 17 00:00:00 2001 From: Simon Praetorius <simon.praetorius@tu-dresden.de> Date: Thu, 3 Jan 2013 13:06:41 +0000 Subject: [PATCH] little changes on extensions/demo/NavierStokesCahnHilliard --- AMDiS/src/parallel/PetscSolverNavierStokes.h | 1 + extensions/demo/NavierStokesCahnHilliard_PC/run | 5 ++++- .../src/CahnHilliardNavierStokes_.h | 10 ++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/AMDiS/src/parallel/PetscSolverNavierStokes.h b/AMDiS/src/parallel/PetscSolverNavierStokes.h index 8ff4689d..a43c9732 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 dcded400..415d3d47 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 605de6ca..338b3570 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()); + } /**/ } -- GitLab