Compute average and maximum value of a field over a streamline

93 Views Asked by At

I'm working on a code solving a set of PDEs. I have a vector field, $\vec{v}(x,\theta,z,t)$ (it's a velocity) and a scalar field, $c(x,\theta,z,t)$. I have a $2\pi$-periodicity in $\theta$.

The field $\vec{v}$ defines streamlines, and I'm trying to compute the average value of the field $c$, as well as its maximum value, on each streamline.

(I omit the temporal dimension in the following)

  1. Average

    I try to find a function $\bar{c}(x,\theta,z)$ such that the value of $\bar{c}$ at a point $(x,\theta,z)$ is the average value of $c$ on the streamline passing by $(x,\theta,z)$. $\bar{c}$ satisfies $\vec{v}\cdot\nabla\bar{c} = 0$. I think I found a way to solve this by solving $$(c-\bar{c})+D\vec{v}\cdot\nabla\bar{c}=0$$ where D is a coefficient that I choose to be very high. I use a non-linear solver (Newton-Krylov method) to solve this $F(x)=0$-like system. It is working :)

  2. Max value

    What I actually want to do is to solve the same problem, but instead of looking for the average value of $c$ over a streamline, I want to have a field $\bar{\bar{c}}$ such that the value of $\bar{\bar{c}}$ at a point $(x,\theta,z)$ is the maximum value of the $c$ on the streamline passing by $(x,\theta,z)$. I don't really have any idea how to do that. I don't even know if it is possible.

An idea I had was just to follow the streamline with a Runge-Kutta method, but the twist is, I need to compute these quantities very often. The average computation solving $F(x)=0$ is efficient since I can use the solution at the previous step as a first guess (fields don't evolve much) for the Newton-Krylov, hence a fast convergence. Do you have any idea if it's possible to reformulate the problem 2) in an equivalent way ?