コード例 #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]