コード例 #1
0
 def create_equations(self):
     equations = [
         Group(equations=[
             Group(equations=[
                 GatherDensityEvalNextIteration(dest='fluid',
                                                sources=['fluid']),
             ]),
             Group(equations=[NonDimensionalDensityResidual(dest='fluid')]),
             Group(equations=[UpdateSmoothingLength(dim=dim, dest='fluid')],
                   update_nnps=True),
             Group(equations=[
                 CheckConvergenceDensityResidual(dest='fluid')
             ], )
         ],
               iterate=True,
               max_iterations=10),
         Group(equations=[
             CorrectionFactorVariableSmoothingLength(dest='fluid',
                                                     sources=['fluid'])
         ]),
         Group(equations=[
             DaughterVelocityEval(
                 rhow=rho_w, dest='fluid', sources=['fluid'])
         ]),
         Group(equations=[SWEOS(dest='fluid')]),
         Group(equations=[
             ParticleAcceleration(
                 dim=dim, dest='fluid', sources=['fluid'], u_only=True),
         ]),
         Group(equations=[
             CheckForParticlesToSplit(
                 dest='fluid', h_max=self.h_max, A_max=self.A_max)
         ]),
     ]
     return equations
コード例 #2
0
 def create_equations(self):
     equations = [
         Group(equations=[
             Group(equations=[
                 GatherDensityEvalNextIteration(
                     dest='fluid', sources=['fluid', 'boundary']),
             ]),
             Group(equations=[NonDimensionalDensityResidual(dest='fluid')]),
             Group(equations=[UpdateSmoothingLength(dim=dim, dest='fluid')],
                   update_nnps=True),
             Group(equations=[
                 CheckConvergenceDensityResidual(dest='fluid')
             ], )
         ],
               iterate=True,
               max_iterations=10),
         Group(equations=[
             CorrectionFactorVariableSmoothingLength(
                 dest='fluid', sources=['fluid', 'boundary']),
         ]),
         Group(equations=[
             SWEOS(dest='fluid'),
         ]),
         Group(equations=[
             ParticleAcceleration(
                 dim=dim, dest='fluid', sources=['fluid', 'boundary']),
         ]),
     ]
     return equations
コード例 #3
0
def compute_initial_props(particles):
    one_time_equations = [Group(equations=[SWEOS(dest='fluid')], )]
    kernel = CubicSpline(dim=1)
    sph_eval = SPHEvaluator(particles,
                            one_time_equations,
                            dim=1,
                            kernel=kernel)
    sph_eval.evaluate()
コード例 #4
0
    def create_equations(self):
        equations = [
            Group(
                equations=[
                    InitialGuessDensity(dim=dim, dest='fluid', 
                                        sources=['fluid']),
                    UpdateSmoothingLength(dim=dim, dest='fluid')
                ], update_nnps=True
            ),

            Group(
                equations=[
                    CorrectionFactorVariableSmoothingLength(
                        dest='fluid', sources=['fluid']),
                    SummationDensity(dest='fluid', sources=['fluid']),
                    DensityResidual('fluid')
                ]
            ),

            Group(
                equations=[
                    Group(
                        equations=[
                            DensityNewtonRaphsonIteration(dim=dim, 
                                                          dest='fluid'),
                            UpdateSmoothingLength(dim=dim, dest='fluid')
                        ], update_nnps=True
                    ),

                    Group(
                        equations=[
                            CorrectionFactorVariableSmoothingLength(
                                dest='fluid', sources=['fluid']),
                            SummationDensity(dest='fluid', sources=['fluid']),
                            DensityResidual(dest='fluid'),
                            CheckConvergence(dest='fluid')
                        ],
                    )
                ], iterate=True, max_iterations=10
            ),

            Group(
                equations=[
                    CorrectionFactorVariableSmoothingLength(
                        dest='fluid', sources=['fluid']),
                    SWEOS(dest='fluid')
                ]
            ),

            Group(
                equations=[
                    ParticleAcceleration(dim=dim, dest='fluid',
                                         sources=['fluid'])
                ]
            ),
        ]
        return equations
コード例 #5
0
def compute_initial_props(particles):
    one_time_equations = [
        Group(equations=[
            CorrectionFactorVariableSmoothingLength(dest='fluid',
                                                    sources=['fluid'])
        ]),
        Group(equations=[SWEOS(dest='fluid')], )
    ]
    kernel = CubicSpline(dim=2)
    sph_eval = SPHEvaluator(particles,
                            one_time_equations,
                            dim=2,
                            kernel=kernel)
    sph_eval.evaluate()
コード例 #6
0
def compute_initial_props(particles):
    one_time_equations = [
        Group(equations=[
            FluidBottomElevation(dest='fluid', sources=['bed']),
            BedGradient(dest='bed', sources=['bed']),
            CorrectionFactorVariableSmoothingLength(dest='fluid',
                                                    sources=['fluid']),
            SWEOS(dest='fluid')
        ]),
    ]
    kernel = CubicSpline(dim=2)
    sph_eval = SPHEvaluator(particles,
                            one_time_equations,
                            dim=2,
                            kernel=kernel)
    sph_eval.evaluate()
