Example #1
0
    def create_equations(self):
        adami_equations = [
            Group(equations=[
                SummationDensity(dest='liquid',
                                 sources=['liquid', 'wall', 'gas']),
                SummationDensity(dest='gas', sources=['liquid', 'wall', 'gas'
                                                      ]),
                SummationDensity(dest='wall',
                                 sources=['liquid', 'wall', 'gas'])
            ]),
            Group(equations=[
                TaitEOS(dest='liquid',
                        sources=None,
                        rho0=rho1,
                        c0=c0,
                        gamma=1,
                        p0=p1),
                TaitEOS(
                    dest='gas', sources=None, rho0=rho2, c0=c0, gamma=1,
                    p0=p1),
                SolidWallPressureBCnoDensity(dest='wall',
                                             sources=['liquid', 'gas']),
            ]),
            Group(equations=[
                ColorGradientAdami(dest='liquid',
                                   sources=['liquid', 'wall', 'gas']),
                ColorGradientAdami(dest='gas',
                                   sources=['liquid', 'wall', 'gas']),
            ]),
            Group(equations=[
                ConstructStressMatrix(
                    dest='liquid', sources=None, sigma=sigma, d=2),
                ConstructStressMatrix(
                    dest='gas', sources=None, sigma=sigma, d=2)
            ]),
            Group(equations=[
                MomentumEquationPressureGradientAdami(
                    dest='liquid', sources=['liquid', 'wall', 'gas']),
                MomentumEquationPressureGradientAdami(
                    dest='gas', sources=['liquid', 'wall', 'gas']),
                MomentumEquationViscosityAdami(dest='liquid',
                                               sources=['liquid', 'gas']),
                MomentumEquationViscosityAdami(dest='gas',
                                               sources=['liquid', 'gas']),
                SurfaceForceAdami(dest='liquid',
                                  sources=['liquid', 'wall', 'gas']),
                SurfaceForceAdami(dest='gas',
                                  sources=['liquid', 'wall', 'gas']),
                SolidWallNoSlipBC(dest='liquid', sources=['wall'], nu=nu1),
                SolidWallNoSlipBC(dest='gas', sources=['wall'], nu=nu2),
            ]),
        ]

        return adami_equations
Example #2
0
    def create_equations(self):
        adami_equations = [
            Group(equations=[
                SummationDensity(dest='fluid', sources=['fluid', 'wall']),
                SummationDensity(dest='wall', sources=['fluid', 'wall']),
                # Density_correction(dest='wall', sources=['fluid', 'wall']),
            ]),
            Group(equations=[
                TaitEOS(dest='fluid',
                        sources=None,
                        rho0=rho1,
                        c0=c0,
                        gamma=7,
                        p0=p1),
                SolidWallPressureBCnoDensity(dest='wall', sources=['fluid']),
            ]),
            Group(equations=[
                ColorGradientAdami(dest='fluid', sources=['fluid', 'wall']),
            ]),
            Group(equations=[
                ConstructStressMatrix(
                    dest='fluid', sources=None, sigma=sigma, d=2)
            ]),
            Group(equations=[
                MomentumEquationPressureGradientAdami(
                    dest='fluid', sources=['fluid', 'wall']),
                # MomentumEquation(dest='fluid', sources=['fluid', 'wall'], c0=c0, alpha=0.0, beta=0.0, tensile_correction=True),
                MomentumEquationViscosityAdami(dest='fluid', sources=['fluid']
                                               ),
                SurfaceForceAdami(dest='fluid', sources=['fluid', 'wall']),
                SolidWallNoSlipBC(dest='fluid', sources=['wall'], nu=nu0)
            ]),
        ]

        return adami_equations
