Skip to content

Commit

Permalink
correcting the divergence cleareance
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoRossi committed Feb 14, 2014
1 parent 6a35b3a commit 750e36d
Showing 1 changed file with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,35 +260,35 @@ def Clear(self):
def do_divergence_clearance(self):
print("Calculating divergence-free initial condition")
# initialize with a Stokes solution step
try:
import KratosMultiphysics.ExternalSolversApplication as kes
smoother_type = kes.AMGLCSmoother.ILU0
# smoother_type = kes.AMGCLSmoother.DAMPED_JACOBI
solver_type = kes.AMGCLSolver.BICGSTAB
# solver_type = kes.AMGCLIterativeSolverType.CG
gmres_size = 50
max_iter = 200
tol = 1e-7
verbosity = 1
stokes_linear_solver = kes.AMGCLSolver(
smoother_type,
solver_type,
tol,
max_iter,
verbosity,
gmres_size)
except:
pPrecond = DiagonalPreconditioner()
stokes_linear_solver = BICGSTABSolver(1e-9, 5000, pPrecond)
stokes_process = StokesInitializationProcess(
self.model_part,
stokes_linear_solver,
self.domain_size,
PATCH_INDEX)
# copy periodic conditions to Stokes problem
stokes_process.SetConditions(self.model_part.Conditions)
# execute Stokes process
stokes_process.Execute()
#try:
#import KratosMultiphysics.ExternalSolversApplication as kes
#smoother_type = kes.AMGLCSmoother.ILU0
## smoother_type = kes.AMGCLSmoother.DAMPED_JACOBI
#solver_type = kes.AMGCLSolver.BICGSTAB
## solver_type = kes.AMGCLIterativeSolverType.CG
#gmres_size = 50
#max_iter = 200
#tol = 1e-7
#verbosity = 1
#stokes_linear_solver = kes.AMGCLSolver(
#smoother_type,
#solver_type,
#tol,
#max_iter,
#verbosity,
#gmres_size)
#except:
#pPrecond = DiagonalPreconditioner()
#stokes_linear_solver = BICGSTABSolver(1e-9, 5000, pPrecond)
#stokes_process = StokesInitializationProcess(
#self.model_part,
#stokes_linear_solver,
#self.domain_size,
#PATCH_INDEX)
## copy periodic conditions to Stokes problem
#stokes_process.SetConditions(self.model_part.Conditions)
## execute Stokes process
#stokes_process.Execute()

dt = self.model_part.ProcessInfo.GetValue(DELTA_TIME)
self.model_part.ProcessInfo.SetValue(DELTA_TIME, 100.0 * dt)
Expand Down

0 comments on commit 750e36d

Please sign in to comment.