def SetProjectParameters(self, parameters): self.project_parameters = parameters self.time_step = self.project_parameters["time_stepping"][ "time_step"].GetDouble() self.end_time = self.project_parameters["problem_data"][ "end_time"].GetDouble() self.do_print_results = self.project_parameters[ "do_print_results_option"].GetBool() self.fluid_parameters = self.project_parameters['fluid_parameters'] # First, read the parameters generated from the interface import swimming_dem_default_input_parameters as only_swimming_defaults import KratosMultiphysics.DEMApplication.dem_default_input_parameters as dem_defaults self.project_parameters.ValidateAndAssignDefaults( only_swimming_defaults.GetDefaultInputParameters()) self.project_parameters["dem_parameters"].ValidateAndAssignDefaults( dem_defaults.GetDefaultInputParameters()) # Second, set the default 'beta' parameters (candidates to be moved to the interface) self.SetBetaParameters() # Third, make sure the parameters passed to the different (sub-)analyses is coherent # with the general parameters self.ModifyInputParametersForCoherence()
def ReadDispersePhaseAndCouplingParameters(self): self.pp.CFD_DEM = self.project_parameters # TO-DO: remove this import swimming_dem_default_input_parameters only_swimming_defaults = swimming_dem_default_input_parameters.GetDefaultInputParameters() self.project_parameters.ValidateAndAssignDefaults(only_swimming_defaults)
def GetDefaultInputParameters(self): import dem_default_input_parameters dem_defaults = dem_default_input_parameters.GetDefaultInputParameters() import swimming_dem_default_input_parameters only_swimming_defaults = swimming_dem_default_input_parameters.GetDefaultInputParameters() for key in only_swimming_defaults.keys(): dem_defaults.AddValue(key, only_swimming_defaults[key]) return dem_defaults
def ReadDispersePhaseAndCouplingParameters(self): with open(self.main_path + '/ProjectParametersDEM.json', 'r') as parameters_file: self.pp.CFD_DEM = Parameters(parameters_file.read()) import dem_default_input_parameters dem_defaults = dem_default_input_parameters.GetDefaultInputParameters() import swimming_dem_default_input_parameters only_swimming_defaults = swimming_dem_default_input_parameters.GetDefaultInputParameters() for key in only_swimming_defaults.keys(): dem_defaults.AddValue(key, only_swimming_defaults[key]) self.pp.CFD_DEM.ValidateAndAssignDefaults(dem_defaults)