Average Flux Across Edge

2 visualizaciones (últimos 30 días)
Paul Safier
Paul Safier el 1 de Mayo de 2025
Comentada: Ansel el 14 de Mayo de 2025
Hi. I need to compute the average flux across the edge in the diagram that is of length xa. Shouldn't the results from the function evaluateHeatFlux be weighted by the mesh segment lengths on that edge? For non-uniform meshes, as this is, the segment lengths are not all equal and thus the result given by evaluateHeatFlux should have less weight in a small segment versus a large segment (when averaging). Does Matlab have a built-in way of doing this?
results = solve(model);
[qx,qy] = evaluateHeatFlux(results);
Nodes_Xa = findNodes(model.Mesh,"region","Edge",Edge_Xa);
flux_Xa = qy(Nodes_Xa);
averageFlux = mean(flux_Xa); % SHOULDN'T THIS BE WEIGHTED BY THE ELEMENT EDGE LENGTH?
Thanks for any input.

Respuesta aceptada

Torsten
Torsten el 1 de Mayo de 2025
Movida: Torsten el 1 de Mayo de 2025
Should be
averageFlux = 1/(Nodes_Xa(end)-Nodes_Xa(1))*trapz(Nodes_Xa,flux_Xa)
  7 comentarios
Paul Safier
Paul Safier el 2 de Mayo de 2025
OK, I just tested that and it comes up as the exact same answer as the integral with trapz. Thanks!
Ansel
Ansel el 14 de Mayo de 2025
Thanks for the link, you saved my day.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by