def Initialize(self): model_part = self.GetBaseModelPart() model = model_part.GetModel() process_info = model_part.ProcessInfo wall_model_part_name = process_info[KratosRANS.WALL_MODEL_PART_NAME] c_mu = process_info[KratosRANS.TURBULENCE_RANS_C_MU] kappa = process_info[KratosRANS.WALL_VON_KARMAN] minimum_nut = self.GetParameters()["minimum_turbulent_viscosity"].GetDouble() nut_process = KratosRANS.RansNutKEpsilonUpdateProcess( model, self.GetBaseModelPart().Name, c_mu, minimum_nut, self.echo_level) self.AddProcess(nut_process) nut_wall_process = KratosRANS.RansNutYPlusWallFunctionUpdateProcess( model, wall_model_part_name, kappa, minimum_nut, self.echo_level) self.AddProcess(nut_wall_process) super().Initialize()
def Initialize(self): model_part = self.GetBaseModelPart() model = model_part.GetModel() process_info = model_part.ProcessInfo wall_model_part_name = process_info[KratosRANS.WALL_MODEL_PART_NAME] settings = self.GetParameters() wall_distance_calculation_settings = settings[ "wall_distance_calculation_settings"] wall_distance_calculation_settings.AddEmptyValue( "main_model_part_name") wall_distance_calculation_settings["main_model_part_name"].SetString( self.GetBaseModelPart().Name) wall_distance_calculation_settings.AddEmptyValue( "wall_model_part_name") wall_distance_calculation_settings["wall_model_part_name"].SetString( wall_model_part_name) wall_distance_process = RansWallDistanceCalculationProcess( model, wall_distance_calculation_settings) self.AddProcess(wall_distance_process) minimum_nut = settings["minimum_turbulent_viscosity"].GetDouble() nut_process = KratosRANS.RansNutKOmegaSSTUpdateProcess( model, self.GetBaseModelPart().Name, minimum_nut, self.echo_level) self.AddProcess(nut_process) nut_wall_process = KratosRANS.RansNutYPlusWallFunctionUpdateProcess( model, wall_model_part_name, minimum_nut, self.echo_level) self.AddProcess(nut_wall_process) super().Initialize()
def Initialize(self): super().Initialize() nut_nodal_update_process = KratosRANS.RansNutNodalUpdateProcess( self.GetBaseModelPart().GetModel(), self.GetBaseModelPart().Name, self.k_omega_formulation.echo_level) self.k_omega_formulation.AddProcess(nut_nodal_update_process)
def Initialize(self): super().Initialize() if (self.monolithic_formulation.ElementHasNodalProperties()): nut_nodal_update_process = KratosRANS.RansNutNodalUpdateProcess( self.GetBaseModelPart().GetModel(), self.GetBaseModelPart().Name, self.k_omega_formulation.echo_level) self.k_omega_formulation.AddProcess(nut_nodal_update_process)
def Initialize(self): model_part = self.GetBaseModelPart() model = model_part.GetModel() process_info = model_part.ProcessInfo wall_model_part_name = process_info[KratosRANS.WALL_MODEL_PART_NAME] minimum_nut = self.GetParameters( )["minimum_turbulent_viscosity"].GetDouble() nut_process = KratosRANS.RansNutKOmegaUpdateProcess( model, self.GetBaseModelPart().Name, minimum_nut, self.echo_level) self.AddProcess(nut_process) nut_wall_process = KratosRANS.RansNutYPlusWallFunctionUpdateProcess( model, wall_model_part_name, minimum_nut, self.echo_level) self.AddProcess(nut_wall_process) super().Initialize()
def Initialize(self): model_part = self.GetBaseModelPart() model = model_part.GetModel() settings = self.GetParameters() wall_distance_calculation_settings = settings["wall_distance_calculation_settings"] wall_distance_calculation_settings.AddEmptyValue("model_part_name") wall_distance_calculation_settings["model_part_name"].SetString(self.GetBaseModelPart().Name) wall_distance_process_type = GetKratosObjectPrototype("RansWallDistanceCalculationProcess") wall_distance_process = wall_distance_process_type(model, wall_distance_calculation_settings) self.AddProcess(wall_distance_process) process_info = model_part.ProcessInfo a1 = process_info[KratosRANS.TURBULENCE_RANS_A1] beta_star = process_info[KratosRANS.TURBULENCE_RANS_C_MU] wall_model_part_name = process_info[KratosRANS.WALL_MODEL_PART_NAME] kappa = process_info[KratosRANS.WALL_VON_KARMAN] minimum_nut = settings["minimum_turbulent_viscosity"].GetDouble() nut_process = KratosRANS.RansNutKOmegaSSTUpdateProcess( model, self.GetBaseModelPart().Name, a1, beta_star, minimum_nut, self.echo_level) self.AddProcess(nut_process) nut_wall_process = KratosRANS.RansNutYPlusWallFunctionUpdateProcess( model, wall_model_part_name, kappa, minimum_nut, self.echo_level) self.AddProcess(nut_wall_process) super().Initialize()
def Initialize(self): model_part = self.GetBaseModelPart() CalculateNormalsOnConditions(model_part) process_info = model_part.ProcessInfo wall_model_part_name = process_info[KratosRANS.WALL_MODEL_PART_NAME] wall_function_update_process = KratosRANS.RansWallFunctionUpdateProcess( model_part.GetModel(), wall_model_part_name, self.echo_level) self.AddProcess(wall_function_update_process) if (self.IsPeriodic()): InitializePeriodicConditions( model_part, self.fractional_step_model_part, None, "FSPeriodicCondition{0:d}D".format(self.GetDomainSize())) settings = self.GetParameters() self.solver_settings = self._CreateSolverSettings( self.fractional_step_model_part, self.GetDomainSize(), settings["time_order"].GetInt(), True, self.GetMoveMeshFlag(), settings["reform_dofs_at_each_step"].GetBool()) self.solver_settings.SetEchoLevel(self.echo_level) ## Construct the linear solvers linear_solver_factory = GetKratosObjectPrototype("LinearSolverFactory") pressure_linear_solver = linear_solver_factory(settings["pressure_linear_solver_settings"]) velocity_linear_solver = linear_solver_factory(settings["velocity_linear_solver_settings"]) strategy_label_type = GetKratosObjectPrototype("StrategyLabel") self.solver_settings.SetStrategy( strategy_label_type.Velocity, velocity_linear_solver, settings["velocity_tolerance"].GetDouble(), settings["maximum_velocity_iterations"].GetInt()) self.solver_settings.SetStrategy( strategy_label_type.Pressure, pressure_linear_solver, settings["pressure_tolerance"].GetDouble(), settings["maximum_pressure_iterations"].GetInt()) solver_type = GetKratosObjectPrototype("FractionalStepStrategy") if self.IsPeriodic(): self.solver = solver_type( self.fractional_step_model_part, self.solver_settings, settings["predictor_corrector"].GetBool(), False, KratosCFD.PATCH_INDEX) else: self.solver = solver_type( self.fractional_step_model_part, self.solver_settings, settings["predictor_corrector"].GetBool(), False) process_info.SetValue(Kratos.DYNAMIC_TAU, settings["dynamic_tau"].GetDouble()) process_info.SetValue(Kratos.OSS_SWITCH, settings["oss_switch"].GetInt()) super().Initialize() Kratos.Logger.PrintInfo(self.__class__.__name__, "Solver initialization finished.")