CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Advice on Software dev Career in CFD / Timeline of constructing a FVM Code

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 3 Post By sbaffini
  • 1 Post By Fluidentity13
  • 2 Post By wangmianzhi
  • 2 Post By wangmianzhi
  • 1 Post By FMDenaro
  • 1 Post By arjun
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2021, 02:43
Default Advice on Software dev Career in CFD / Timeline of constructing a FVM Code
  #1
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
Hi to all,

So I have been working in the HPDC Die Casting industry using packages like MagmaSoft, Flow-3D & ESI's ProCast. (Got to be the most challenging CFD application ever with super high velocity/pressure gradients + shocks etc.)

Lack of competitive peers & a love for the underlying CFD code made me pursue as many courses as I can on the software dev aspect of it. Has been ongoing for more than a year now.

M.Sc. in scientific computing applications have gone to waste last season (probably due to bad grades). Lately I decided to go all in, & applied to as many beginner software dev jobs for companies like ANSYS, Altair, Dassault Systems etc. once I finished with DSA etc. Not going as expected though.

Until I find an opportunity, I've decided to go through as much cfd code as I can. Finding a dead end with FDM, I am finally on the path of developing a FVM solver to be run on python (ultimately will convert to C++ for multi-threading) & visualize using VTK libraries. [Final goal is to visualise a cloud passing over a ridge in blender(using vtk) & match it with an actual past experience.]

Now i am familiar with SIMPLE algorithm & would like to pursue that with a structured grid. Going with a staggered grid combination initially, can anyone give me a timeline for moving through 1-D, 2-D, 3-D codes one by one, as I don't know what to expect!



TLDR:

1. Timeline for coding 1-D, 2-D & 3-D SIMPLE FVM Codes with structured grid & staggered grid interpolation. (never mind checkerboard oscillations)
2. Very much appreciate if anyone can help me out by reviewing my application for Software dev roles in companies like ANSYS, Altair etc.
Attached Images
File Type: jpg Ridge Cloud.jpg (30.3 KB, 16 views)
Fluidentity13 is offline   Reply With Quote

Old   October 15, 2021, 04:09
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,168
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
First of all, while I haven't worked specifically for such big companies, I can still give a little overview, so let me clarify that working in big CFD companies can be approached from 4 main sides:

1) Sales/marketing: you will be giving a lot of presentations, showing off the code to potential clients, etc. You won't always need to be trained in that specific software of the company, but that would be a huge plus. Also, for whatever company, this requires handling pretty advanced stuff, so a strong experience in CFD is still needed. Every now and then you can still find some openings requiring little experience, but you need to bring something to the table, some desirable competence, besides fitting the role in general.

2) Tech support: you will be working on actual CFD problems with clients. With respect to sales, you probably need slightly less interpersonal skills, but pretty much always requires a certain experience with, at least, one specific field. CFD companies will almost always look for an expert in combustion, acoustics, multiphase, etc. More often than not the expert level is at the Ph.D. here. Knowing the specific CFD code will be a plus, but you are expected to understand any CFD code here as well.

3) Software engineer: the term varies from company to company, but here I refer to everything needed to put together the CFD offer of the company but not related to the actual CFD code itself. This goes from the GUI to the cloud infrastructure to all the IT stuff required for these companies, with the scope of the role typically being inversely proportional to the company size. This is pretty much the only job (besides non technical roles) where you can actually not know CFD (but if you do is a strong plus). However, you must be good at C++ (almost always) and whatever framework is used by the company to put things together (which tend to be a lot in these days).

4) CFD software developer: this is probably the role you were talking about. Now, I don't want to let you down, but big CFD codes are complex pieces of math softwares. You don't necessarily need to be competent on each piece of them, but a Ph.D. level of competence is practically mandatory. Note that I'm not saying that you need a Ph.D. but you need to prove that you have that level of compence in CFD. Also, you must typically have worked before on something as big for sufficient time in order to have a chance here. Experience in grid generation software development is also greatly appreciated. And I'm not even talking about proven competence in C++ (sometimes Fortran), MPI, parallel handling of unstructured grids, etc. For example, would you be able to spot a bug in, say, the least squares gradient computation, a wall function implementation, a Roe solver or a GMRES implementation? Because that's what a CFD development job is mostly about. Besides, there are also a lot of aspects related to pure numerical computations, stability and robustness, etc., so that even knowing how to code something written in a textbook, it is just half of the job (Yet, I know people who would just add epsilons to possibly ill-posed operations, so this might be debatable).

