def T10(t, y): # Calculate species concentrations for Cell fc, fec, sc, sec = ct.calculate_partitioned_concentrations( y, MW, sol, Kf, Ks, Vf, Vs, fs) # Set solid (sand and clay) flow rates solid_rates = np.array([[0.01], [0.0]]) # kg/yr # Calculate rate of change of mass using species concentrations return -np.dot(sec.transpose(), solid_rates)
def T08(t, y): # Calculate species concentrations for Cell fc, fec, sc, sec = ct.calculate_partitioned_concentrations( y, MW, sol, Kf, Ks, Vf, Vs, fs) # Set fluid (water and oil) flow rates fluid_rates = np.array([[0.1], [0.0]]) # m3/yr # Calculate rate of change of mass using species concentrations return -np.dot(fec.transpose(), fluid_rates)
def T02(t, y): # Calculate species concentrations for Cell fc, fec, sc, sec = ct.calculate_partitioned_concentrations( y, MW, sol, Kf, Ks, Vf, Vs, fs) # Set fluid (water and oil) and solid (sand and clay) flow rates fluid_rates = np.array([[0.02], [0.3]]) # m3/yr solid_rates = np.array([[0.25], [0.0]]) # kg/yr # Calculate rate of change of mass using species concentrations in water return -np.dot(fec.transpose(), fluid_rates) - np.dot( sc.transpose(), solid_rates)
def T11(t, y): # Calculate species concentrations for Cell fc, fec, sc, sec = ct.calculate_partitioned_concentrations( y[:3], MW, sol, Kf, Ks, Vf, Vs, fs) # Set fluid (water and oil) and solid (sand and clay) flow rates fluid_rates = np.array([[0.1], [0.05]]) # m3/yr solid_rates = np.array([[0.05], [0.2]]) # kg/yr # Calculate rate of change of mass using species concentrations return np.dot(np.concatenate( [-fec.transpose(), fec.transpose()]), fluid_rates) + np.dot( np.concatenate([-sec.transpose(), sec.transpose()]), solid_rates)
# Simulation start and end times (in years) simulation_start_and_end = [0, 10000] # Times (in years) at which to get species concentrations times = [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000] # ================================================================ # Test 01 Concentrations (g/m3 for fluids, g/kg for solids) # ================================================================ # Set molar solubility to value different from the default sol = 1.0e38 # Get species masses, m, as column vector m = ct.np_vector(species_amounts, "column") # Get species molecular weights, MW, as column vector MW = ct.np_vector(molecular_weights, "column") # Get fluid and solid partition coefficients as column vectors Kf = ct.np_vector(K_fluids, "column") Ks = ct.np_vector(K_solids, "column") # Get fluid and solid amounts as column vectors Vf = ct.np_vector(fluid_amounts, "column") Vs = ct.np_vector(solid_amounts, "column") # Get suspended solid fractions, fs, as a matrix (solids correspond to rows and # the suspending fluids correspond to columns) fs = ct.np_matrix(fractions_suspended)
"Clay" : 20.0 } # Specify fractions of solids suspended in each fluid fractions_suspended = \ { "Sand" : { "Water" : 0.0, "Oil" : 0.0 }, "Clay" : { "Water" : 0.0, "Oil" : 0.0 } } # ================================================================ # Test 01 Concentrations (g/m3 for fluids, g/kg for solids) # ================================================================ # Set molar solubility to value different from the default sol = 1.0e38 # Get species masses, m, as column vector m = ct.np_vector(species_amounts, "column") # Get species molecular weights, MW, as column vector MW = ct.np_vector(molecular_weights, "column") # Get fluid and solid partition coefficients as column vectors Kf = ct.np_vector(K_fluids, "column") Ks = ct.np_vector(K_solids, "column") # Get fluid and solid amounts as column vectors Vf = ct.np_vector(fluid_amounts, "column") Vs = ct.np_vector(solid_amounts, "column") # Get suspended solid fractions, fs, as a matrix (solids correspond to rows and # the suspending fluids correspond to columns) fs = ct.np_matrix(fractions_suspended)