def MoveMesh(self): # move local and ghost nodes self.mesh_model_part.GetCommunicator().SynchronizeVariable( KratosMultiphysics.MESH_DISPLACEMENT) KMM.MoveMesh(self.mesh_model_part.Nodes) # If required, calculate the MESH_VELOCITY. if self.settings["calculate_mesh_velocity"].GetBool(): KMM.CalculateMeshVelocities(self.mesh_model_part, self.time_int_helper)
def SolveSolutionStep(self): for mesh_solver in self.mesh_motion_solvers: mesh_solver.SolveSolutionStep() for mesh_solver in self.mesh_motion_solvers: KMM.CalculateMeshVelocities(mesh_solver.GetComputingModelPart(), self.time_int_helper) self.__ApplyALEBoundaryCondition() self.fluid_solver.SolveSolutionStep()
def SolveSolutionStep(self): for mesh_solver in self.mesh_motion_solvers: mesh_solver.SolveSolutionStep() for mesh_solver in self.mesh_motion_solvers: KMM.CalculateMeshVelocities(mesh_solver.GetComputingModelPart(), self.time_int_helper) if self.fluid_solver.GetComputingModelPart().ProcessInfo[ KM.TIME] >= self.start_fluid_solution_time: self.__ApplyALEBoundaryCondition() self.fluid_solver.SolveSolutionStep()
def RunSolutionLoop(self): """custom to also compute the mesh-velocities""" while self.KeepAdvancingSolutionLoop(): self.time = self._GetSolver().AdvanceInTime(self.time) self.InitializeSolutionStep() self._GetSolver().Predict() self._GetSolver().SolveSolutionStep() KMM.CalculateMeshVelocities( self._GetSolver().GetComputingModelPart(), self.mesh_vel_calc_helper) self.FinalizeSolutionStep() self.OutputSolutionStep()
def SolveSolutionStep(self): is_converged = True for mesh_solver in self.mesh_motion_solvers: is_converged &= mesh_solver.SolveSolutionStep() for mesh_solver in self.mesh_motion_solvers: KMM.CalculateMeshVelocities( mesh_solver.GetComputingModelPart(), self.time_int_helper) for variable in KM.kratos_utilities.GenerateVariableListFromInput(self.settings["superimpose_mesh_velocity_with"]): KMM.SuperImposeMeshVelocity(variable) if self.fluid_solver.GetComputingModelPart().ProcessInfo[KM.TIME] >= self.start_fluid_solution_time: self.__ApplyALEBoundaryCondition() is_converged &= self.fluid_solver.SolveSolutionStep() return is_converged