def advection_eqns(): """Returns flux, conserved, constant_fields""" q = Conserved('q') (w, ) = q.fields(['w']) u = Constant('u') f = [u * w] return f, q, []
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, []
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]