How to analyze the Output of Heliostat in a CSP system

640 views
Skip to first unread message

kumar saurav

unread,
Feb 17, 2011, 5:59:39 AM2/17/11
to Tonatiuh - Monte Carlo ray tracer for the optical simulation of CSP systems.
Sear Sir, I have designed a 200 (5m*5m) heliostat CSP system with in
built tracers of Tonatiuh. Now i want to analyze the system with a
refractive model at the end receiver.

Manuel J. Blanco

unread,
Feb 24, 2011, 4:37:06 PM2/24/11
to tonatiuh-...@googlegroups.com
Dear Kumar,

Could you elaborate a little more your analysis needs? What do you mean with "a refractive model at the end of the receiver"?

Sorry for the delay in answering you. I am traveling around.

Best regards,

kumar saurav

unread,
Feb 28, 2011, 8:58:58 AM2/28/11
to tonatiuh-...@googlegroups.com
Hello sir,
actually i have modelled a power tower CSP system but i want to
analyse the output of the rays at the end of receiver. I mean how much
tempreture does it generate. And also i want to do other thermal
analysis. Is it possible in TONATUIH.
If now how do i do i it.
Thank You,
God Help's,
Kumar Saurav

> --
> You received this message because you are subscribed to the Google Groups
> "Tonatiuh - Monte Carlo ray tracer for the optical simulation of CSP
> systems." group.
> To post to this group, send email to tonatiuh-...@googlegroups.com.
> To unsubscribe from this group, send email to
> tonatiuh-raytra...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/tonatiuh-raytracer?hl=en.
>
>

Manuel J. Blanco

unread,
Mar 2, 2011, 6:40:22 PM3/2/11
to tonatiuh-...@googlegroups.com
Dear Mr. Saurav,

You can use Tonatiuh to analyze the distribution of solar photons that will impinge a given surface or set of surfaces and will either be absorbed by the surface or be reflected or refracted -depending upon the properties of the material surfaces you are considering.

From that analysis you can estimate many things, for instance, if you are analyzing a reflector you can estimate the distribution of the solar flux incident upon a reflector, the distribution of the solar flux absorbed by the reflector, and the distribution of the solar flux reflected by the reflector.

Similarly, if you are analyzing the input aperture of a cavity-type central receiver in a north field tower system (assuming you are in the northern hemisphere) you can estimate the concentrated solar flux distribution at the input aperture, but you can also analyze the concentrated solar flux distribution incident upon the walls of the central cavity receiver, and the concentrated solar flux distribution absorbed and reflected from those walls. Then you can use this information, in combination with an appropriate thermal radiation, convection and conduction model of your cavity-receiver to estimate the temperature distribution on the internal walls of the cavity receiver, and the increase of enthalpy that the thermal working fluid -whatever that may be- experiment in passing through the receiver.

Al of the above analysis can be done based on the output from Tonatiuh and on your thermal model of your cavity receiver. However, doing it is far from trivial in most cases.

I hope this information is useful to you.

Best regards,


kumar saurav

unread,
Mar 8, 2011, 4:21:42 AM3/8/11
to tonatiuh-...@googlegroups.com
How to analyze using tonatiuh. I cant get you could you please elobrate


Best regards,


kumar saurav

unread,
Mar 9, 2011, 12:51:53 AM3/9/11
to tonatiuh-...@googlegroups.com
sir,
The output format of the binary data file is .dat and i m using R for analysis.
How to write those snippet in R for anaysis can you tell me a elobrated tutorial for this.

Thank You,
God Help's,
Kumar Saurav

Manuel J. Blanco

unread,
Mar 9, 2011, 7:08:35 PM3/9/11
to tonatiuh-...@googlegroups.com
Dear Mr. Saurav,

At the bottom of the Tonatiuh project home page, you can find the following R fragment, which you should be able to use in order to read Tonatiuh output files in R.


#Open binary data file.
fileName<- file("filePath/fileName.dat", "rb")

#Store the power per photon in poerPerPhoton variable.
powerPerPhoton <- readBin(fileName, what="numeric", n=1, endian="big")

#Create a vector with photons all the information.
endOfFile<-FALSE
photonData
photonData<-vector( mode="numeric")
while( !endOfFile )
{
   photon<-readBin(fileName, what="numeric", n=6, endian="big")
   if( length( photon ) < 6 ) endOfFile = TRUE else photonData<-append( photonData, photon )
}
#Close the data file.
close(fileName)

#Compute the number of photons in the vector. all the photon sextuples at a row per #sextuple
nPhotons<-length( photonData ) / 6
photonMap<-matrix(  photonData , nrow= nPhotons, ncol=6, byrow=TRUE )

If you decide to use this fragment, or a modification of it, to read Tonatiuh's output, please, feel free to do it, and if possible keep me informed of any problems you may encounter.