This for the reality check. You can't expect to land a job in CFD development with basically 0 competence. But, I guess, this is the same for most jobs.

However, you should definitely embark in this journey if that's what you want to do. Honestly, I would not focus on frameworks. Python is ok if you already know it, but true CFD codes are in C++ or Fortran. My suggestion is to start with something you are already productive with while you learn, but eventually switch to actual programming languages. Multi-threading is nice, but MPI is what CFD codes mostly run on. Structured grids are mostly relevant in academia (I say this in a positive way, in the sense that research codes focused on physical modeling need better accuracy that is only easily available on structured grids), but unstructured grids are the norm today.

Until I finished my Ph.D. I never tought I could actually land any CFD development job nor, for this reason, I invested in it actually. Yet, I've been always obsessed with learning how a general CFD code would work. So, when the chance arrived, my competence was just there without even knowing.

There is also not a timeline to give. You learn certain stuff in CFD courses. For example, I had never coded a 2D panel code when I just started with a 3D one, which took me some time. But when I needed a 2D one for comparisons I was able to code it in a day. So, it really depends from where you stand and what you want to achieve. But don't put timelines on stuff you don't know because it's just going to ruin your experience.

Maybe you can still keep trying with your job applications in CFD dev, who am I to say otherwise, but if you have clear what these jobs are you may have a bigger chance.
arjun, ishan_ae and Fluidentity13 like this.
sbaffini is offline   Reply With Quote

Old   October 15, 2021, 07:22
Default
  #3
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
Thanks a lot, Paolo, for your most valuable guidance. Your point of requiring a Ph.D. competence is what I am struggling with at the moment. Besides the beauty of CFD code, one other motivation I have for this, revolves around the horrible job market for anything other than tech. Therefore I seriously want to get into tech as soon as possible, not sacrificing my skillset which is a priority. The job market for CFD tech is quite substantial here in India.

Now obviously I need to project my skillset some way or the other without possessing a doctorate. That's where the code from scratch & the ridge cloud presentation comes in.

Quote:
Originally Posted by sbaffini View Post
But when I needed a 2D one for comparisons I was able to code it in a day.
Thanks a lot for providing a figure here. I believe a 2D panel shouldn't take me more than a week too, following bartholomew's Rhie & Chow interpolation.
https://www.researchgate.net/publica...e_arrangements

Next objectives would be to convert into C++, then multi-threading, then using unstructured mesh using snappyHexMesh or Salome. As soon as blender visualisation is ready I'll try to share asap.
sbaffini likes this.
Fluidentity13 is offline   Reply With Quote

Old   October 15, 2021, 07:46
Default
  #4
Member
 
Mianzhi Wang
Join Date: Jan 2015
Location: Columbus, IN
Posts: 34
Rep Power: 11
wangmianzhi is on a distinguished road
I feel so related! I love CFD so much that I keep it as a hobby to protect it from becoming a daily grind. I believe working on one's own CFD code is just as fun as working on a commercial code, minus the stresses. Here are some of my recommendations:


1. find your favorite algebraic solver packages (ODE solver, non-linear solver, sparse matrix solver, etc.) and do not write your own algebraic solver in production code.
2. keep an eye on both unstructured grid and octree (quadtree for 2D) grid.
3. maintain a github repository to demonstrate your competence.
ishan_ae and Fluidentity13 like this.
wangmianzhi is offline   Reply With Quote

Old   October 15, 2021, 09:31
Default
  #5
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
Thanks Mr. Wang for the advice. I believe it was videos of adaptive mesh only, posted by Tobi Holzmann which got me interested into the manipulation of existing code.

Quote:
Originally Posted by wangmianzhi View Post
1. find your favorite algebraic solver packages (ODE solver, non-linear solver, sparse matrix solver, etc.) and do not write your own algebraic solver in production code.
Can you expand on the algebraic solver package a little bit though?

