|
[Sponsors] |
Harmonic Boundary Condition (noob Fortran question) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 30, 2018, 19:08 |
Harmonic Boundary Condition (noob Fortran question)
|
#1 |
New Member
Fredh
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
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... |
|
August 30, 2018, 19:19 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
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??? |
|
August 31, 2018, 12:08 |
|
#3 |
Senior Member
Join Date: Jul 2009
Posts: 358
Rep Power: 19 |
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?
|
|
September 2, 2018, 11:24 |
|
#4 |
New Member
Fredh
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
I think I found the problem, I was trying to set the boundary conditions before the temperature field, gonna try to fix it, thanks!
|
|
Tags |
code, fortran 90, loop, mesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
Problem in setting Boundary Condition | Madhatter92 | CFX | 12 | January 12, 2016 05:39 |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 07:16 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |
a simple Boundary condition question | prapanj | OpenFOAM Running, Solving & CFD | 1 | March 16, 2009 08:51 |