Skip to content

Commit

Permalink
Merge pull request #245 from VirtualPlanetaryLaboratory/ParamSweepFix
Browse files Browse the repository at this point in the history
Fixed issues with examples/ParameterSweep
  • Loading branch information
RoryBarnes committed Aug 25, 2023
2 parents 772028e + 7930b29 commit 2393879
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
56 changes: 56 additions & 0 deletions examples/ParameterSweep/earth.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Earthlike parameters
sName earth # Body's name
saModules radheat thermint

# Physical Properties
dMass -1.0 # Mass, negative -> Earth masses
dRadius -1.0 # Radius, negative -> Earth radii
dRotPeriod -1.0 # Rotation period, negative -> days
dObliquity 23.5
dRadGyra 0.5
# Orbital Properties
dEcc 0.0167 # Eccentricity
dSemi -1 # Semi-major axis, negative -> AU


# RADHEAT Parameters
# *Num* are in numbers of atoms, negative -> Earth vals
### 40K
d40KPowerMan -1
d40KPowerCore -1
d40KPowerCrust -1
### 232Th
d232ThPowerMan -1
d232ThPowerCore -1
d232ThPowerCrust -1
### 235U
d235UPowerMan -1
d235UPowerCore -1
d235UPowerCrust -1
### 238U
d238UPowerMan -1
d238UPowerCore -1
d238UPowerCrust -1

### THERMINT inputs.
dTMan 3000
dTCore 6000
#dViscJumpMan 2.40
dActViscMan 3e5

saOutputOrder -Time -TMan -TUMan -TLMan -TCMB -TCore $
-HflowUMan -HflowMeltMan -RadPowerMan -RadPowerCore -RadPowerCrust $
-HflowCMB -HflowSecMan $
-TDotMan -TDotCore -TJumpLMan -TJumpUMan -RIC -RayleighMan -ViscUMan -ViscLMan $
-MeltMassFluxMan -FMeltUMan $
-MagMom -CoreBuoyTherm -CoreBuoyCompo -CoreBuoyTotal -MagPauseRad $
-BLUMan -BLLMan $
-238UPowerMan -238UNumMan -238UMassMan -238UPowerCore -238UNumCore -238UMassCore $
-238UPowerCrust -238UNumCrust -238UMassCrust $
-235UPowerMan -235UNumMan -235UMassMan -235UPowerCore -235UNumCore -235UMassCore $
-235UPowerCrust -235UNumCrust -235UMassCrust $
-232ThPowerMan -232ThNumMan -232ThMassMan -232ThPowerCore -232ThNumCore -232ThMassCore $
-232ThPowerCrust -232ThNumCrust -232ThMassCrust $
-40KPowerMan -40KNumMan -40KMassMan -40KPowerCore -40KNumCore -40KMassCore $
-40KPowerCrust -40KNumCrust -40KMassCrust ChiOC ChiIC MassChiOC MassChiIC MassOC MassIC $
-RadPowerTotal -SurfEnFluxTotal
14 changes: 12 additions & 2 deletions examples/ParameterSweep/makeplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,29 @@

# Run vspace
if not (path / "ParameterSweep").exists():
print("Running VSPACE...")
subprocess.check_output(["vspace", "vspace.in"], cwd=path)
else:
print("VPSACE already run")

# Run multi-planet
if not (path / ".ParameterSweep").exists():
print("Running MultiPlanet...")
subprocess.check_output(["multiplanet", "vspace.in"], cwd=path)
else:
print("Multiplanet already run")

# Run bigplanet
if not (path / "ParameterSweep.bpf").exists():
print("Building BigPlanet File")
subprocess.check_output(["bigplanet", "bpl.in"], cwd=path)
else:
print("BigPlanet File already built")

print("Creating figure...")
data = bp.BPLFile(path / "ParameterSweep.bpf")

mpl.rcParams["figure.figsize"] = (10, 8)
mpl.rcParams["figure.figsize"] = (6.5, 6.5)
fig = plt.figure()

RIC = bp.ExtractColumn(data, "earth:RIC:final")
Expand All @@ -44,7 +54,7 @@

RIC_Matrix = np.reshape(RIC, (len(TCore_uniq), len(K40_uniq)))

# RIC_Matrix = bp.CreateMatrix(TCore_uniq, K40_uniq, RIC)
RIC_Matrix = bp.CreateMatrix(TCore_uniq, K40_uniq, RIC)

contours = [0, 500, 1000, 1500, 2000, 2500]
xlabel = "Initial Core Temperature (" + TCore_units + ")"
Expand Down
9 changes: 9 additions & 0 deletions examples/ParameterSweep/sun.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# sun parameters
sName sun
dMass 1
dSemi 0
dEcc 0
dRadius 0.00135
dLuminosity 3.846e26
sStellarModel none
saModules stellar

0 comments on commit 2393879

Please sign in to comment.