How to compute the integral about the nonlinear term in the Navier-Stokes equation?
liqihao2000 opened this issue · comments
Dear Mikael,
How to compute the following integral
where the u_hat
with following code in demo/NavierStokesPC.py
:
# Update (9.107)
rhsU.fill(0)
rhsU += inner(v, ut_hat) - inner(v, dt*grad(phi_hat))
u_hat = Lu1.solve(rhsU, u=u_hat)
# Update (9.105)
rhsP.fill(0)
rhsP += inner(q, phi_hat) + inner(q, p_hat) - inner(q, div(ut_hat))
p_hat = Lu2.solve(rhsP, u=p_hat, constraints=((0, 0, 0),))
Hi
Sorry about the late reply. The integral you refer to is just a number since there are no test or trial functions. Is this what you want? You can compute the integral in physical space. If this is what you want, then compute the convection vector inner(1, dot(N, u0))
. The inner with test function 1 is a non-weighted integral over the domain that returns a number.
Great, it works for me. Thanks very much.