Best regards,

kumar saurav

unread,
Mar 10, 2011, 3:17:53 AM3/10/11
to tonatiuh-...@googlegroups.com
Sir i have encountered a problem that whenever i try to use the snippet of your, my software hangs and does nothing after execution of while code.
Do help please,

Thank You
God Help's
Kumar Saurav


Best regards,

--

kumar saurav

unread,
Mar 10, 2011, 3:32:22 AM3/10/11
to tonatiuh-...@googlegroups.com
also tell me what to do after the snippet is wholly entered in the R consol window to view the result. Actually i m beginner at using R.

kumar saurav

unread,
Mar 14, 2011, 2:35:48 AM3/14/11
to tonatiuh-...@googlegroups.com
Sir,
I haven't received any replies yet on how to analysis the system by writing snippet in R. I have written the snippet in R work book then i don't know what to to do next after writing the snippet. Can you be please be quick in replying. Thank You.

kumar saurav

unread,
Mar 15, 2011, 4:05:30 AM3/15/11
to tonatiuh-...@googlegroups.com
Sir,
I m eagerly waiting for your response on R snippet using.

Manuel J. Blanco

unread,
Mar 20, 2011, 9:43:05 PM3/20/11
to tonatiuh-...@googlegroups.com
Dear Mr. Saurav,

Excuse me for not having answered you earlier. Last week was a very hectic week for me. Furthermore, while I am relatively proficient in Mathematica, I had no experience in R. The R snipped in Tonatiuh's website is not mine. In any case, this weekend I installed R in my computer and started playing with it. 

R is a rich language and it is completely out of the scope of this user group to teach how to program in R. There many tutorials and supporting material in internet that you can use to learn programming in R. In addition, the program, itself has a fairly good help system that you should use. This being said, I can share with you what I have done to analyze with R the results of a modeling exercise that I have done with Tonaituh.

The exercise consisted in simulating with Tonatiuh an ideal parabolic dish. By ideal I mean 100% reflectivity and zero sigma-slope in the mirror surface. I wanted to use R to compute the size of the concentrated sun-spot on the receiver surface (this surface is modeled as a flat circular dish) and to calculate the concentrated solar flux distribution on this surface. You can find the file I used to model the parabolic dish in Tonatiuh in the Downloads section of the Tonatiuh website.

The R script I used to analyze the results generated with Tonatiuh is the following (all lines starting with "#" are comments):

#Open binary data file.
fileName<- file("/home/mblanco/Documents/rawData_1000000.dat", "rb")

#Read the power per photon (Watts per photon) and store its value in the varialbe named: "powerPerPhoton"
powerPerPhoton <- readBin(fileName, what="numeric", n=1, endian="big")

#Read all the photon records in the file and store the information in the vector variable named: "rawData"
#As explained in Tonatiuh's website, every photon record is composed of six numbers whith the following structure:
# PhotonID x-coordinate y-coordinate z-coordinate PrevPhotonID NextPhotonID
endOfFile<-FALSE
rawData<-vector( mode="numeric")

#To speed up the reading process we read nDataBlock binary numbers per iteration.
#Here we are setting nDataBlock = 6 * 10000, to read 10000 photo records per iteration,
#You should adjust this value depending on your computer RAM and processing speed 
nDataBlock = 6 * 10000
while( !endOfFile )
{
   dataBlock<-readBin(fileName, what="numeric", n=nDataBlock, endian="big")
   rawData<-append( rawData, dataBlock )
   if( length( dataBlock ) < nDataBlock ) endOfFile = TRUE 
}
#Close the data file.
close(fileName)

#Transform rawData into a 6-columns photonMap matrix, where each column represents
#a given photon data (PhotonID x-coordinate y-coordinate z-coordinate PrevPhotonID NextPhotonID)
photonMap<-matrix( rawData, ncol=6, byrow=T )
colnames( photonMap )<-c("PhotonID", "x", "y", "z", "PrevPhotonID", "NextPhotonID")

#Once the photonMap matrix is constructed, rawData is eliminated to save RAM
rawData<-c( )

#In this example we are analyzing the set of photons that hit the target of an ideal parabolic dish
#the information about those photons were exported from Tonatiuh in the local coordinates of the target
#Thus, of the three photons' coordinates only two (x and z) are relevant, since coordinate y, 
#which is the height above the target plane is zero for all photons that hit the target.
#We store the x and z coordinates of each photon in the two-columns matrix xzData, which is a subset of photonMap
xzData<-subset( photonMap, select=c("x", "z") );

#We define the minimum square that contains all the xzData points, i.e., photons
xzRange<-range(xzData);
minTargetSize<-xzRange[2]-xzRange[1];

