Showing posts with label Radiative Transfer. Show all posts
Showing posts with label Radiative Transfer. Show all posts

Tuesday, May 5, 2009

An year has passed and...

It is been a year since I last wrote here. Since two weeks ago, the flux code is finally working, and flawlessly. I spent a lot of time trying to make things to work as I would like them to do, and it took me more time than I wanted and expected, but now it is working the way I expect.

The thing that took most of my time solving was the multi-level atom. The method I was using to calculate the 3-level hydrogen atom was flawed, and I was using it just to make the code run. Now I am using the output source function value of CV to calculate a 3-level hydrogen atom. CV uses a 2-level atom with continuum approach to calculate the line source function, without needing the number densities of the required levels, but using the line source function is possible to acquire the number densities. Since the medium is considered to be optically thin for Lyman lines, the population of the fundamental level can be calculated using thermodynamical equilibrium. Knowing the first level number density, and the ratio of number densities between the line transition levels, we can solve a 3-level atom. It seems simple, but this took months of my time. I tried many different ways to calculating these number densities, before I saw the way I am using now.

After that was done, I had to solve some problems with the code that were causing problems with the results. There were problem when calculating the grid used by Flux. Problems with the size of the grid boundaries. A problem after the grid re-sampling, when points that should be out of the region of diskwind and magnetospheric-accretion have values of densities, velocities, etc, different than zero. And the last problem solved, was that one of the codes was replacing the phi-component of the velocity to zero everywhere.

Now the code is running, the grid points used are correct, and also is the velocity and density fields. No changes were made in the temperature law.

Thursday, March 6, 2008

Stellar Continuum with Flux

I will try another approach to solve the flux calculation problem I am having in the codes. I will calculate each component of the profile separately, doing one step at a time. First only the continuum coming from the star, then see what happens with the continuum under the optical depths of the magnetosphere, and the wind, but without the flux contribution from these sources. In this way I can see if the absorptions on the continuum are in the right place, and the velocities are right. Then I will calculate only the magnetospheric contribution to the profile, and I will do the same to the diskwind component. Then I can see where the broad wings are coming from. After figuring that out, I will finally and both component to the stellar continuum, and I hope to have a good profile at last.

During my first continuum calculation I noticed a problem that was happening for velocities just higher than zero velocity. I forgot to bypass the optical depth test, and with that the code bypassed all the continuum calculations from those velocities. After ignoring the optical depth test in 'intens.f', I have the right continuum again. I guess this problem might be linked to the always present deep red shifted absorption (more than expected, and every time) found in all the profiles calculated so far. I need to take a deeper look at that.

The continuum calculated is in the file named 'prof.60.ha.mmax_7700K.dmax_7700K.continuum'. That is for a 60 degree inclination, the h-alpha line, maximum temperature in the magnetospheric funnel of 7700K, and maximum temperature in the diskwind region of 7700K. The stellar parameters are for a typical Classica T Tauri Star:
  • Mass: 0.5 Msun
  • Radius: 2.0 Rsun
  • Photospheric Temperature: 4000K
  • Accretion Ring Temperatura: 8000K
  • Mass Accretion Rate: 1e-8 Msun/Year
  • Mass Loss Rate: 1e-9 Msun/Year
  • Magnetospheric Inner and Outer Radius: 3.0 Rstar and 3.3 Rstar
  • Diskwind Inner and Outer Radius: 3.31 Rstar and 20.0 Rstar
The mass loss rate was calculated using the poloidal velocities in the base of the disk, and the densities in that region. The gas density that is used is a function of r and falls with r^(-1.5).

Obs: Just for you to remember. The intens.f have been changed to calculate only the continuum. I guess you will not forget that, but anyway...

Wednesday, February 20, 2008

Fortran and Fluxes Problems

In the last few weeks I have been working in this "Flux" code non-stop. I have been solving problems trying to make that code work with the output of my modified CV code for a little more than two months, and I still was not able to make it work properly.

Last week I found a problem, that I first thought was an interpolation problem, but it turned out to be something else. Actually, the problem was something that I have done wrong. When I tested the points through each of the rays to find if they were inside the wind region, I made a mistake. The wind has some geometric parameters, but to use those parameters I first have to made a change of variables, and I was not doing that, so my wind region was being calculated with wrong boundaries. And these wrong boundaries were the reason I had problems with the interpolation.

I recalculated the correct boundaries, the interpolation problems were solved, but still the code did not work properly.

After a while I noticed other thing wrong. My grid that should be a circular grid, was instead an elliptical grid. I solved that today. The grid is circular, but the results are far from the expected yet.

I am running out of ideas to solve the problems with this code... I have the feeling that my stellar flux is far too low compared with the magnetosphere and diskwind fluxes, but I don't know why, and that does not make much sense to me. The optical depths in the magnetospheric funnel seems to be right this time. But there is a weird red-shifted absorption feature in my profiles that does not match what I was expecting for the inclination I am using.

May the Radiative Tranfer and Fortran 77 Gods have mercy on my mind, and give me some inspiration to solve this... :P