# Add variables (always before importing the model part) solver.AddVariables() from KratosMultiphysics.PfemFluidDynamicsApplication import pfem_variables pfem_variables.AddVariables(main_model_part) #thermal thing: import eulerian_convection_diffusion_solver as convection_diffusion_solver_scripts #we create the thermal settings. thermal_settings = KratosMultiphysics.ConvectionDiffusionSettings() thermal_settings.SetDiffusionVariable(KratosMultiphysics.CONDUCTIVITY) thermal_settings.SetUnknownVariable(KratosMultiphysics.TEMPERATURE) (main_model_part.ProcessInfo).SetValue( KratosMultiphysics.CONVECTION_DIFFUSION_SETTINGS, thermal_settings) #adding the variables of the diffusion problem: convection_diffusion_solver_scripts.AddVariables( main_model_part) # no settings here! (read from the model_part) # Read model_part (note: the buffer_size is set here) (restart is read here) solver.ImportModelPart() # Add dofs (always after importing the model part) if ((main_model_part.ProcessInfo).Has(KratosMultiphysics.IS_RESTARTED)): if (main_model_part.ProcessInfo[KratosMultiphysics.IS_RESTARTED] == False): solver.AddDofs() else: solver.AddDofs() #adding variables for the thermal problem convection_diffusion_solver_scripts.AddDofs(main_model_part) #TEMP!!!!!!!! BOUNDARY CONDITIONS MUST ALSO BE SET BY THE USER!
# Update time variables delta_time = delta_time * time_unit_converter ending_time = ending_time * time_unit_converter # List of variables to write nodal_res = ProjectParameters.nodal_results gp_res = ProjectParameters.gauss_points_results ## Model part ------------------------------------------------------------------------------------------------ # Definition of model part model_part = ModelPart("SolidDomain") # Setting thermal variables diffusion_solver.AddVariables(model_part, ProjectParameters.DiffusionSolverSettings) # Set mechanical variables mechanical_solver.AddVariables(model_part) # Reading model part model_part_io = ModelPartIO(problem_name) model_part_io.ReadModelPart(model_part) # Set buffer size buffer_size = 2 model_part.SetBufferSize(buffer_size) # Set thermal degrees of freedom diffusion_solver.AddDofs(model_part)