def setUpModel(self): self.model = Model() with open("solver_settings.json", "r") as settings_file: settings = Parameters(settings_file.read()) settings["solver_settings"]["model_import_settings"][ "input_filename"].SetString(self.input_file) thermal_settings = ConvectionDiffusionSettings() thermal_settings.SetUnknownVariable(TEMPERATURE) thermal_settings.SetDensityVariable(DENSITY) thermal_settings.SetSpecificHeatVariable(SPECIFIC_HEAT) thermal_settings.SetDiffusionVariable(CONDUCTIVITY) #thermal_settings.SetVolumeSourceVariable(HEAT_FLUX) #thermal_settings.SetSurfaceSourceVariable(FACE_HEAT_FLUX) thermal_settings.SetVelocityVariable(VELOCITY) thermal_settings.SetMeshVelocityVariable(MESH_VELOCITY) if self.convection_diffusion_solver == 'bfecc': thermal_settings.SetProjectionVariable(ConvDiff.PROJECTED_SCALAR1) self.fluid_solver = navier_stokes_solver.CreateSolver( self.model, settings["solver_settings"]) print(self.model) self.fluid_model_part = self.model.GetModelPart( settings["solver_settings"]["model_part_name"].GetString()) self.fluid_model_part.ProcessInfo.SetValue( CONVECTION_DIFFUSION_SETTINGS, thermal_settings)
def setUpModel(self): self.model = Model() with open("solver_settings.json", "r") as settings_file: settings = Parameters(settings_file.read()) settings["solver_settings"]["formulation"]["element_type"].SetString( self.element) settings["solver_settings"]["formulation"].AddEmptyValue( "use_orthogonal_subscales") settings["solver_settings"]["formulation"][ "use_orthogonal_subscales"].SetBool(self.oss_switch) self.fluid_solver = navier_stokes_solver.CreateSolver( self.model, settings["solver_settings"]) self.fluid_solver.AddVariables() self.fluid_solver.ImportModelPart() self.fluid_solver.PrepareModelPart() self.fluid_solver.AddDofs() self.fluid_model_part = self.model.GetModelPart("Fluid")
def setUpModelTimeIntegrated(self): self.model = Model() with open("solver_settings.json", "r") as settings_file: settings = Parameters(settings_file.read()) settings["solver_settings"]["formulation"]["element_type"].SetString( self.element) settings["solver_settings"]["formulation"].AddEmptyValue("dynamic_tau") settings["solver_settings"]["formulation"]["dynamic_tau"].SetDouble( 0.0) if self.element == "qsvms": settings["solver_settings"]["formulation"].AddEmptyValue( "use_orthogonal_subscales") settings["solver_settings"]["formulation"][ "use_orthogonal_subscales"].SetBool(self.oss_switch) settings["solver_settings"]["formulation"].AddEmptyValue( "element_manages_time_integration") settings["solver_settings"]["formulation"][ "element_manages_time_integration"].SetBool(True) elif self.element == "symbolic": settings["solver_settings"]["formulation"].AddEmptyValue( "sound_velocity") settings["solver_settings"]["formulation"][ "sound_velocity"].SetDouble(1e12) settings["solver_settings"].AddEmptyValue("time_scheme") settings["solver_settings"]["time_scheme"].SetString("bdf2") self.fluid_solver = navier_stokes_solver.CreateSolver( self.model, settings["solver_settings"]) self.fluid_solver.AddVariables() self.fluid_solver.ImportModelPart() self.fluid_solver.PrepareModelPart() self.fluid_solver.AddDofs() fluid_model_part_name = settings["solver_settings"][ "model_part_name"].GetString() + "." + settings["solver_settings"][ "volume_model_part_name"].GetString() self.fluid_model_part = self.model.GetModelPart(fluid_model_part_name)