def GetFluidLoaderCounter(self): return SDP.Counter( steps_in_cycle=self. project_parameters["DEM_steps_per_fluid_load_step"].GetInt(), beginning_step=1, is_dead=not self.project_parameters["fluid_already_calculated"]. GetBool())
def GetStationarityCounter(self): return SDP.Counter( steps_in_cycle=self.project_parameters["stationarity"] ["time_steps_per_stationarity_step"].GetInt(), beginning_step=1, is_active=self.project_parameters["stationarity"] ["stationary_problem_option"].GetBool())
def ProcessAnalyticDataCounter(self): return SDP.Counter( steps_in_cycle=self.project_parameters["stationarity"] ["time_steps_per_analytic_processing_step"].GetInt(), beginning_step=1, is_active=self.project_parameters["do_process_analytic_data"]. GetBool())
def GetHistoryForceQuadratureCounter(self): for prop in self.project_parameters["properties"].values(): if prop["hydrodynamic_law_parameters"].Has( "history_force_parameters"): history_force_parameters = prop["hydrodynamic_law_parameters"][ "history_force_parameters"] if history_force_parameters.Has( "time_steps_per_quadrature_step"): time_steps_per_quadrature_step = history_force_parameters[ "time_steps_per_quadrature_step"].GetInt() return SDP.Counter( steps_in_cycle=time_steps_per_quadrature_step, beginning_step=1) return SDP.Counter(is_dead=True)
def GetPrintCounterUpdatedDEM(self): counter = SDP.Counter( steps_in_cycle=int(self.output_time / self.Dt_DEM + 0.5), beginning_step=int(self.Dt / self.Dt_DEM)) if 'UpdatedDEM' != self.pp.CFD_DEM["coupling_scheme_type"].GetString(): counter.Kill() return counter
def GetPrintCounterUpdatedFluid(self): counter = SDP.Counter( steps_in_cycle=int(self.output_time / self.Dt_DEM + 0.5), beginning_step=int(self.output_time / self.Dt_DEM), is_dead = not self.pp.CFD_DEM["do_print_results_option"].GetBool()) if 'UpdatedFluid' != self.pp.CFD_DEM["coupling_scheme_type"].GetString(): counter.Kill() return counter
def __init__(self, model_part, Dt, final_time, variables_to_measure, steps_between_measurements, activity=True): self.model_part = model_part self.steps_between_measurements = steps_between_measurements self.Dt = Dt * steps_between_measurements self.final_time = final_time self.variables = variables_to_measure self.n_vars = len(variables_to_measure) self.n_instants = int(math.ceil(self.final_time / self.Dt + 1)) self.current_instant = 0 self.counter = swimming_DEM_procedures.Counter( steps_between_measurements, 1, activity)
def GetEmbeddedCounter(self): return SDP.Counter( 1, 3, self.pp.CFD_DEM.embedded_option ) # MA: because I think DISTANCE,1 (from previous time step) is not calculated correctly for step=1
def GetFluidSolveCounter(self): return SDP.Counter(is_dead=(self.pp.CFD_DEM.drag_force_type == 9))
while current_time < (current_time_plus_increment - tolerance * delta_time): yield current_time current_time += delta_time current_time = current_time_plus_increment yield current_time ###################################################################################################################################### # I N I T I A L I Z I N G T I M E L O O P ... ( M I X E D F L U I D / D E M B L O C K ) ###################################################################################################################################### # setting up loop counters: Counter(steps_per_tick_step, initial_step, active_or_inactive_boolean) embedded_counter = swim_proc.Counter(1, 3, DEM_parameters.embedded_option) # MA: because I think DISTANCE,1 (from previous time step) is not calculated correctly for step=1 DEM_to_fluid_counter = swim_proc.Counter(1, 1, DEM_parameters.coupling_level_type > 1) pressure_gradient_counter = swim_proc.Counter(1, 1, DEM_parameters.coupling_level_type or pp.CFD_DEM.print_PRESSURE_GRADIENT_option) stationarity_counter = swim_proc.Counter(DEM_parameters.time_steps_per_stationarity_step, 1, DEM_parameters.stationary_problem_option) print_counter = swim_proc.Counter(1, 1, out >= output_time) debug_info_counter = swim_proc.Counter(DEM_parameters.debug_tool_cycle, 1,
yield current_time ###################################################################################################################################### # I N I T I A L I Z I N G T I M E L O O P ... ( M I X E D F L U I D / D E M B L O C K ) ###################################################################################################################################### DEM_step = 0 # necessary to get a good random insertion of particles # relevant to the stationarity assessment tool time_dem = 0.0 Dt_DEM = balls_model_part.ProcessInfo.GetValue(DELTA_TIME) rigid_faces_model_part.ProcessInfo[DELTA_TIME] = Dt_DEM clusters_model_part.ProcessInfo[DELTA_TIME] = Dt_DEM stationarity = False coupling_counter = swim_proc.Counter(10) stationarity_counter = swim_proc.Counter( ProjectParameters.time_steps_per_stationarity_step, 1) mesh_motion = DEMFEMUtilities() swim_proc.InitializeVariablesWithNonZeroValues( fluid_model_part, balls_model_part) # all variables are set to 0 by default while (time <= final_time): time = time + Dt step += 1 fluid_model_part.CloneTimeStep(time) print("\n", "TIME = ", time) sys.stdout.flush()
def GetDebugInfo(self): return SDP.Counter(self.project_parameters["debug_tool_cycle"].GetInt(), 1, is_dead = 1)
def GetHistoryForceQuadratureCounter(self): return SDP.Counter( self.pp.CFD_DEM["time_steps_per_quadrature_step"].GetInt(), 1, self.pp.CFD_DEM["basset_force_type"].GetInt())
def GetStationarityCounter(self): return SDP.Counter(self.pp.CFD_DEM.time_steps_per_stationarity_step, 1, self.pp.CFD_DEM.stationary_problem_option)
def HistoryForceQuadratureCounter(self): return SDP.Counter(self.pp.CFD_DEM.time_steps_per_quadrature_step, 1, self.pp.CFD_DEM.basset_force_type)
def GetDebugInfo(self): return SDP.Counter(self.pp.CFD_DEM.debug_tool_cycle, 1, self.pp.CFD_DEM.print_debug_info_option)
def GetRecoveryCounter(self): there_is_something_to_recover = ( self.project_parameters["coupling"] ["coupling_level_type"].GetInt() or self. project_parameters["print_PRESSURE_GRADIENT_option"].GetBool()) return SDP.Counter(1, 1, there_is_something_to_recover)
def GetDebugInfo(self): return SDP.Counter( self.pp.CFD_DEM["debug_tool_cycle"].GetInt(), 1, self.pp.CFD_DEM["print_debug_info_option"].GetBool())
def GetDebugInfo(self): return SDP.Counter(self.pp.CFD_DEM["debug_tool_cycle"].GetInt(), 1, is_dead = 1)
def GetFluidSolveCounter(self): return SDP.Counter(is_dead = True)
def ProcessAnalyticDataCounter(self): return SDP.Counter( steps_in_cycle=self.pp. CFD_DEM["time_steps_per_analytic_processing_step"].GetInt(), beginning_step=1, is_active=self.pp.CFD_DEM["do_process_analytic_data"].GetBool())
def GetBackwardCouplingCounter(self): return SDP.Counter(1, 1, self.pp.CFD_DEM.coupling_level_type > 1)
def GetRecoveryCounter(self): return SDP.Counter( 1, 1, self.pp.CFD_DEM.coupling_level_type or self.pp.CFD_DEM.print_PRESSURE_GRADIENT_option)
def GetBackwardCouplingCounter(self): return SDP.Counter(1, 4, 0)
def GetPrintCounter(self): return SDP.Counter(1, 1, 10) # still unused
def GetParticlesResultsCounter(self): return SDP.Counter( self.pp.CFD_DEM["print_particles_results_cycle"].GetInt(), 1, self.pp.CFD_DEM["print_particles_results_option"].GetBool())
def GetParticlesResultsCounter(self): return SDP.Counter(self.pp.CFD_DEM.print_particles_results_cycle, 1, self.pp.CFD_DEM.print_particles_results_option)
def GetCationConcentrationCounter(self): return SDP.Counter(self.pp.cation_concentration_frequence, 1)
def GetDebugInfo(self): return SDP.Counter(is_dead=True)
def GetEmbeddedCounter(self): return SDP.Counter(is_dead=True)