Example #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, []
Example #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, []
Example #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, []
Example #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, []
Example #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]
Example #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]