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())
예제 #2
0
 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())
예제 #3
0
 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())
예제 #4
0
    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)
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
 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)
예제 #8
0
 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
예제 #9
0
 def GetFluidSolveCounter(self):
     return SDP.Counter(is_dead=(self.pp.CFD_DEM.drag_force_type == 9))
예제 #10
0
    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, 
예제 #11
0
    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()
예제 #12
0
 def GetDebugInfo(self):
     return SDP.Counter(self.project_parameters["debug_tool_cycle"].GetInt(), 1, is_dead = 1)
예제 #13
0
 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())
예제 #14
0
 def GetStationarityCounter(self):
     return SDP.Counter(self.pp.CFD_DEM.time_steps_per_stationarity_step, 1,
                        self.pp.CFD_DEM.stationary_problem_option)
예제 #15
0
 def HistoryForceQuadratureCounter(self):
     return SDP.Counter(self.pp.CFD_DEM.time_steps_per_quadrature_step, 1,
                        self.pp.CFD_DEM.basset_force_type)
예제 #16
0
 def GetDebugInfo(self):
     return SDP.Counter(self.pp.CFD_DEM.debug_tool_cycle, 1,
                        self.pp.CFD_DEM.print_debug_info_option)
예제 #17
0
 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)
예제 #18
0
 def GetDebugInfo(self):
     return SDP.Counter(
         self.pp.CFD_DEM["debug_tool_cycle"].GetInt(), 1,
         self.pp.CFD_DEM["print_debug_info_option"].GetBool())
예제 #19
0
 def GetDebugInfo(self):
     return SDP.Counter(self.pp.CFD_DEM["debug_tool_cycle"].GetInt(), 1, is_dead = 1)
예제 #20
0
 def GetFluidSolveCounter(self):
     return SDP.Counter(is_dead = True)
예제 #21
0
 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())
예제 #22
0
 def GetBackwardCouplingCounter(self):
     return SDP.Counter(1, 1, self.pp.CFD_DEM.coupling_level_type > 1)
예제 #23
0
 def GetRecoveryCounter(self):
     return SDP.Counter(
         1, 1, self.pp.CFD_DEM.coupling_level_type
         or self.pp.CFD_DEM.print_PRESSURE_GRADIENT_option)
예제 #24
0
 def GetBackwardCouplingCounter(self):
     return SDP.Counter(1, 4, 0)
예제 #25
0
 def GetPrintCounter(self):
     return SDP.Counter(1, 1, 10)  # still unused
예제 #26
0
 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())
예제 #27
0
 def GetParticlesResultsCounter(self):
     return SDP.Counter(self.pp.CFD_DEM.print_particles_results_cycle, 1,
                        self.pp.CFD_DEM.print_particles_results_option)
예제 #28
0
 def GetCationConcentrationCounter(self):
     return SDP.Counter(self.pp.cation_concentration_frequence, 1)
예제 #29
0
 def GetDebugInfo(self):
     return SDP.Counter(is_dead=True)
예제 #30
0
 def GetEmbeddedCounter(self):
     return SDP.Counter(is_dead=True)