How to integrate over the entire bounds of a solution to a PDE at a given time step using PDEPE

4 visualizaciones (últimos 30 días)
I have a diffusion problem, solving for concentration over a spherical volume given diffusion and source terms. I'm interested in calculating the total concentraion over the entire geometry at each time step, which will then be fed into the diffusion parameter, which will then influence the next iteration.
How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small steps, output the solution, integrate, and restart PDEPE (similar to ODE event functions).

Respuesta aceptada

Torsten
Torsten el 14 de Feb. de 2023
Editada: Torsten el 14 de Feb. de 2023
How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small steps, output the solution, integrate, and restart PDEPE (similar to ODE event functions).
Yes.
Or use
As far as I remember, if you define a coupling between the PDE and an artificial ODE in this code for all grid points, you get the values of the PDE in all grid points for each time step. This offers the possibility to get the total concentration.
Or assume total concentration over time, integrate, evaluate results, integrate again with the results for total concentration from the first integration, evaluate results,... and so on until convergence.
But if you have a simple 1d pde, why not discretizing in space and use ode15s to solve the resulting system of ODEs in the grid points (method-of-lines) ? Here, you have maximum flexibility.
  3 comentarios
Torsten
Torsten el 15 de Feb. de 2023
Editada: Torsten el 15 de Feb. de 2023
If the diffusion parameter was a function of differential of the concentration at the right boundary condition, this cannot be solved alone with pdepe correct?
Correct, this information is not available inside the PDE function of "pdepe". But how can the diffusion coefficient depend on the concentration gradient at another position in space ? Or do you want to deduce the total concentration by the fluxes over the boundaries ?
Joshua Ferrigno
Joshua Ferrigno el 15 de Feb. de 2023
I mispoke, another PDE I am solving simultanouesly is dependent on the concentration gradient at the boundary of the diffusion PDE, not the diffusion PDE itself.
Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by