vmax = 22 * v_s hv = 2. * vmax / nv vx_ = np.linspace(-vmax+hv/2, vmax-hv/2, nv) # coordinates of velocity nodes vx, vy, vz = np.meshgrid(vx_, vx_, vx_, indexing='ij') def f_init(x, y, z, vx, vy, vz): if (x <= 0.): return tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_l, n_l, u_l, 0., 0., gas_params.Rg)) else: return tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_r, n_r, u_r, 0., 0., gas_params.Rg)) f_in = tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_l, n_l, u_l, 0., 0., gas_params.Rg)) f_out = tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_r, n_r, u_r, 0., 0., gas_params.Rg)) #print(f_bound) fmax = tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_w, 1., 0., 0., 0., gas_params.Rg)) #print(fmax) problem = Boltzmann_cyl.Problem(bc_type_list = ['sym-z', 'in', 'out', 'wall', 'sym-y'], bc_data = [[], [f_in], [f_out], [fmax], []], f_init = f_init) CFL = 50.
def f_init(x, y, z, vx, vy, vz): if (x <= 0.): return tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_l, n_l, u_l, 0., 0., gas_params.Rg)) else: return tt.tensor(Boltzmann_cyl.f_maxwell(vx, vy, vz, T_r, n_r, u_r, 0., 0., gas_params.Rg))
#print 'l_s = ', l_s #print 'v_s = ', v_s nv = 44 vmax = 22 * v_s hv = 2. * vmax / nv vx_ = np.linspace(-vmax + hv / 2, vmax - hv / 2, nv) # coordinates of velocity nodes vx, vy, vz = np.meshgrid(vx_, vx_, vx_, indexing='ij') f_init = lambda x, y, z, vx, vy, vz: tt.tensor( Boltzmann_cyl.f_maxwell(vx, vy, vz, T_l, n_l, u_l, 0., 0., gas_params.Rg)) f_bound = tt.tensor( Boltzmann_cyl.f_maxwell(vx, vy, vz, T_l, n_l, u_l, 0., 0., gas_params.Rg)) #print(f_bound) fmax = tt.tensor( Boltzmann_cyl.f_maxwell(vx, vy, vz, T_w, 1., 0., 0., 0., gas_params.Rg)) #print(fmax) problem = Boltzmann_cyl.Problem( bc_type_list=['sym-z', 'in', 'out', 'wall', 'sym-y'], bc_data=[[], [f_bound], [f_bound], [fmax], []], f_init=f_init) #print 'vmax =', vmax CFL = 5e+1