CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Help: Steps to convert 2D to 3D code (https://www.cfd-online.com/Forums/main/69143-help-steps-convert-2d-3d-code.html)

quarkz October 13, 2009 10:49

Help: Steps to convert 2D to 3D code
 
Hi guys n gals,

I want to convert my 2D fractional step NS solver into a 3D one. I tried but make a mess of it.

I would like to start again but can someone with experience give me some guides or steps to follow?

I wonder if I should change the boundary condition to make it into a 3D lid driven cavity test to do some initial verification. My code is also parallel but I also have a serial version. I wonder if I should edit the serial one 1st or just do the parallel code in one go.

How to prevent the code changing into a debugging nightmare... ;-)

Thanks alot!

Killercam October 23, 2009 09:33

Quarkz,

Allways but always ammend the serial code first! As you rightly point out and no doubt know from experience debugging a parralell code can be a nightmare.

I take it you are using some simple cartesien, or spherically symmetric 2D mesh, which you parralellise in some way. The best way is not to try to ammend the 2d version per say, but right all new 3D routines based on the older 2D versions. Ammending existing subroutines is not the way to go, and you can end up creating rubbish and getting lost. Be structured and methodical using the routines from the 2D version where possible...

Hope this helps.

All the best and good luck.

Nick

quarkz October 23, 2009 23:32

Hmm... thanks Killercam.

while I was waiting for a response, I decided to change my code to a semi 2d/3d one by adding a 3rd dimension such that v(x,y) = v(x,y,1). I thought this will enable me to do some check "halfway".

if it can't work, i'll use your suggestion, which is of cos a much safer way.


All times are GMT -4. The time now is 15:22.