# Substitution employing double overline accent?

+1 vote

Hi all, So what I would like to do is to derive the Reynolds Averaged Navier Stokes equations, here i want the \overline operator to mean time average. I started with the convection term:

\partial{#}::PartialDerivative;
{u_{#}}::Depends(\partial{#});
\overline{#}::Accent;
\overline{#}::Distributable;
\overline{#}::Depends(\partial{#});
u_{#}}::Depends(\overline{#});
\prime::Symbol;
conv := c_i = \partial_{j}{ \overline{ u_i u_j} };
rl1 := u_{a?} = \overline{u_{a?}} + {u_{a?}}^\prime;
rl2 := \overline{\overline{u_{a?}u_{b?}}} = \overline{u_{a?} u_{b?}}};
substitute(conv, rl1);
distribute(conv);

Up to this point, the syntax generates what I want ()although the way it works seems a little inconvenient, as if I was using something wrong, so any tips appreciated!). The problems starts when I want to substitute rl2 into conv:

substitute(conv, rl2);

which does nothing (it should just erase one overline from the first term). Am I doing something wrong or is such thing not supported?

Thanks! S

+1 vote

That's because your first term contains

\overline{ \overline{u_{i}} \overline{u_{j}} }

not

\overline{ \overline{ u_{i} u_{j} } }

So your pattern in rl2 does not match.

It's difficult to see in the LaTeX output as the two overlines merge, but if you print the tree-form with print(tree(conv)) you can see it.

by (70.9k points)

Excellent trick the print(tree(conv)), but it might be difficult to read.