Replies: 5 comments 3 replies
-
Sorry, I just realized I should have asked this as a discussion. |
Beta Was this translation helpful? Give feedback.
-
Before looking into the question, I made a sanity check and read the code. It seems that your bilinear form is actually not bilinear, it is nonlinear in Probably that is intended since you are studying high Re case, I did not look into the formulation in detail. However, BilinearForm does only support bilinear forms. To solve nonlinear problems you usually implement Newton’s method in a for loop and, with the help of the derivative of the nonlinear weak form, you write a bilinear form (so-called Jacobian) which describes a single Newton iteration. |
Beta Was this translation helpful? Give feedback.
-
Thank you. This makes sense and I see that now. The bilinear form is actually not linear. I will try to adapt ex10 to my problem. |
Beta Was this translation helpful? Give feedback.
-
As the solution of the of the nonlinear streamfunction requires a iterative approach anyway , I was looking into the following pure streamfunction "one-level time-stepping schemes of IMplicit-EXplicit (IMEX) type. For IMEX schemes the convective term is treated explicitly, while the diffusive term is diagonally implicit". [A High Order Compact Scheme for the Pure-Streamfunction Formulation Step 1: Computation of
|
Beta Was this translation helpful? Give feedback.
-
I was able to solve the Navier-Stokes equations in pure streamfunction formulation using the following scheme to time step: with To linearize the convective term I ended up with the following weak formulation: The essential parts of the implementation are:
@kinnala Do you see a way how this computation can be speed up? Maybe the convective term can be split into two bilinear forms and the matrix prefactorized similar as in example 19? Would this be a nice example to add to the repository? The simulation runs fine an yiels the solutions I would expect for the lid driven cavity problem and also for a turbulent flow forming a Kármán vortex street: Below is again a small example code for the lid driven cavity:
|
Beta Was this translation helpful? Give feedback.
-
I am attempting to solve the problem of the lid-driven cavity in fluid mechanics using the streamfunction formulation:
Given the boundary conditions:
The weak formulation I used for the steady-state solution is based on a Fenics implementation:
where$\nu$ where is the kinematic viscosity, $\psi$ the stream function and $\phi$ the test function.
For the first part, I used the biharmonic implementation from example 20:
u*ddot(dd(u),dd(v))
, which provides the solution for the Stokes flow for low Reynold numbers and matches my expectations.My problem lies in implementing the second part of the BilinearForm, which should be
div(grad(psi))*(grad(psi)[1]*grad(phi)[0]-grad(psi)[0]*grad(phi)[1])
according to the Fenics implementation. My approach was:However,
grad(u)[1]*grad(v)[0] - grad(u)[0]*grad(v)[1]
returns a zero matrix, rendering the second part ineffective.What is the correct implementation of the second part of the BilinearForm?
Reference solutions for Re=10 and Re=800 can be found here for an implementation using finite differences and OpenFoam. For Re=800 I expect:
Below is a small test implementation:
Beta Was this translation helpful? Give feedback.
All reactions