Skip to content

Commit

Permalink
updated the cooling demo and some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FoleyLab committed Mar 28, 2022
1 parent 3dc555a commit 10ad973
Show file tree
Hide file tree
Showing 8 changed files with 320 additions and 53 deletions.
1 change: 1 addition & 0 deletions docs/autosummary/wpspecdev.MieDriver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
~MieDriver.__init__
~MieDriver.compute_hamiltonian
~MieDriver.compute_spectrum
~MieDriver.insert_layer
~MieDriver.material_Ag
~MieDriver.material_Air
~MieDriver.material_Al
Expand Down
2 changes: 2 additions & 0 deletions docs/autosummary/wpspecdev.TmmDriver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
~TmmDriver.compute_spectrum_gradient
~TmmDriver.compute_stpv
~TmmDriver.compute_stpv_gradient
~TmmDriver.insert_layer
~TmmDriver.material_Ag
~TmmDriver.material_Air
~TmmDriver.material_Al
Expand All @@ -45,6 +46,7 @@
~TmmDriver.material_polystyrene
~TmmDriver.material_static_refractive_index
~TmmDriver.parse_input
~TmmDriver.remove_layer
~TmmDriver.render_color
~TmmDriver.set_refractive_index_array

Expand Down
1 change: 1 addition & 0 deletions docs/autosummary/wpspecdev.materials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.. autosummary::

~Materials.__init__
~Materials.insert_layer
~Materials.material_Ag
~Materials.material_Air
~Materials.material_Al
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Dependencies
You need to install `numpy`, `scipy`, `sys`.
We recommend `matplotlib`, `jupyter`, and `pytest`.

Subheader
-------------------
Sample subheader
Examples
**********
Check out the example scripts and notebooks in the /examples/ folder.
264 changes: 222 additions & 42 deletions examples/Cooling_Demo.ipynb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ wpspecdev

A python package for modeling light-matter interactions in nanoscale and molecular materials!


### [Quickstart](https://wpspecdev.readthedocs.io/en/latest/quickstart.html)

### [Examples](https://github.com/FoleyLab/wpspecdev/tree/main/examples)

### Copyright
Copyright (c) 2021, Foley Lab, William Paterson University

Expand Down
4 changes: 2 additions & 2 deletions wpspecdev/em.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ def parse_input(self, args):

# need to throw some exceptions if len(self.thickness_array)!=len(self.material_array)
if "thickness_list" in args:
self.thickness_array = args["thickness_list"]
self.thickness_array = np.array(args["thickness_list"])
# default structure
else:
print(" Thickness array not specified!")
print(" Proceeding with default structure - optically thick W! ")
self.thickness_array = [0, 900e-9, 0]
self.thickness_array = np.array([0, 900e-9, 0])

if "material_list" in args:
self.material_array = args["material_list"]
Expand Down
90 changes: 84 additions & 6 deletions wpspecdev/therml.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,21 @@ def _compute_thermal_radiated_power(
theta_weights,
wavelength_array,
):
"""Put docstring here!"""
"""Method to compute the power radiated by the cooling structure
Attributes
----------
None
Returns
-------
P_rad
References
----------
See Eq. (2) of https://www.nature.com/articles/nature13883
"""

num_angles = len(theta_vals)
self._compute_therml_spectrum(wavelength_array, emissivity_array_s[0,:])

Expand Down Expand Up @@ -505,7 +519,21 @@ def _compute_thermal_radiated_power_gradient(
theta_weights,
wavelength_array,
):
"""Put docstring here!"""
"""Method to compute the gradient of the power radiated by the cooling structure
Attributes
----------
None
Returns
-------
_emitted_thermal_spectrum_gradient
References
----------
See Eq. (2) of https://www.nature.com/articles/nature13883
"""
num_angles = len(theta_vals)
# we don't care about the emissivity - just calling this for the blackbody spectrum
self._compute_therml_spectrum(wavelength_array, emissivity_gradient_array_p[0,:,0])
Expand Down Expand Up @@ -540,7 +568,21 @@ def _compute_atmospheric_radiated_power(
theta_weights,
wavelength_array,
):
"""Put docstring here!"""
"""Method to compute the power radiated by the atmosphere and absorbed by cooling structure
Attributes
----------
None
Returns
-------
P_atm
References
----------
See Eq. (3) of https://www.nature.com/articles/nature13883
"""
num_angles = len(theta_vals)

# make sure we are getting the blackbody spectrum of the atmosphere
Expand Down Expand Up @@ -580,7 +622,17 @@ def _compute_atmospheric_radiated_power_gradient(
theta_weights,
wavelength_array,
):
"""Put docstring here!"""
""" Method to compute the gradient of the power radiated by the atmosphere and absorbed by the cooling structure
Attribute
---------
None
Returns
-------
_absorbed_solar_spectrum_gradient
"""

_nth = len(theta_vals)
_ngr = len(emissivity_gradient_array_p[0,0,:])
_absorbed_atmospheric_radiation_gradient = np.zeros(_ngr)
Expand Down Expand Up @@ -618,7 +670,20 @@ def _compute_atmospheric_radiated_power_gradient(
def _compute_solar_radiated_power(
self, solar_spectrum, emissivity_array_s, emissivity_array_p, wavelength_array
):
"""Put a good docstring here!"""
"""Method to compute the solar power absorbed by the cooling structure
Attributes
----------
None
Returns
-------
P_sun
References
----------
See Eq. (4) of https://www.nature.com/articles/nature13883
"""
# compute the absorbed solar spectrum
_absorbed_solar_spectrum = (
solar_spectrum * 0.5 * (emissivity_array_p + emissivity_array_s)
Expand All @@ -630,7 +695,20 @@ def _compute_solar_radiated_power(
def _compute_solar_radiated_power_gradient(
self, solar_spectrum, emissivity_gradient_array_s, emissivity_gradient_array_p, wavelength_array
):
"""Put a good docstring here!"""
"""Method to compute the gradient of the solar power absorbed by the cooling structure
Attributes
----------
None
Returns
-------
_absorbed_solar_spectrum_gradient
References
----------
See Eq. (4) of https://www.nature.com/articles/nature13883
"""
# get the dimension of the gradient vector
_ngr = len(emissivity_gradient_array_s[0,:])
_absorbed_solar_spectrum_gradient = np.zeros(_ngr)
Expand Down

0 comments on commit 10ad973

Please sign in to comment.