Now it remains to implement a robust flow solver. Even this small example
shows, that the solution is not obtained easily - try decreasing the viscosity,
and/or increase the Dirichlet velocity - the solver would not converge.
On Tuesday, 2 July 2013 13:58:20 UTC+5:30, Robert Cimrman wrote:Now it remains to implement a robust flow solver. Even this small example
shows, that the solution is not obtained easily - try decreasing the viscosity,
and/or increase the Dirichlet velocity - the solver would not converge.
Yes R,
The solution is not obtained easily.
I am looking into it.
PS: Here are blog posts for week 1 & 2
Kindly tell me if this will do before I send it to terri oda:
http://ankitmahato.blogspot.in/2013/07/python-software-foundation-sfepy-gsoc.html
http://ankitmahato.blogspot.in/2013/07/python-software-foundation-sfepy-gsoc_2.html
On 07/02/2013 03:36 PM, Ankit Mahato wrote:
>
>
> On Tuesday, 2 July 2013 13:58:20 UTC+5:30, Robert Cimrman wrote:
>>
>> Now it remains to implement a robust flow solver. Even this small example
>> shows, that the solution is not obtained easily - try decreasing the
>> viscosity,
>> and/or increase the Dirichlet velocity - the solver would not converge.
>>
>>
> Yes R,
>
> The solution is not obtained easily.
> I am looking into it.
>
> PS: Here are blog posts for week 1 & 2
> Kindly tell me if this will do before I send it to terri oda:
>
> http://ankitmahato.blogspot.in/2013/07/python-software-foundation-sfepy-gsoc.html
> http://ankitmahato.blogspot.in/2013/07/python-software-foundation-sfepy-gsoc_2.html
It seems ok, just correct the following typo: Navier-Strokes -> Navier-Stokes :)
It would be interesting to see the Peclet number graphs. Also, did you try some
other, more interesting, geometries?
On 07/04/2013 03:02 PM, Ankit Mahato wrote:
> Hi R,
>
> For our Navier-Stokes currently we use the Newton method with backtracking
> line-search.
Yes, in sfepy we use that.
> in OpenFoam and most of the CFD code the linearization
> approach is based on Patankar's SIMPLE algorithm.[1][2]
> I talked to my professor who told me that SIMPLE is used in commercial
> softwares like FLUENT too.
Do you think you could then try implementing SIMPLE in the FE context?
> I found few papers which tells us some other approaches. Do have a look at
> them and lend your views:
>
> -
> http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fwww.wias-berlin.de%2Fpeople%2Fjohn%2FPP99_13.ps&ei=mW3VUZqzOMmzrgeKuYD4DA&usg=AFQjCNEp9_rShrLSjkYdax6bOimSrkD-KQ&sig2=8S654V-zz2vd4mFZOilZCw&bvm=bv.48705608,d.bmk
> - http://numerik.iwr.uni-heidelberg.de/Oberwolfach-Seminar/CFD-Course.pdf
> -
> http://dspace.uta.edu/bitstream/handle/10106/5144/JIAJAN_uta_2502M_10764.pdf
> - http://www.reaction-eng.com/downloads/nksolver_pernice.pdf
> - http://aero-comlab.stanford.edu/Papers/birkenjamesonproceedings09.pdf
> - https://cs.uwaterloo.ca/research/tr/1993/02/CS-93-02.pdf
> - http://www.cs.sandia.gov/~rstumin/backtrack.pdf
> - http://repository.cmu.edu/cgi/viewcontent.cgi?article=1032&context=math
> - http://www8.cs.umu.se/kurser/5DA001/HT07/lectures/newton-handouts.pdf
>
>
> [1]:
> http://www.cfd-online.com/Forums/openfoam-solving/60167-how-nonlinear-discretised-equations-linearised-openfoam.html
> [2]: http://web.cecs.pdx.edu/~gerry/class/ME448/notes/pdf/SIMPLEslides.pdf
Nice list. I will try to look at it, but doubt that I will be of much help
in deciding what path to pursue. We need something that could be
implemented in a reasonable time. IMHO that rules out the multigrid-based
solvers, unless a prepared solution like pyamg could be used directly.
> PS: For the python 3 fix which I had forgotten earlier :( . While going
> through the codes I came across that we use output() in base.py to print.
> You have already called
> if sys.version[0] < '3':
> basestr = basestring
> else:
> basestr = str
> So basically we know the python version and call the print function
> according to the python version. If I am correct it is quite easy to fix
> then, am I?
In the sfepy codebase, there should be no print statements - output()
should be used everywhere (if it is not, it's a bug), so yes, updating
that for python 3 should be pretty easy.
r.
On Thu, 4 Jul 2013, Ankit Mahato wrote:
> Hi R,
>
> I did some more digging from the implementation point of view and came
> across some interesting things:
>
> This tutorial demonstrates the solution of Incompressible Navier-Stokes
> Equations using Fenics. it uses Chlorin's method[1] to solve the problem.
> This project was very awesome.�
> http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/navier-stoke
> s/python/documentation.html
That looks feasible as well, although it is for time-dependent problems. A
stationary solution (if existing) could be obtained by stepping in time
til nothing changes.
(Sidenote: fenics is a cool project with many interesting ideas - good
place for insiration.)
> Then a stackoverflow question where someone says that fenics wasn't fast.
> http://stackoverflow.com/questions/4768045/fluid-flow-heat-transfer-and-python
As fenics is C++, I would say that it will always be faster than sfepy :)
I think that the "slow" in that context meant that the
nonlinearity solution converges slowly.
> Other Implementations:
> * Parallel Spectral Numerical Methods/The Two- and Three-Dimensional
> Navier-Stokes Equations -http://en.wikibooks.org/wiki/Parallel_Spectral_Numerical_Methods/The_Two-_and_Th
> ree-Dimensional_Navier-Stokes_Equations
> * 2D Navier-Stokes solver implemented as a Python package with Python
> modules and C++ extension modules. It uses the finite difference
> method on a uniform, rectangular grid. It handles single- and
> two-phase incompressible, Newtonian, laminar flow with obstacles.
> -https://code.google.com/p/kmkns/
There is a thesis to download - might be interesting.
> * Finite Volume Based - http://www.ctcms.nist.gov/fipy/
> Here is a list of Open Source CFD codes. Maybe we can fork a repo and use
> it or learn from it:
> http://www.cfd-online.com/Wiki/Codes
I think it would be easier to follow a paper/thesis, as details in code
often differ. But you can try, yes. Note that sfepy is BSD-licensed, so we
cannot use snippets/functions from GPL-licensed codes.
> According to people iNavier and dolphyn are promising:
> http://www.cfd-online.com/Forums/main/13529-colver-code-c-c.html
>
> Someone was using PyAMG to develop Jacobian-Free Newton-Krylov code to
> solve the Navier Stokes equations :
> https://groups.google.com/forum/#!topic/pyamg-user/HXrXTyvXPpw
This could be really interesting - maybe you could ask the person on how
far that project got?
> This is everything I could harness till now. I hope something useful
> comes out of these. Also I am currently narrowing down and rigorously
> searching a way to implementing SIMPLE in the FE context.
Ok, thanks!
r.
On Fri, 5 Jul 2013, Ankit Mahato wrote:
>
>
> On Friday, 5 July 2013 15:39:07 UTC+5:30, Robert Cimrman wrote:
> On Thu, 4 Jul 2013, Ankit Mahato wrote:
>
> > Hi R,
> >
> > I did some more digging from the implementation point of
> view and came
> > across some interesting things:
> >
> > This tutorial demonstrates the solution of Incompressible
> Navier-Stokes
> > Equations using Fenics. it uses Chlorin's method[1] to
> solve the problem.
> > This project was very awesome.�
> >http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/navier-stoke
>
> > s/python/documentation.html
>
> That looks feasible as well, although it is for
> time-dependent problems. A
> stationary solution (if existing) could be obtained by
> stepping in time
> til nothing changes.
>
> (Sidenote: fenics is a cool project with many interesting
> ideas - good
> place for insiration.)
>
>
> Are you suggesting to use the dolfin module or to use Chlorin's method?�
The method. Dolfin itself is bigger than sfepy :)
�
> > Other Implementations:
> > �* �Parallel Spectral Numerical Methods/The Two- and
> Three-Dimensional
> > � � Navier-Stokes Equations-http://en.wikibooks.org/wiki/Parallel_Spectral_Numerical_Methods/The_Two-_and_T
> h
> > � � ree-Dimensional_Navier-Stokes_Equations
> > �* �2D Navier-Stokes solver implemented as a Python package
> with Python
> > � � modules and C++ extension modules. It uses the finite
> difference
> > � � method on a uniform, rectangular grid. It handles
> single- and
> > � � two-phase incompressible, Newtonian, laminar flow with
> obstacles.
> > � � -https://code.google.com/p/kmkns/
>
> There is a thesis to download - might be interesting.
>
>
> Yes, but it is using Difference method.
Ok, then it is not directly applicable.
In general, SfePy can assemble the matrices A,
B forming a saddle point system with block structure [[A, B], [B^T, 0]] -
methods for solving that, making use of A, B, might be usable no matter
the method A, B were created (FEM, FVM, FDM).
>
> I think it would be easier to follow a paper/thesis, as
> details in code
> often differ. But you can try, yes. Note that sfepy is
> BSD-licensed, so we
> cannot use snippets/functions from GPL-licensed codes.
>
>
> So we can use any code with BSD license. right?
Yes.
�
> > Someone was using PyAMG to develop Jacobian-Free
> Newton-Krylov code to
> > solve the Navier Stokes equations :
> >
> https://groups.google.com/forum/#!topic/pyamg-user/HXrXTyvXPpw
>
> This could be really interesting - maybe you could ask the
> person on how
> far that project got?
>
>
> i had already dropped a mail on her email-id. Waiting for her reply.
Good!
�
On 07/09/2013 06:29 PM, Ankit Mahato wrote:
> I went through the codes I mentioned above:
> The following solvers were good but were licensed under GPL
> DUNS 2d/3d navier Stokes - GNU GPL license 2.0
> Channelflow - GNU GPL2
> OpenFlower - GPLv2
> PETSc-FEM - GPLv2
> Tochnog - GPL
>
> One under BSD but it asn't that good - Clawpack
> dolfyn - Apache
> Featflow2 - Not listed
>
> These had NS tuorials:
> HiFlow - LGPL v3
> http://www.numhpc.org/HiFlow3_Typo/fileadmin/tutorials/tut_Navier_Stokes_2012_03.pdf
> Nectar++ - Spectral/HP Emement method - http://www.nektar.info - MIT License
> http://www.nektar.info/wiki/3.3/UserGuide/Tutorial/IncNavierStokesSolver
> CFD2D - MIT
>
> The ones with MIT license are really good. Especially Nector++ which uses
> Spectral/HP method.
Wow, thanks for digging into it! I do not think even the license-friendly ones
could be used with sfepy easily (everybody has different data structures etc.),
but we could try to implement some of their FE-specific algorithms, if those
are documented.
> News pertaining to algorithms:
> - SIMPLE cannot be used under FE context.
Ok. Is it due to the fact that face fluxes need to be computed?
> - I went through GEORGE EM KARNIADAKIS & SPENCER J. SHERWIN Spectral/hp
> Element Methods for CFD.
> It required strong mathematical background to understand which I do not
> possess.
> - Chorin-Temam projection method- Currently going through it.
Ok.
> - PyAMG - Jacobian-Free Newton-Krylov code to solve the Navier Stokes
> equations : Christine sent me no response in spite of a reminder.
> - Matrix preconditioning techniques for GMRES - I do not know about matrix
> preconditioning. I downloaded some papers in order to understand it.
> If you know about any good resource on preconditioning then kindly give me
> the link.
Very basic intro:
https://en.wikipedia.org/wiki/Preconditioner#Preconditioning_for_linear_systems
The idea of preconditioning is simple, but it is often hard to find a good
preconditioner for a specific problem (class). I know what works for Laplacian
(e.g. algebraic multigrid), but I have not much knowledge about Navier-Stokes.
> There are two potential sources of numerical instability in the Galerkin
> finite element solution of steady Navier-Stokes problems. The first is due
> to the treatment of the convective term and manifests itself in high
> Reynolds number flows when unresolved internal or boundary layers are
> present in the solution. The second source of potential instability, is an
> inappropriate combination of interpolation functions for velocity and
> pressure.
> Stabilized finite element formulation is used. We have an example of it. Is
> it not robust R.?
The second issue is solved by proper polynomial approximation orders of fields,
this is ok. The first one is the main PITA.
> PS. Professors in my department do not use FEM for fluid, but today I came
> to know about a professor of Aerospace who uses FEM for CFD. I have mailed
> him for an appointment.
Ok, let me know how it went!
r.
On 07/04/2013 03:02 PM, Ankit Mahato wrote:
> I found few papers which tells us some other approaches. Do have a look at
> them and lend your views:
>
> -
> http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fwww.wias-berlin.de%2Fpeople%2Fjohn%2FPP99_13.ps&ei=mW3VUZqzOMmzrgeKuYD4DA&usg=AFQjCNEp9_rShrLSjkYdax6bOimSrkD-KQ&sig2=8S654V-zz2vd4mFZOilZCw&bvm=bv.48705608,d.bmk
> - http://numerik.iwr.uni-heidelberg.de/Oberwolfach-Seminar/CFD-Course.pdf
> -
> http://dspace.uta.edu/bitstream/handle/10106/5144/JIAJAN_uta_2502M_10764.pdf
> - http://www.reaction-eng.com/downloads/nksolver_pernice.pdf
> - http://aero-comlab.stanford.edu/Papers/birkenjamesonproceedings09.pdf
> - https://cs.uwaterloo.ca/research/tr/1993/02/CS-93-02.pdf
> - http://www.cs.sandia.gov/~rstumin/backtrack.pdf
> - http://repository.cmu.edu/cgi/viewcontent.cgi?article=1032&context=math
> - http://www8.cs.umu.se/kurser/5DA001/HT07/lectures/newton-handouts.pdf
From those links, I think only the first two links are interesting for us
(other texts describe FV, or are 2D only etc.). In CFD-Course.pdf, check
especially section 5, where some approaches to solving the (non)linear system
are given (e.g. a Schur complement approach). Unfortunately (from the
complexity/time constraint point of view), most people seem to agree that
multigrid is the way to go.
To proceed with the gsoc, maybe it would be good if you, in parallel to this,
tried to create an example with all the equations coupled, to have something to
play with. It could be small and use non-realistic viscosity to make the
solution easier. Use a 2D mesh, as that could be made reasonably fine.
Then you could develop/try some iterative schemes to solve the system. (e.g.
solve flow i -> solve energy i -> solve flow i+1 ...).
What do you think?
r.
On 07/26/2013 01:08 PM, Ankit Mahato wrote:
> Hi R,
>
> I had a talk with a professor who suggested me the following:
>> Spectral/hp element method will require a strong mathematical knowledge
> to proceed.
>> Chlorin Projection method is widely prevalent but it requires a separate
> formulation of matrices and not our current formulation.
What do you mean by separate formulation of matrices? Having the individual
matrix blocks? That is certainly possible. You would have to write a special
solver making use of that, yes.
>> GMRES with ILU(0) preconditioning may still not work for convection
> dominated problem(our main PITA) and he told me that there are schemes to
> handle convection dominated problems where some some terms are added which
> die with successive iteration and I should look for these schemes on the
> internet.
We do have stabilization terms, see [1]. The problem is they depend on some
parameters and I never worked enough with those terms to learn how to use them
properly. It is easy to over-stabilize. And you still have to solve the linear
system. As you said that the Reynolds numbers would not be high in your
problems, I would try GMRES with ILU(0) anyway.