Transport Equation code, Fortran77

In summary, the code used to solve the one dimensional one group (a fixed velocity is considered for the particles) time independent transport equation uses the ##S_N## discrete ordinates method, a Gauss-Legendre quadrature in the angular directions, and a Diamond Difference formula for the spatial discretization. The one dimensional transport equation is: ##\mu \frac{d\Psi(x,\mu)}{dx}+\sigma_T \Psi(x,\mu)=\sigma_s \int \Psi(x,\mu') d\mu' + q(x,\mu)##. I am interested in solving it in the domain ##[0,10
  • #1
Telemachus
835
30
Hi. I have written a code to solve the one dimensional one group (a fixed velocity is considered for the particles) time independent transport equation. The code uses the ##S_N## discrete ordinates method, a Gauss-Legendre quadrature in the angular directions, and a Diamond Difference formula for the spatial discretization.

The one dimensional transport equation is:

##\mu \frac{d\Psi(x,\mu)}{dx}+\sigma_T \Psi(x,\mu)=\sigma_s \int \Psi(x,\mu') d\mu' + q(x,\mu)##.I am interested in solving it in the domain ##[0,10]## with vacuum boundary conditions:
##\Psi(0,\mu)=0## for all ##\mu>0##
##\Psi(10,\mu)=0## for all ##\mu<0##

In the ##S_N## discrete ordinates method the equation is solved in the discrete directions ##\mu_m##, which for my discretization are given by the Gauss-Legendre abscissas.

The scalar flux is then ##\phi(x)=\int \Psi(x,\mu') d\mu' \sim \sum_n \Psi_n(x) w_n##
Where ##\Psi_n(x)=\Psi(x,\mu_n)## and ##w_n## are the weights in the Gauss-Legendre quadrature.

The Diamond discretization subdivided the domain in meshes, and there is an equation that connects the values in the mesh boundaries, and the value for the mesh centers is the average value of the value at the boundaries.

The complete discretized equation reads:

##\frac{\mu_n}{\Delta x} (\Psi_n,{j+1/2}-\Psi_n,{j-1/2})+\sigma_T \Psi_n,j=\sigma_s \sum_m \Psi_m w_m + q_n,j##.

With the auxiliary relation that connects the boundaries with the mesh centers:
##\Psi_n,j=\frac{1}{2}(\Psi_n,{j+1/2}+\Psi_n,{j-1/2})##.

Replacing this last equation in the one above it, one obtain a discrete relation which together with the boundary conditions provides all the relations needed to solve the discretized equation. I am using an iteration scheme that starts with an initial value of zero for the function inside the integral, and iterates until convergence.

Finally, the relation reads for the iteration step l+1:

##\Psi^{l+1}_n,{j+1/2}=\frac{(2\mu_n-\sigma_T\Delta x)\Psi_n,{j-1/2}+2 \Delta x(\sigma_s \Phi^l_j+q_j)}{2\mu_n+\sigma_t \Delta x}## for ##\mu_n>0##

And:
##\Psi^{l+1}_n,{j-1/2}=\frac{(-2\mu_n-\sigma_T\Delta x)\Psi_n,{j-1/2}+2 \Delta x(\sigma_s \Phi^l_j+q_j)}{-2\mu_n+\sigma_t \Delta x}## for ##\mu_n<0##.

I have written a code in Fortran77 to solve this problem using the steps described above. I've been trying to reproduce the results in this paper (page 312 and 313), which uses ##q=0.01, \sigma_T=100,\sigma_s=100##: http://www.sciencedirect.com/science/article/pii/0021999187901707

However, my code doesn't converge to the solution. I have tried with manufactured solutions, and the code converges. But I don't know why it doesn't converge in this particular case. I know my solution is wrong, because in the first place I don't obtain what is in this paper, and in the second place because if I try to recover the source using finite difference in my solution, I don't obtain the source I have put in there.
 
Technology news on Phys.org
  • #2
Telemachus said:
I have written a code in Fortran77 to solve this problem using the steps described above. I've been trying to reproduce the results in this paper (page 312 and 313), which uses q=0.01,σT=100,σs=100q=0.01,σT=100,σs=100q=0.01, \sigma_T=100,\sigma_s=100: http://www.sciencedirect.com/science/article/pii/0021999187901707
I have several comments. The paper you linked to is behind a paywall. Also, do you expect us to wade through 300+ pages of the paper to find these results? Finally, since you didn't post the code you wrote, we have no way of knowing why you aren't getting the expected results.
 
  • Like
Likes Telemachus
  • #3
Ok, sorry. I have put the page numbers where the results are, and I have access to that paper in my university. However, I have found were the problem was, and it wasn't a code error. The problem is stiff, and required a really huge number of iterations in order to converge. There is a phenomenon of false convergence in problems like these, because the convergence is too slow. However, by changing the problem dimensions a little bit, and with a huge number of iterations I've obtained the desired result.

Thanks.
 

1. What is a Transport Equation code in Fortran77?

A Transport Equation code in Fortran77 is a computer program written in the Fortran77 programming language that solves transport equations, which are mathematical equations used to describe the movement of a physical quantity (such as heat or mass) through space and time.

2. How does a Transport Equation code in Fortran77 work?

A Transport Equation code in Fortran77 works by taking in user-defined inputs, such as the initial conditions and boundary conditions of the system, and using numerical methods to solve the transport equations and calculate the evolution of the physical quantity over time and space.

3. What is Fortran77 and why is it used for Transport Equation codes?

Fortran77 is a programming language commonly used in scientific and engineering applications. It is well-suited for solving complex mathematical equations, making it a popular choice for writing Transport Equation codes. Additionally, Fortran77 has a long history and a large library of mathematical functions and subroutines, making it a reliable and efficient option for scientific computing.

4. What are some common applications of Transport Equation codes in Fortran77?

Transport Equation codes in Fortran77 are commonly used in a variety of fields, including fluid dynamics, heat transfer, and atmospheric science. They can be used to model the behavior of fluids and gases, simulate heat transfer processes, and study the transport of pollutants and other substances in the atmosphere.

5. Are there any limitations or considerations when using a Transport Equation code in Fortran77?

Like any computer program, there may be limitations or considerations when using a Transport Equation code in Fortran77. It is important to carefully select appropriate numerical methods and ensure that the code is properly validated and verified before use. Additionally, the use of older programming languages like Fortran77 may limit the ability to incorporate newer techniques or features into the code.

Similar threads

  • Programming and Computer Science
Replies
4
Views
619
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
944
  • Differential Equations
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
877
  • High Energy, Nuclear, Particle Physics
Replies
3
Views
880
  • Programming and Computer Science
Replies
6
Views
1K
Replies
24
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
Back
Top