Harmonic Boundary Condition (noob Fortran question)
Hey guys, I am trying to simulate a steady 2d temperature field for an assignment. I have constant prescribed temperatures on 3 edges of a rectangular mesh but one of them has a sine function that varies with height. I've been trying to code this for a while with no succes, if anyone could help me I would appreciate.
Here's the bit of code I am having trouble with: !West Boundary if (i .eq. 2) then aw = 2*cond*dy/dx yy(j) = dy do while (j .lt. m2) T(2,j) = Tini*sin(pi*yy(j)/a) yy(j) = yy(j)+dy end do end if !test write(*,*)"T west = ",T(2,5) It always returns T west = 0.0000... |
Tini is correctly prescribed?
Then, let us start for example at j=2 yy(2) = dy do while .... T(2,2) = Tini*sin(pi*yy(2)/a) yy(2) = yy(2)+dy T(2,3) = Tini*sin(pi*yy(3)/a) yy(3) = yy(3)+dy ..... what about your yy update??? |
My eyes may be getting old but it looks like you have i in the if test and j as the loop index. Are these supposed to be different? Where is the value of i set to get you into the if test block? Where is j incremented?
|
I think I found the problem, I was trying to set the boundary conditions before the temperature field, gonna try to fix it, thanks!
|
All times are GMT -4. The time now is 14:32. |