Ejemplo n.º 1
0
    def get_equations(self):
        from pysph.sph.equation import Group
        from pysph.sph.basic_equations import (ContinuityEquation,
                                               MonaghanArtificialViscosity,
                                               XSPHCorrection,
                                               VelocityGradient2D)
        from pysph.sph.solid_mech.basic import (IsothermalEOS,
                                                MomentumEquationWithStress,
                                                HookesDeviatoricStressRate,
                                                MonaghanArtificialStress)

        equations = []
        g1 = []
        all = self.solids + self.elastic_solids
        for elastic_solid in self.elastic_solids:
            g1.append(
                # p
                IsothermalEOS(elastic_solid, sources=None))
            g1.append(
                # vi,j : requires properties v00, v01, v10, v11
                VelocityGradient2D(dest=elastic_solid, sources=all))
            g1.append(
                # rij : requires properties r00, r01, r02, r11, r12, r22,
                #                           s00, s01, s02, s11, s12, s22
                MonaghanArtificialStress(dest=elastic_solid,
                                         sources=None,
                                         eps=self.artificial_stress_eps))

        equations.append(Group(equations=g1))

        g2 = []
        for elastic_solid in self.elastic_solids:
            g2.append(ContinuityEquation(dest=elastic_solid, sources=all), )
            g2.append(
                # au, av
                MomentumEquationWithStress(dest=elastic_solid, sources=all), )
            g2.append(
                # au, av
                MonaghanArtificialViscosity(dest=elastic_solid,
                                            sources=all,
                                            alpha=self.alpha,
                                            beta=self.beta), )
            g2.append(
                # a_s00, a_s01, a_s11
                HookesDeviatoricStressRate(dest=elastic_solid, sources=None), )
            g2.append(
                # ax, ay, az
                XSPHCorrection(dest=elastic_solid,
                               sources=[elastic_solid],
                               eps=self.xsph_eps), )
        equations.append(Group(g2))

        return equations
Ejemplo n.º 2
0
    def create_equations(self):
        equations = [

            # Properties computed set from the current state
            Group(
                equations=[
                    # p
                    MieGruneisenEOS(dest='bar',
                                    sources=None,
                                    gamma=gamma,
                                    r0=r0,
                                    c0=C,
                                    S=S),

                    # vi,j : requires properties v00, v01, v10, v11
                    VelocityGradient2D(dest='bar', sources=[
                        'bar',
                    ]),

                    # rij : requires properties s00, s01, s11
                    VonMisesPlasticity2D(flow_stress=Yo,
                                         dest='bar',
                                         sources=None),
                ], ),

            # Acceleration variables are now computed
            Group(equations=[

                # arho
                ContinuityEquation(dest='bar', sources=['bar']),

                # au, av
                MomentumEquationWithStress(dest='bar', sources=['bar']),

                # au, av
                MonaghanArtificialViscosity(dest='bar',
                                            sources=['bar'],
                                            alpha=0.5,
                                            beta=0.5),

                # au av
                MonaghanBoundaryForce(dest='bar', sources=['plate'],
                                      deltap=dx),

                # ae
                EnergyEquationWithStress(dest='bar',
                                         sources=['bar'],
                                         alpha=0.5,
                                         beta=0.5,
                                         eta=0.01),

                # a_s00, a_s01, a_s11
                HookesDeviatoricStressRate(dest='bar', sources=None),

                # ax, ay, az
                XSPHCorrection(dest='bar', sources=[
                    'bar',
                ], eps=0.5),
            ])  # End Acceleration Group
        ]  # End Group list
        return equations