Initially with FDM I was only writing explicit solvers (implicit only for isolated crank nicolson). After a while I realised it'll be very tough to discretise properly for a universal problem (can only be manipulated for steady, cavity flow kind of examples), without integrating over the volume.

Can you provide any working examples of any such algebra solvers. I am a little unsure of where these are used.
Fluidentity13 is offline   Reply With Quote

Old   October 15, 2021, 10:52
Default
  #6
Member
 
Mianzhi Wang
Join Date: Jan 2015
Location: Columbus, IN
Posts: 34
Rep Power: 11
wangmianzhi is on a distinguished road
Quote:
Originally Posted by Fluidentity13 View Post
Thanks Mr. Wang for the advice. I believe it was videos of adaptive mesh only, posted by Tobi Holzmann which got me interested into the manipulation of existing code.


Can you expand on the algebraic solver package a little bit though?

Initially with FDM I was only writing explicit solvers (implicit only for isolated crank nicolson). After a while I realised it'll be very tough to discretise properly for a universal problem (can only be manipulated for steady, cavity flow kind of examples), without integrating over the volume.

Can you provide any working examples of any such algebra solvers. I am a little unsure of where these are used.

By "algebraic solvers" I mean something like this:
https://computing.llnl.gov/projects/sundials
and this:
https://people.engr.tamu.edu/davis/suitesparse.html
and don't forget this:
https://netlib.sandia.gov/lapack/



You'll still need to define the problem (a.k.a. discretize) by yourself. But be sure to separate "solving" from the problem definition. In this way you can use a high-performance solver like those above. It requires generations of PhDs to put together robust, high-performance "solvers" like those. You can write your own RK4 or LU decomposition, but don't expect it be remotely close to CVODE and DGESV().
sbaffini and Fluidentity13 like this.
wangmianzhi is offline   Reply With Quote

Old   October 27, 2021, 04:58
Post Overview of v01 steps (SIMPLE Unsteady)
  #7
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
Quote:
Originally Posted by wangmianzhi View Post
By "algebraic solvers" I mean something like this:
https://computing.llnl.gov/projects/sundials
and this:
https://people.engr.tamu.edu/davis/suitesparse.html
and don't forget this:
https://netlib.sandia.gov/lapack/
Thanks a lot for introducing me to these algebraic solvers. Now, I am able to recall that I used scipy.linalg for crank-nicholson implicit Eqns for 2D Plate conduction a while back.

Anyways, I am extremely close to my first Unsteady SIMPLE solver (2D, Staggered) & had to refer everything to get here (Patankar, Chowdhuy, Fluid Mechanics 101 -YT). Even so, I didn't find a suitable time-stepping & convergence loop combined methodology laid out already. So I guess I did improvise a little bit.

Can anyone go through the 2nd & 3rd page of the pdf & provide some validation/feedback on the code I'm going to write. I don't think it should be hard to interpret.
Thanks a lot.

Link to the 3-page pdf.
https://drive.google.com/file/d/1Q5X...ew?usp=sharing
Fluidentity13 is offline   Reply With Quote

Old   October 27, 2021, 08:55
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,813
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Fluidentity13 View Post
Thanks a lot for introducing me to these algebraic solvers. Now, I am able to recall that I used scipy.linalg for crank-nicholson implicit Eqns for 2D Plate conduction a while back.

Anyways, I am extremely close to my first Unsteady SIMPLE solver (2D, Staggered) & had to refer everything to get here (Patankar, Chowdhuy, Fluid Mechanics 101 -YT). Even so, I didn't find a suitable time-stepping & convergence loop combined methodology laid out already. So I guess I did improvise a little bit.

Can anyone go through the 2nd & 3rd page of the pdf & provide some validation/feedback on the code I'm going to write. I don't think it should be hard to interpret.
Thanks a lot.

Link to the 3-page pdf.
https://drive.google.com/file/d/1Q5X...ew?usp=sharing