#We divide the height and the width of this square in nBins parts, thus dividing the total area of the square 
#in nBins * nBins elements of area. Then, we count the number of photons which fall whithin each one of the 
#area elements by generating a 2D histogram (hist2d)
nBins<-150
library(gplots)
h2d<-hist2d( xzData,same.scale=TRUE, nbins=c(nBins,nBins) )

#We calculate the area of the area elements in which we have divided the target
elementSideLength<-minTargetSize/nBins
elementArea<-elementSideLength*elementSideLength

#We calculate the conversion factor for which we have to multiply the 2D-histogram to transform 
#its photon count per area element matrix into a flux matrix in units of kW/m2
conversionFactor<-(powerPerPhoton/1000)/elementArea
fluxMatrix<-h2d$counts*conversionFactor

#Once the fluxMatrix is computed we can represent it graphically in several ways, for instance by a contour plot
filled.contour( h2d$x, h2d$y, fluxMatrix, levels=c(0, 0.1, 1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000 ), color= rich.colors )
range(fluxMatrix)

I am assuming that the photon map exported from Tonatiuh was exported in local coordinates and just for the front receiver (i.e. for the receiver that is facing the parabolic dish mirror). The number of photons that were casted by Tonatiuh was one million.

The first of the two lines from the R-script which I have highlighted in red should generate a 2D histogram like this one:

The second line highlighted in red in the R-script should produce a contour plot like this one:

The command xzRange<-range(xzData) provides information regarding the size of the concentrated sun-spot on the receiver. The output of such command is in may case: -0.03866796  0.03853360
This values are very close to the theoretical values that can be computed from the radius of the dish and its focal length, which is: -0.040454268  0.040454268.

I hope this information is helpful to you. Please, if you need further clarification do not hesitate contacting me.

Best regards,
    

pramod.c...@gmail.com

unread,
Dec 20, 2013, 5:53:58 AM12/20/13
to tonatiuh-...@googlegroups.com
Dear Sir

           I am K PA Chaitanya, i am using tonatiuh for CSP(parabolic dish) after giving the values and exporting the photons, i am nt able to get the radiation flux mapping, kindly please tell me how to proceed , as after reading all the above answers i m quite confused, how to proceed.

I want to mention you that i am reading the SQL database files using SQL browser. But the radiation flux mapping is quite confusing.I am new to tonatiuh. Kindly help me out.

Thanking you

pramod.c...@gmail.com

unread,
Jan 3, 2014, 12:46:36 AM1/3/14
to tonatiuh-...@googlegroups.com
dear sir,

I want to know how the power per photon is obtained. Kindly provide if any specific formula, as i have tried almost all sorts, as the area of aperture changes the photon power in Watts change. as the no of rays increase photon power reduce,
and as the no of rays are less power of the photon is high how is happening.

Kindly help me out

Thanking You
K P A CHAITANYA

Amaia Mutuberria

unread,
Jan 3, 2014, 6:20:00 AM1/3/14
to tonatiuh-...@googlegroups.com, pramod.c...@gmail.com

Dear  Mr Chaitanya,

I have created two scripts to analyze the flux at the target of the Parabolic Dish system defined in the tutorial https://code.google.com/p/tonatiuh/wiki/Tutorial_ParabolicDish_V201. After modelling the system, I have simulated it with 1000000 rays. I have only exported the photons related with receiver intersection using local coordinates. I hope these examples will help you to analyze the database created by Tonatiuh as results of your the simulation.

The first script is for analyze the database using Mathematica. Mathematica is not free and if you haven’t got a license you can use the next script, script for R.

 The software environment related with the R programming language is open source and you can download it from http://www.r-project.org/, the official website. I have downloaded three libraries to use with the script:

  • library(RSQLite): to connect and execute SQL sentences using R functions.

  • library(ash): to create a photons grid with the receiver photons

  • library(gplots): to show results using plots.

If you open the attached files, you will realize that it is not necessary to use the SQL browser to analyze de simulation data. You can connect to the database from the scripts.

Please contact us if you have any problem with the scripts.

Regards 


Mathematica_ParabolicDish_v201_db.nb
R_ParabolicDish_v201.R

Walif M'kacher

unread,
May 15, 2014, 6:44:11 PM5/15/14
to tonatiuh-...@googlegroups.com, pramod.c...@gmail.com
Dear Mr Amaia Mutuberria,

Fist of all I would like to thank you for this great and valuable work that I appreciate and find it very useful to help me doing research works on one of the CSP systems.

So I have a question if you would mind helping me ; using Mathematica, how can I analyse database files to get the flux at a CYLINDER target, 
unlike the example you described witch analyse the flux on a flat surface.

I'm looking forward to having an answer from you

Best reagards
Reply all
Reply to author
Forward
0 new messages