Ejemplo n.º 3
0
    def create_equations(self):
        equations = [

            # update smoothing length
            # Group(
            #     equations = [
            #         UpdateSmoothingLengthFromVolume(dest='plate',      sources=['plate', 'projectile'], dim=2, k=hdx),
            #         UpdateSmoothingLengthFromVolume(dest='projectile', sources=['plate', 'projectile'], dim=2, k=hdx),
            #     ],
            #     update_nnps=True,
            # ),

            # compute properties from the current state
            Group(equations=[
                # EOS (compute the pressure using  one of the EOSs)

                #MieGruneisenEOS(dest='plate',      sources=None, gamma=gamma1, r0=ro1 , c0=C1, S=S1),
                #MieGruneisenEOS(dest='projectile', sources=None, gamma=gamma2, r0=ro2 , c0=C2, S=S2),
                StiffenedGasEOS(
                    dest='plate', sources=None, gamma=gamma1, r0=ro1, c0=C1),
                StiffenedGasEOS(dest='projectile',
                                sources=None,
                                gamma=gamma2,
                                r0=ro2,
                                c0=C2),

                # compute the velocity gradient tensor
                VelocityGradient2D(dest='plate', sources=['plate']),
                VelocityGradient2D(dest='projectile', sources=['projectile']),

                # stress
                VonMisesPlasticity2D(
                    dest='plate', sources=None, flow_stress=Yo1),
                VonMisesPlasticity2D(
                    dest='projectile', sources=None, flow_stress=Yo2),

                # artificial stress to avoid clumping
                MonaghanArtificialStress(dest='plate', sources=None, eps=0.3),
                MonaghanArtificialStress(
                    dest='projectile', sources=None, eps=0.3),
            ]),

            # accelerations (rho, u, v, ...)
            Group(equations=[

                # continuity equation
                ContinuityEquation(dest='plate',
                                   sources=['projectile', 'plate']),
                ContinuityEquation(dest='projectile',
                                   sources=['projectile', 'plate']),

                # momentum equation
                MomentumEquationWithStress(dest='projectile',
                                           sources=[
                                               'projectile',
                                               'plate',
                                           ],
                                           n=4,
                                           wdeltap=self.wdeltap),
                MomentumEquationWithStress(dest='plate',
                                           sources=[
                                               'projectile',
                                               'plate',
                                           ],
                                           n=4,
                                           wdeltap=self.wdeltap),

                # energy equation:
                EnergyEquationWithStress(dest='plate',
                                         sources=[
                                             'projectile',
                                             'plate',
                                         ],
                                         alpha=avisc_alpha,
                                         beta=avisc_beta,
                                         eta=avisc_eta),
                EnergyEquationWithStress(dest='projectile',
                                         sources=[
                                             'projectile',
                                             'plate',
                                         ],
                                         alpha=avisc_alpha,
                                         beta=avisc_beta,
                                         eta=avisc_eta),

                # avisc
                MonaghanArtificialViscosity(dest='plate',
                                            sources=['projectile', 'plate'],
                                            alpha=avisc_alpha,
                                            beta=avisc_beta),
                MonaghanArtificialViscosity(dest='projectile',
                                            sources=['projectile', 'plate'],
                                            alpha=avisc_alpha,
                                            beta=avisc_beta),

                # updates to the stress term
                HookesDeviatoricStressRate(
                    dest='plate', sources=None, shear_mod=G1),
                HookesDeviatoricStressRate(
                    dest='projectile', sources=None, shear_mod=G2),

                # position stepping
                XSPHCorrection(dest='plate', sources=['plate'], eps=xsph_eps),
                XSPHCorrection(
                    dest='projectile', sources=['projectile'], eps=xsph_eps),
            ]),
        ]  # End Group list

        return equations
Ejemplo n.º 4
0
    def create_equations(self):
        equations = [

            # Properties computed set from the current state
            Group(
                equations=[
                    # p
                    IsothermalEOS(dest='solid',
                                  sources=None,
                                  rho0=rho0,
                                  c0=c0,
                                  p0=0.0),

                    # vi,j : requires properties v00, v01, v10, v11
                    VelocityGradient2D(dest='solid', sources=[
                        'solid',
                    ]),

                    # rij : requires properties r00, r01, r02, r11, r12, r22,
                    #                           s00, s01, s02, s11, s12, s22
                    MonaghanArtificialStress(dest='solid',
                                             sources=None,
                                             eps=0.3),
                ], ),

            # Acceleration variables are now computed
            Group(equations=[

                # arho
                ContinuityEquation(dest='solid', sources=[
                    'solid',
                ]),

                # au, av
                MomentumEquationWithStress(dest='solid',
                                           sources=[
                                               'solid',
                                           ],
                                           n=4,
                                           wdeltap=self.wdeltap),

                # au, av
                MonaghanArtificialViscosity(dest='solid',
                                            sources=[
                                                'solid',
                                            ],
                                            alpha=1.0,
                                            beta=1.0),

                # a_s00, a_s01, a_s11
                HookesDeviatoricStressRate(dest='solid',
                                           sources=None,
                                           shear_mod=G),

                # ax, ay, az
                XSPHCorrection(dest='solid', sources=[
                    'solid',
                ], eps=0.5),
            ])  # End Acceleration Group
        ]  # End Group list
        return equations