Example #3
0
    def create_equations(self):
        sy11_equations = [
            Group(
                equations=[SummationDensity(dest='fluid', sources=['fluid'])],
                real=False),
            Group(equations=[
                StateEquation(dest='fluid', sources=None, rho0=rho0, p0=p0),
                SY11ColorGradient(dest='fluid', sources=['fluid'])
            ],
                  real=False),
            Group(equations=[
                ScaleSmoothingLength(dest='fluid',
                                     sources=None,
                                     factor=factor1)
            ],
                  real=False,
                  update_nnps=True),
            Group(equations=[SY11DiracDelta(dest='fluid', sources=['fluid'])],
                  real=False),
            Group(equations=[
                InterfaceCurvatureFromNumberDensity(
                    dest='fluid',
                    sources=['fluid'],
                    with_morris_correction=True),
            ],
                  real=False),
            Group(
                equations=[
                    ScaleSmoothingLength(dest='fluid',
                                         sources=None,
                                         factor=factor2)
                ],
                real=False,
                update_nnps=True,
            ),
            Group(equations=[
                MomentumEquationPressureGradient(dest='fluid',
                                                 sources=['fluid'],
                                                 pb=0.0),
                MomentumEquationViscosity(dest='fluid',
                                          sources=['fluid'],
                                          nu=nu),
                ShadlooYildizSurfaceTensionForce(dest='fluid',
                                                 sources=None,
                                                 sigma=sigma),
            ], )
        ]

        adami_equations = [
            Group(
                equations=[SummationDensity(dest='fluid', sources=['fluid'])],
                real=False),
            Group(equations=[
                StateEquation(dest='fluid', sources=None, rho0=rho0, p0=p0),
            ],
                  real=False),
            Group(equations=[
                AdamiColorGradient(dest='fluid', sources=['fluid']),
            ],
                  real=False),
            Group(equations=[
                AdamiReproducingDivergence(dest='fluid',
                                           sources=['fluid'],
                                           dim=2),
            ],
                  real=False),
            Group(equations=[
                MomentumEquationPressureGradient(dest='fluid',
                                                 sources=['fluid'],
                                                 pb=p0),
                MomentumEquationViscosityAdami(dest='fluid',
                                               sources=['fluid']),
                CSFSurfaceTensionForceAdami(
                    dest='fluid',
                    sources=None,
                )
            ], )
        ]

        adami_stress_equations = [
            Group(equations=[
                SummationDensity(dest='fluid', sources=['fluid']),
            ],
                  real=False),
            Group(equations=[
                TaitEOS(dest='fluid',
                        sources=None,
                        rho0=rho0,
                        c0=c0,
                        gamma=7,
                        p0=p0),
            ],
                  real=False),
            Group(equations=[
                ColorGradientAdami(dest='fluid', sources=['fluid']),
            ],
                  real=False),
            Group(equations=[
                ConstructStressMatrix(dest='fluid',
                                      sources=None,
                                      sigma=sigma,
                                      d=2)
            ],
                  real=False),
            Group(equations=[
                MomentumEquationPressureGradientAdami(dest='fluid',
                                                      sources=['fluid']),
                MomentumEquationViscosityAdami(dest='fluid', sources=['fluid'
                                                                      ]),
                SurfaceForceAdami(dest='fluid', sources=['fluid']),
            ]),
        ]

        tvf_equations = [
            Group(
                equations=[SummationDensity(dest='fluid', sources=['fluid'])],
                real=False),
            Group(equations=[
                StateEquation(dest='fluid', sources=None, rho0=rho0, p0=p0),
                SmoothedColor(dest='fluid', sources=['fluid']),
            ],
                  real=False),
            Group(equations=[
                MorrisColorGradient(dest='fluid',
                                    sources=['fluid'],
                                    epsilon=epsilon),
            ],
                  real=False),
            Group(equations=[
                InterfaceCurvatureFromNumberDensity(
                    dest='fluid',
                    sources=['fluid'],
                    with_morris_correction=True),
            ],
                  real=False),
            Group(equations=[
                MomentumEquationPressureGradient(dest='fluid',
                                                 sources=['fluid'],
                                                 pb=p0),
                MomentumEquationViscosity(dest='fluid',
                                          sources=['fluid'],
                                          nu=nu),
                CSFSurfaceTensionForce(dest='fluid', sources=None,
                                       sigma=sigma),
                MomentumEquationArtificialStress(dest='fluid',
                                                 sources=['fluid']),
            ], )
        ]

        morris_equations = [
            Group(equations=[
                SummationDensitySourceMass(dest='fluid', sources=['fluid']),
            ],
                  real=False,
                  update_nnps=False),
            Group(equations=[
                TaitEOS(dest='fluid',
                        sources=None,
                        rho0=rho0,
                        c0=c0,
                        gamma=1.0),
                SmoothedColor(dest='fluid', sources=[
                    'fluid',
                ]),
                ScaleSmoothingLength(dest='fluid',
                                     sources=None,
                                     factor=2.0 / 3.0),
            ],
                  real=False,
                  update_nnps=False),
            Group(equations=[
                MorrisColorGradient(dest='fluid',
                                    sources=[
                                        'fluid',
                                    ],
                                    epsilon=epsilon),
            ],
                  real=False,
                  update_nnps=False),
            Group(equations=[
                InterfaceCurvatureFromDensity(dest='fluid',
                                              sources=['fluid'],
                                              with_morris_correction=True),
                ScaleSmoothingLength(dest='fluid', sources=None, factor=1.5),
            ],
                  real=False,
                  update_nnps=False),
            Group(equations=[
                MomentumEquationPressureGradientMorris(dest='fluid',
                                                       sources=['fluid']),
                MomentumEquationViscosityMorris(dest='fluid',
                                                sources=['fluid']),
                CSFSurfaceTensionForce(dest='fluid', sources=None,
                                       sigma=sigma),
            ],
                  update_nnps=False)
        ]

        if self.options.scheme == 'tvf':
            return tvf_equations
        elif self.options.scheme == 'adami_stress':
            return adami_stress_equations
        elif self.options.scheme == 'adami':
            return adami_equations
        elif self.options.scheme == 'shadloo':
            return sy11_equations
        else:
            return morris_equations