예제 #1
0
def advection_eqns ():
    """Returns flux, conserved, constant_fields"""
    q = Conserved('q')
    (w,) = q.fields(['w'])
    u = Constant('u')
    f = [u * w]
    return f, q, []
예제 #2
0
def advection_eqns():
    """Returns flux, conserved, constant_fields"""
    q = Conserved('q')
    (w, ) = q.fields(['w'])
    u = Constant('u')
    f = [u * w]
    return f, q, []
예제 #3
0
def shallow_water_eqns():
    q = Conserved('q')
    h, uh = q.fields(['h', 'uh'])
    u = uh / h
    g = Constant('g')

    f = [uh, u * uh + .5 * g * h**2]
    return f, q, []
예제 #4
0
def shallow_water_eqns():
    q = Conserved('q')
    h, uh = q.fields(['h', 'uh'])
    u = uh / h
    g = Constant('g')

    f = [ uh ,
          u * uh + .5 * g * h ** 2]
    return f, q, []
예제 #5
0
def acoustic_eqns():
    """Returns flux, conserved, constant_fields"""
    q = Conserved('q')
    p, u = q.fields(['p', 'u'])
    rho = Constant('rho')
    K = Constant('bulk')
    a = ConstantField('a')
    b = ConstantField('b')

    f = [a * K * u, b * p / rho]
    return f, q, [a, b]
예제 #6
0
def acoustic_eqns ():
    """Returns flux, conserved, constant_fields"""
    q = Conserved('q')
    p, u = q.fields(['p','u'])
    rho = Constant('rho')
    K = Constant('bulk')
    a = ConstantField('a')
    b = ConstantField('b')

    f = [ a*K*u ,
          b*p/rho]
    return f, q, [a,b]