I want to push your attention to an issue I continue to see in the discussions. The convergence means you are able to assess that the residuals are below a certain threshold. Do not use the differences between the variables.
FMDenaro is offline   Reply With Quote

Old   October 27, 2021, 09:22
Default
  #9
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I want to push your attention to an issue I continue to see in the discussions. The convergence means you are able to assess that the residuals are below a certain threshold. Do not use the differences between the variables.
Thanks a lot for pointing that out, I almost forgot about that. I am not running the convergence check just about yet, would be running 5 iterations for each time step, maybe will check if quantities are converging appending to the solution with the equations.
I'll get that fixed right away.

One thing I am concerned about : Does the choice of ux uy values to calculate momentum eqn coefficients, pressure correction coefficients and time stepping coeff look good?
Fluidentity13 is offline   Reply With Quote

Old   November 1, 2021, 05:18
Question
  #10
New Member
 
Aman Sangal
Join Date: Mar 2021
Posts: 22
Blog Entries: 2
Rep Power: 5
Fluidentity13 is on a distinguished road
I am in need of help on this. I am seriously stuck on ill-conditioned matrix (cond = 1e16 and above) & can't seem to find a solution to this problem. Can anybody point me in the correct direction.

This solution of linear system of equations is being done for the pressure corrector term in SIMPLE which further corrects pressure & Velocity.
I've attached the images of the A matrix, cond number range of matrix, & the warning message I receive in the console during run.
Attached Images
File Type: jpg Coefficient matrix for pressure correction.jpg (114.1 KB, 14 views)
File Type: png ill-conditioned matrix .png (45.2 KB, 12 views)
File Type: png Warning Message .png (76.8 KB, 9 views)
Fluidentity13 is offline   Reply With Quote

Old   November 1, 2021, 06:03
Default
  #11
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,813
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Fluidentity13 View Post
I am in need of help on this. I am seriously stuck on ill-conditioned matrix (cond = 1e16 and above) & can't seem to find a solution to this problem. Can anybody point me in the correct direction.

This solution of linear system of equations is being done for the pressure corrector term in SIMPLE which further corrects pressure & Velocity.
I've attached the images of the A matrix, cond number range of matrix, & the warning message I receive in the console during run.



Why don't you open your post for this question?
It seems you are simply discovering that in the incompressible flow model, the pressure equation has a singular matrix.
Fluidentity13 likes this.
FMDenaro is offline   Reply With Quote

Old   November 1, 2021, 06:53
Default
  #12
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,278
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Fluidentity13 View Post
I am in need of help on this. I am seriously stuck on ill-conditioned matrix (cond = 1e16 and above) & can't seem to find a solution to this problem. Can anybody point me in the correct direction.

This solution of linear system of equations is being done for the pressure corrector term in SIMPLE which further corrects pressure & Velocity.
I've attached the images of the A matrix, cond number range of matrix, & the warning message I receive in the console during run.
I think too that you shall start a new thread.

Further, since it is a pressure matrix you should not have this bad condition number. So either your mesh is not good or your solver is diverging and you end up with this matrix. In summary you should be able to use normal linear solver for it. You do not need special solvers.
Fluidentity13 likes this.
arjun is offline   Reply With Quote

Old   November 1, 2021, 07:50
Default
  #13
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,813
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arjun View Post
I think too that you shall start a new thread.

Further, since it is a pressure matrix you should not have this bad condition number. So either your mesh is not good or your solver is diverging and you end up with this matrix. In summary you should be able to use normal linear solver for it. You do not need special solvers.



It depends if this is the matrix after the Neumann BCs have been inserted or not. The matrix must be singular after that.
arjun likes this.
FMDenaro is offline   Reply With Quote

Reply

Tags
code from scratch, fvm, job hunting advice, simple, structured grid


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20
CFD Symposium (Call for Papers) Chris R. Kleijn Main CFD Forum 0 October 5, 1998 10:25
ASME CFD Symposium - Call for Papers Chris R. Kleijn Main CFD Forum 0 September 8, 1998 08:19
ASME CFD Symposium - Call for Papers Chris R. Kleijn Main CFD Forum 0 September 3, 1998 08:45


All times are GMT -4. The time now is 21:43.