コード例 #7
0
 def create_equations(self):
     equations = [
         Group(equations=[
             Group(equations=[
                 GatherDensityEvalNextIteration(
                     dest='fluid',
                     sources=['inlet', 'fluid', 'outlet', 'boundary']),
             ]),
             Group(equations=[NonDimensionalDensityResidual(dest='fluid')]),
             Group(equations=[UpdateSmoothingLength(dim=dim, dest='fluid')],
                   update_nnps=True),
             Group(equations=[
                 CheckConvergenceDensityResidual(dest='fluid')
             ], )
         ],
               iterate=True,
               max_iterations=10),
         Group(equations=[
             CorrectionFactorVariableSmoothingLength(
                 dest='fluid',
                 sources=['fluid', 'inlet', 'outlet', 'boundary'])
         ]),
         Group(equations=[
             SWEOS(dest='fluid'),
         ]),
         Group(equations=[
             BoundaryInnerReimannStateEval(dest='inlet', sources=['fluid']),
             BoundaryInnerReimannStateEval(dest='outlet', sources=['fluid'])
         ]),
         Group(equations=[
             SubCriticalInFlow(dest='inlet'),
             SubCriticalOutFlow(dest='outlet')
         ]),
         Group(equations=[
             BedFrictionSourceEval(dest='fluid', sources=['bed'])
         ]),
         Group(equations=[
             ParticleAcceleration(
                 dim=dim,
                 dest='fluid',
                 sources=['fluid', 'inlet', 'outlet', 'boundary'])
         ]),
     ]
     return equations
コード例 #8
0
def compute_initial_props(particles):
    one_time_equations = [
        Group(equations=[
            SWEOS(dest='fluid'),
        ]),
        Group(equations=[
            BoundaryInnerReimannStateEval(dest='inlet', sources=['fluid']),
            BoundaryInnerReimannStateEval(dest='outlet', sources=['fluid'])
        ]),
        Group(equations=[
            SubCriticalInFlow(dest='inlet'),
            SubCriticalOutFlow(dest='outlet')
        ]),
        Group(equations=[
            CorrectionFactorVariableSmoothingLength(
                dest='fluid', sources=['fluid', 'inlet', 'outlet', 'boundary'])
        ]),
    ]
    kernel = CubicSpline(dim=2)
    sph_eval = SPHEvaluator(particles,
                            one_time_equations,
                            dim=2,
                            kernel=kernel)
    sph_eval.evaluate()
コード例 #9
0
ファイル: okushiri_tsunami.py プロジェクト: yang7857854/pysph
 def create_equations(self):
     equations = [
         Group(equations=[
             RemoveFluidParticlesWithNoNeighbors(dest='fluid',
                                                 sources=['fluid'])
         ],
               update_nnps=True),
         Group(equations=[
             RemoveOutofDomainParticles(dest='fluid',
                                        x_min=self.x_max_inlet,
                                        x_max=self.le,
                                        y_min=0,
                                        y_max=self.w)
         ],
               update_nnps=True),
         Group(equations=[
             RemoveCloseParticlesAtOpenBoundary(
                 min_dist_ob=self.min_dist_ob,
                 dest='inlet',
                 sources=['inlet'])
         ],
               update_nnps=True),
         Group(equations=[
             Group(equations=[
                 GatherDensityEvalNextIteration(
                     dest='fluid', sources=['inlet', 'fluid', 'boundary']),
             ]),
             Group(equations=[NonDimensionalDensityResidual(dest='fluid')]),
             Group(equations=[UpdateSmoothingLength(dim=dim, dest='fluid')],
                   update_nnps=True),
             Group(equations=[
                 CheckConvergenceDensityResidual(dest='fluid')
             ], )
         ],
               iterate=True,
               max_iterations=10),
         Group(equations=[
             CorrectionFactorVariableSmoothingLength(
                 dest='fluid', sources=['fluid', 'inlet', 'boundary']),
         ], ),
         Group(equations=[
             RemoveParticlesWithZeroAlpha(dest='fluid'),
         ],
               update_nnps=True),
         Group(equations=[
             SWEOS(dest='fluid'),
         ]),
         Group(equations=[
             BoundaryInnerReimannStateEval(dest='inlet', sources=['fluid']),
         ]),
         Group(equations=[
             SubCriticalTimeVaryingOutFlow(dest='inlet'),
         ]),
         Group(equations=[
             BedFrictionSourceEval(dest='fluid', sources=['bed'])
         ]),
         Group(equations=[
             FluidBottomElevation(dest='fluid', sources=['bed'])
         ]),
         Group(
             equations=[FluidBottomGradient(dest='fluid', sources=['bed'])
                        ]),
         Group(equations=[
             FluidBottomCurvature(dest='fluid', sources=['bed'])
         ]),
         Group(equations=[
             ParticleAcceleration(
                 dim=dim,
                 dest='fluid',
                 sources=['fluid', 'inlet', 'boundary'],
             ),
         ]),
     ]
     return equations