예제 #1
0
    def SolveSolutionStep(self):
        # Calling Solve bcs this is what is currently implemented in the MeshSolverStrategies
        # explicit bool conversion is only needed bcs "Solve" returns a double
        is_converged = bool(self.get_mesh_motion_solving_strategy().Solve())
        self.MoveMesh()

        # Superimpose the user-defined mesh displacement
        for variable in KratosMultiphysics.kratos_utilities.GenerateVariableListFromInput(
                self.settings["superimpose_mesh_disp_with"]):
            KMM.SuperImposeMeshDisplacement(variable)

        # Superimpose the user-defined mesh velocity
        for variable in KratosMultiphysics.kratos_utilities.GenerateVariableListFromInput(
                self.settings["superimpose_mesh_velocity_with"]):
            KMM.SuperImposeMeshVelocity(variable)

        return is_converged
예제 #2
0
    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