17
AN INTRODUCTION TO “CLOUDY” Mitchell Revalski October 29, 2018

AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

AN INTRODUCTION TO “CLOUDY”

Mitchell Revalski

October 29, 2018

Page 2: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

WHAT IS CLOUDY?

• Cloudy is a spectral synthesis code created by Gary Ferland that has been developed and improved over the last 40 years. The code website URL is: https://nublado.org/

• The most recent version is called C17.01, and it is discussed in this paper: https://arxiv.org/abs/1705.10877

• Cloudy models the interaction of radiation with the interstellar medium to predict the physical conditions in the gas and its emitted spectrum

Page 3: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

WHAT CLOUDY NEEDS TO RUN

To create a physically consistent model, Cloudy mustbe able to determine the number and energy distribution

of photons striking the face of a cloud with known composition and geometry.

Page 4: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

THE CLOUDY DOCUMENTATION

• The full operation of Cloudy is described in the code’s documentation:

• Quick Start Guide – basic info on running Cloudy and understanding output

• Hazy 1 – a complete list and description of all input commands

• Hazy 2 – a complete description of the output generated by Cloudy

• Hazy 3 – simulation physics, out of date, refer to ISM textbook “AGN2”.

Page 5: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

RUNNING CLOUDY

• Cloudy is controlled by a series of input

commands, entered in the input block.

• If the code has sufficient information to run,

then Cloudy generates the output block.

• To the right is an example of a planetary

nebula input file (model.in):

• title Planetary Nebula• (gives a title on output)

• radius 17• (log of inner radius in cm)

• hden 4• (log of hydrogen density)

• blackbody temp=100000 lumin=38• (temperature, log of luminosity in ergs/sec)

• filling factor 0.3• (fraction of geometry that is filled)

• Sphere• (radiation field allowed to interact with other side)

• print last iter• (print results from last zone, 1st zone is always

printed)

Page 6: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

RUNNING CLOUDY

• Cloudy is controlled by a series of input

commands, entered in the input block.

• If the code has sufficient information to

run, then Cloudy generates the output

block.

• To the right is an example of a planetary

nebula input file (model.in):

Page 7: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

EXAMINING THE OUTPUT

Page 8: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

CLOUDY OUTPUT

• First, Cloudy will print the code version number, and the input commands:

Page 9: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

CLOUDY OUTPUT

• Next, Cloudy prints information on the radiation field and gas composition:

Page 10: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

CLOUDY OUTPUT• This is followed by physical and simulation information, and warnings:

Page 11: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

CLOUDY OUTPUT• The input is printed again, followed by intrinsic and emergent line strengths:

• The format is: line label, wavelength (A or m), flux (cgs), and ratio relative to 𝐻𝛽

Page 12: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

TIPS ON THE CLOUDY OUTPUT

• There are a variety of SAVE commands in Cloudy

• These allow you to control the main output, and save additional files

• See Hazy 1, Chapter 16 (C17.01) for further information on SAVE options

• Be careful with linear vs. logarithmic quantities, and check the output!

• Make sure it says “Cloudy exited OK” at the end of your model!

Page 13: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

INSTALLING CLOUDY C17.01

• First, go to the official Cloudy website:

https://www.nublado.org/

• Click on the "StepByStep" instructions:

https://www.nublado.org/wiki/StepByStep

• Click on the "Download" link:

https://www.nublado.org/wiki/DownLoad

• Click on the "DownloadLinks" link:

https://www.nublado.org/wiki/DownloadLinks

• Click on the download "here" link, it says: "C17

is available for download as a tarball here."

• Click on the main file, e.g. "c17.01.tar.gz".

• Copy the file to a folder called "cloudy".

Preferably in a directory with a short file path.

• Right click and select "Extract" or "Extract

Here". Note, do not extract with "7-Zip" or

"winzip".

• Open a terminal in this folder, and change directory with "cd" to the "source" folder, e.g.:

• cd source/

• Next, build and compile the code using the "make" command: In the terminal, type:

• make

• You should see the message "Creating cloudyconfig.h", followed by lots of output. It will take several minutes for the code to build.

• When the code has finished building, check to make sure the final executable was produced by typing:

• ls *.exe

Page 14: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

INSTALLING CLOUDY C17.01

• You should see "cloudy.exe" in the output.

Next, we will run a basic test to ensure the

code is working properly. Type:

• ./cloudy.exe

• (then hit enter)

• test

• (then hit enter)

• This will run a basic script that ensures the

codes basic functions are working properly.

Note that on some computers you may not

need the "./" or ".exe" to run the code. At the

bottom you should see: "[Stop in cdMain at

maincl.cpp:470, Cloudy exited OK]"

• Next, we want to run the "crash tests" that

make sure the code crashes when math

operations are violated. Type:

• ./cloudy.exe

• crash overflow

• Repeat for crash zero, crash NaN, and crash

assert

• Each of these tests will print a message that

indicates whether or not the code "crashed"

properly. All of these tests absolutely must

pass!

Page 15: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

INSTALLING CLOUDY C17.01

• Finally, the ultimate test of the code is to run

the "test suite". This is a list of simulations that

can take several hours to run on a laptop.

Change directory to the test suite via:

• cd ../tsuite

• ./run_parallel.pl

• To specify to only use 2 processors, use:

• ./run_parallel.pl . 2

• When these are done both the "auto" and

"slow" test suites should give you the following

message: "The test suite was successful; you

have a valid executable.“

• If you need the hard drive space, all of the

outputs can be erased afterwards using:

• ./clean_tsuite.pl

• Finally, here is an example of running your

own script called "script.in", which writes to

"script.out". In this case I've specified the full

run path in case your Cloudy complains that

it could not find the required data files:

• /nfs/morgan/users/…(username)…/cloudy/c1

7.01/source/cloudy.exe < script.in > script.out

Page 16: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

IDL TIPS

• See the sample program with comments called “idlprogram.pro”.

Page 17: AN INTRODUCTION TO “CLOUDY”crenshaw/revalski_cloudy.pdf · •title Planetary Nebula • (gives a title on output) •radius 17 • (log of inner radius in cm) •hden 4 • (log

CLOUDY QUESTIONS?

• If you have trouble running Cloudy, feel free to drop me an email:

revalski[at]astro.gsu.edu