示例#1
0
 def noslip_state(self, state):
     from grudge.symbolic import make_normal
     state0 = join_fields(make_sym_vector("bc_q_noslip", 2),
                          [0] * self.dimensions)
     normal = make_normal(self.noslip_tag, self.dimensions)
     bc = self.make_bc_info("bc_q_noslip", self.noslip_tag, state, state0)
     return self.inflow_state_inner(normal, bc, "noslip")
示例#2
0
    def wall_state(self, state):
        from grudge.symbolic import RestrictToBoundary
        bc = RestrictToBoundary(self.wall_tag)(state)
        wall_rho = self.rho(bc)
        wall_e = self.e(bc)  # <3 eve
        wall_rho_u = self.rho_u(bc)

        from grudge.symbolic import make_normal
        normal = make_normal(self.wall_tag, self.dimensions)

        return join_fields(
            wall_rho, wall_e,
            wall_rho_u - 2 * numpy.dot(wall_rho_u, normal) * normal)
示例#3
0
    def outflow_state(self, state):
        from grudge.symbolic import make_normal
        normal = make_normal(self.outflow_tag, self.dimensions)
        bc = self.make_bc_info("bc_q_out", self.outflow_tag, state)

        # see grudge/doc/maxima/euler.mac
        return join_fields(
            # bc rho
            cse(bc.rho0
            + bc.drhom + numpy.dot(normal, bc.dumvec)*bc.rho0/(2*bc.c0)
            - bc.dpm/(2*bc.c0*bc.c0), "bc_rho_outflow"),

            # bc p
            cse(bc.p0
            + bc.c0*bc.rho0*numpy.dot(normal, bc.dumvec)/2 + bc.dpm/2, "bc_p_outflow"),

            # bc u
            cse(bc.u0
            + bc.dumvec - normal*numpy.dot(normal, bc.dumvec)/2
            + bc.dpm*normal/(2*bc.c0*bc.rho0), "bc_u_outflow"))
示例#4
0
 def inflow_state(self, state):
     from grudge.symbolic import make_normal
     normal = make_normal(self.inflow_tag, self.dimensions)
     bc = self.make_bc_info("bc_q_in", self.inflow_tag, state)
     return self.inflow_state_inner(normal, bc, "inflow")