コード例 #1
0
 def _GetAutomaticTimeSteppingUtility(self):
     if (self.GetComputingModelPart().ProcessInfo[Kratos.DOMAIN_SIZE] == 2):
         EstimateDeltaTimeUtility = KratosCFD.EstimateDtUtility2D(
             self.GetComputingModelPart(), self.settings["time_stepping"])
     else:
         EstimateDeltaTimeUtility = KratosCFD.EstimateDtUtility3D(
             self.GetComputingModelPart(), self.settings["time_stepping"])
     return EstimateDeltaTimeUtility
コード例 #2
0
ファイル: fluid_solver.py プロジェクト: ozw4/Kratos
    def _GetAutomaticTimeSteppingUtility(self):
        if (self.computing_model_part.ProcessInfo[KratosMultiphysics.DOMAIN_SIZE] == 2):
            EstimateDeltaTimeUtility = KratosCFD.EstimateDtUtility2D(self.computing_model_part,
                                                                     self.settings["time_stepping"])
        else:
            EstimateDeltaTimeUtility = KratosCFD.EstimateDtUtility3D(self.computing_model_part,
                                                                     self.settings["time_stepping"])

        return EstimateDeltaTimeUtility
コード例 #3
0
ファイル: fluid_solver.py プロジェクト: wacyyang/Kratos
    def _CreateEstimateDtUtility(self):
        domain_size = self.GetComputingModelPart().ProcessInfo[
            KratosMultiphysics.DOMAIN_SIZE]
        if domain_size == 2:
            estimate_dt_utility = KratosCFD.EstimateDtUtility2D(
                self.GetComputingModelPart(), self.settings["time_stepping"])
        else:
            estimate_dt_utility = KratosCFD.EstimateDtUtility3D(
                self.GetComputingModelPart(), self.settings["time_stepping"])

        return estimate_dt_utility
コード例 #4
0
    def Initialize(self):
        #self.computing_model_part = self.GetComputingModelPart()

        # If needed, create the estimate time step utility
        if (self.settings["time_stepping"]["automatic_time_step"].GetBool()):
            self.EstimateDeltaTimeUtility = KratosFluid.EstimateDtUtility2D(
                self.model_part, self.settings["time_stepping"])

        # Creating the solution strategy for the mesh stage
        self.conv_criteria = KratosMultiphysics.DisplacementCriteria(
            self.settings["relative_tolerance"].GetDouble(),
            self.settings["absolute_tolerance"].GetDouble())
        (self.conv_criteria).SetEchoLevel(
            self.settings["convergence_echo_level"].GetInt())

        #~ self.time_scheme = KratosMultiphysics.ResidualBasedIncrementalUpdateStaticScheme()
        self.time_scheme = KratosMultiphysics.ResidualBasedIncrementalUpdateStaticSchemeSlip(
            self.domain_size,  # DomainSize
            self.domain_size + 1)  # BlockSize

        builder_and_solver = KratosMultiphysics.ResidualBasedBlockBuilderAndSolver(
            self.linear_solver)

        self.solver = KratosMultiphysics.ResidualBasedNewtonRaphsonStrategy(
            self.model_part, self.time_scheme, self.linear_solver,
            self.conv_criteria, builder_and_solver,
            self.settings["maximum_iterations"].GetInt(),
            self.settings["compute_reactions"].GetBool(),
            self.settings["reform_dofs_at_each_step"].GetBool(),
            self.settings["move_mesh_flag"].GetBool())

        self.model_part.ProcessInfo.SetValue(
            KratosMultiphysics.DYNAMIC_TAU,
            self.settings["dynamic_tau"].GetDouble())

        (self.solver).SetEchoLevel(self.settings["solver_echo_level"].GetInt())
        (self.solver).Check()

        (self.solver).Initialize()

        print("Mesh stage solver initialization finished")