After applying the energy equation for a hydraulic system composed of two tanks connected to a pipe of constant diameter and accepting the Colebrook-White and the Darcy-Weisbach equations, an undetermined expression is obtained since more unknowns than equations are established. The input variables are Q: flow (m 3/s), H: pressure drop (m) L: pipe length (m) ε: roughness (m), ϑ: kinematic viscosity (m 2/s), and Ʃk: sum of minor loss coefficients (dimensionless). Results: in the left window is the solution obtained with direct numerical simulation (aka Dokken’s wonderful tutorial) and in the right one is the output of my slow ass simulation.The fifth-degree polynomial equation determines the diameter in pressurized drinking water systems.Progress = tqdm.tqdm(desc="Solving PDE", total=num_steps)ī1.ghostUpdate(addv=_VALUES, mode=)ī2.ghostUpdate(addv=_VALUES, mode=)ī3.ghostUpdate(addv=_VALUES, mode=) Vtx_p = VTXWriter(m, "./outputs/p-lens.bp", ) Vtx_u = VTXWriter(m, "./outputs/u-les.bp", ) # PASO 3: INCOMPRESIBILIDAD DE LA VELOCIDAD # dt * inner(Sij(u_tent), Sij(u_tent)) * inner(grad(u_tent), grad(v)) # PASO 1: VELOCIDAD APROXIMADA (NO INCOMPRESIBLE)ĭt * inner(dot(u_n, nabla_grad(u_n)), v) * dx + \ĭt * (nu + nu_T(u_n)) * inner(grad(u_tent), grad(v)) * dx #+ \ P_ = Function(Q) # p disponible como función U_n = Function(V) # Función para almacenar el timestep anterior U_ = Function(V) # u_tent disponible como función # Condiciones de contorno de la presiónīcp_outlet = dirichletbc(PETSc.ScalarType(0.0), locate_dofs_topological(Q, fdim, ft.find(outlet_marker)), Q) U_nonslip = np.array((0,) *, dtype=PETSc.ScalarType)īcu_walls = dirichletbc(u_nonslip, locate_dofs_topological(V, fdim, ft.find(wall_marker)), V)īcu_obstacle = dirichletbc(u_nonslip, locate_dofs_topological(V, fdim, ft.find(obstacle_marker)), V)īcu = # Condiciones de contorno de la velocidadīcu_inflow = dirichletbc(u_inlet, locate_dofs_topological(V, fdim, ft.find(inlet_marker))) Values = np.zeros((gdim, x.shape),dtype=PETSc.ScalarType) Scalar_element = FiniteElement("CG", mesh.ufl_cell(), 1) Vector_element = VectorElement("CG", mesh.ufl_cell(), 2) # ESPACIOS DE FUNCIONES Y FUNCIONES: ELEMENTOS TAYLOR-HOOD Nu = Constant(mesh, PETSc.ScalarType(mu/rho)) # Viscosidad cinemáticaį = Constant(mesh, PETSc.ScalarType((0, 0))) # Body forcesĬs = PETSc.ScalarType(0.035) # Constante de Smagorinsky Rho = Constant(mesh, PETSc.ScalarType(1.0)) # Densidad (cambiar) Mu = Constant(mesh, PETSc.ScalarType(1.0e-4)) # Viscosidad dinámica (cambiar) Inlet_marker, outlet_marker, wall_marker, obstacle_marker = 2, 3, 4, 5ĭt = Constant(mesh, PETSc.ScalarType(dt)) Mesh, _, ft = gmshio.read_from_msh("cyllinder.msh", MPI.COMM_WORLD, rank=0, gdim=gdim) Sorry for the comments in Spanish, they are not too meaningfullįrom dolfinx.fem import (Constant, Function, FunctionSpace,Īssemble_scalar, dirichletbc, form, locate_dofs_topological, set_bc)įrom import (apply_lifting, assemble_matrix, assemble_vector,įrom dolfinx.io import (VTXWriter, distribute_entity_data, gmshio)įrom ufl import (FacetNormal, FiniteElement, Identity, Measure, TestFunction, TrialFunction, VectorElement,Īs_vector, div, dot, ds, dx, inner, lhs, grad, nabla_grad, rhs, sym)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |