In [1]:
%matplotlib inline
In [2]:
import boxsimu
from boxsimu import ur
In [3]:
m_water = 1e10 * ur.kg
m_0 = 1e5 * ur.kg
flow_rate = 1e8 * ur.kg / ur.day
In [4]:
# FLUIDS
freshwater = boxsimu.Fluid('freshwater', rho=1000*ur.kg/ur.meter**3)
# VARIABLES
po4 = boxsimu.Variable('po4')
# PROCESSES
# No processes in this system
# REACTIONS
# No reactions in this system
# BOXES
lake = boxsimu.Box(
name='lake',
description='Little Lake',
fluid=freshwater.q(m_water),
variables=[po4.q(m_0)],
)
# FLOWS
inflow = boxsimu.Flow(
name='Inflow',
source_box=None,
target_box=lake,
rate=flow_rate,
tracer_transport=True,
concentrations={po4: 3e-1 * ur.gram / ur.kg},
)
outflow = boxsimu.Flow(
name='Outflow',
source_box=lake,
target_box=None,
rate=flow_rate,
tracer_transport=True,
)
# FLUXES
# No fluxes in this system
# BOXMODELSYSTEM
system = boxsimu.BoxModelSystem(
name='lake_system',
description='Simple Lake Box Model',
boxes=[lake,],
flows=[inflow, outflow,],
)
In [7]:
sol = system.solve(800*ur.day, 1*ur.day, save_frequency=200)
sol.df[:10]
sol.plot_variable_mass(po4)
sol.plot_variable_concentration(po4)
Out[7]:
In [16]:
import datetime
t = datetime.date.today()
print('{:%Y%m%d}'.format(t))
In [2]:
import os.path
os.listdir()
Out[2]:
In [ ]: