Define the bulk: an object used to define the environment connected to the simulated system. More...
Public Member Functions | |
Bulk (Simulator aSim, XMLParser aBulkRoot) | |
Creates a bulk compartment object with attributes specified in the protocol file. More... | |
void | updateBulk (SoluteGrid[] soluteGrid, SoluteGrid[] reacGrid, double timeStep) |
Updates the bulk solute concentration if the bulk is not constant. More... | |
void | updateChemostatBulk (SoluteGrid[] allSol, SoluteGrid[] reacGrid) |
Method to update Bulk solute concentrations during a chemostat setup. More... | |
void | updateBulkByReaction (SoluteGrid[] reacGrid, double timeStep) |
Update bulk concentration by reaction, determining reaction rate seen from reaction compartments. More... | |
void | updateBulkByGradient (SoluteGrid[] soluteGrid, double timeStep) |
Update bulk concentration on the basis of the flow passed through the interface with the bulk compartment. More... | |
void | computeFlow (SoluteGrid aSG, DiscreteVector aDC, ContinuousVector flow) |
Compute massic flow. More... | |
Boolean | contains (int soluteIndex) |
Determine if a particular solute is in the bulk. More... | |
double | getValue (int soluteIndex) |
Get the value of a particular solute in the bulk. More... | |
void | setValue (int soluteIndex, double value) |
Set the value of a particular solute in the bulk. More... | |
String | getName () |
Get the name of this bulk. More... | |
double | getTimeConstraint () |
Return the time constraint of the bulk. More... | |
void | writeReport (ResultFile buffer) throws Exception |
Writes a description of the bulk in the result file. More... | |
Public Attributes | |
Simulator | mySim |
double[] | _bulkValue |
double | _D |
double[] | _sIn |
Boolean[] | _isConstant |
Define the bulk: an object used to define the environment connected to the simulated system.
The Bulk is an object used to define the environment connected to the simulated system : this environment can impose concentrations on the boundaries (constant boundary) or exchange matter through the boundaries (bulk boundary). A bulk is a perfectly mixed liquid compartment of the system, usually with a larger size than the extent of the simulated biofilm domain. For example, in a wastewater reactor the bulk would refer to the liquid volume being treated. The bulk will usually have a fixed volume, but the volume is not specified here, instead the definition of the computationDomain addresses the bulk compartment volume
Creates a bulk compartment object with attributes specified in the protocol file.
Constructor for the Bulk compartment. For each bulk specified in the protocol file, creates a simulation bulk object with the attributes specified in the XML. This includes storing the information for each solute (initial concentrations, reaction rates, constant/varying concentration levels, and whether pulsed concentrations are employed) in the retrospective array for access in later calculations
aSim | The simulation object upon which the scenario specified in the protocol file is beinbg run |
aBulkRoot | The XML tag objects that sub-nodes of the 'Bulk' tag in the protocol file |
void simulator.geometry.Bulk.computeFlow | ( | SoluteGrid | aSG, |
DiscreteVector | aDC, | ||
ContinuousVector | flow | ||
) |
Compute massic flow.
Compute massic flow : g.m-2.time-1
aSG | a solute grid for a particular solute |
aDC | Position on the grid |
flow | Flow direction |
Boolean simulator.geometry.Bulk.contains | ( | int | soluteIndex | ) |
Determine if a particular solute is in the bulk.
Determine if a particular solute is in the bulk. Uses the index of this solute in the simulation dictionary
soluteIndex | Index of solute in the simulation dictionary |
String simulator.geometry.Bulk.getName | ( | ) |
Get the name of this bulk.
Get the name of this bulk
double simulator.geometry.Bulk.getTimeConstraint | ( | ) |
Return the time constraint of the bulk.
Return the time constraint of the bulk
double simulator.geometry.Bulk.getValue | ( | int | soluteIndex | ) |
Get the value of a particular solute in the bulk.
Get the value of a particular solute in the bulk. Uses the index of this solute in the simulation dictionary
soluteIndex | Index of solute in the simulation dictionary |
void simulator.geometry.Bulk.setValue | ( | int | soluteIndex, |
double | value | ||
) |
Set the value of a particular solute in the bulk.
Set the value of a particular solute in the bulk. Uses the index of this solute in the simulation dictionary
soluteIndex | Index of solute in the simulation dictionary |
value | Level at which to set the solute level |
void simulator.geometry.Bulk.updateBulk | ( | SoluteGrid[] | soluteGrid, |
SoluteGrid[] | reacGrid, | ||
double | timeStep | ||
) |
Updates the bulk solute concentration if the bulk is not constant.
Updates the bulk solute concentration if the bulk is not constant. bvm note 15.12.08: modified routine to allow input of solute grid. bvm note 13.07.09: removed passing-in of 'implicit' flag, and instead set the bulk update method via the XML protocol file
soluteGrid | Grid of all solutes in the simulated system |
reacGrid | Grid of all reactions in the simulated system |
timeStep | Internal timestep used to update the simulation environment |
void simulator.geometry.Bulk.updateBulkByGradient | ( | SoluteGrid[] | soluteGrid, |
double | timeStep | ||
) |
Update bulk concentration on the basis of the flow passed through the interface with the bulk compartment.
Update bulk concentration on the basis of the flow passed through the interface with the bulk compartment
IMPORTANT: this method should ONLY be used to test the updateBulkByReaction routine with FLAT biofilms because this routine does not treat the gradient through the interface correctly. DO NOT USE FOR GENERAL SIMULATIONS
soluteGrid | Grid of all solutes in the simulated system |
timeStep | Internal timestep used to update the simulation environment |
void simulator.geometry.Bulk.updateBulkByReaction | ( | SoluteGrid[] | reacGrid, |
double | timeStep | ||
) |
Update bulk concentration by reaction, determining reaction rate seen from reaction compartments.
Update bulk concentration by reaction, determining reaction rate seen from reaction compartments
reacGrid | An array of uptake-rates grids in g.L-1.h-1 |
timeStep | Internal timestep used to update the simulation environment |
void simulator.geometry.Bulk.updateChemostatBulk | ( | SoluteGrid[] | allSol, |
SoluteGrid[] | reacGrid | ||
) |
void simulator.geometry.Bulk.writeReport | ( | ResultFile | buffer | ) | throws Exception |
Writes a description of the bulk in the result file.
Writes a description of the bulk in the result file
buffer | Buffer to which simulation results are being written |
Exception | Exception thrown if this buffer cannot be written to |
double [] simulator.geometry.Bulk._bulkValue |
Array containing the initial bulk concentration of each solute in the bulk. RJC 22/8/11 - Made public so that Solver_chemostat can use it to initialise solute concentrations
double simulator.geometry.Bulk._D |
Reactor Dilusion rate of the bulk. Used if isConstant is set to false
Boolean [] simulator.geometry.Bulk._isConstant |
Array of booleans that note whether the concentration of each specified solute varies over time or remains constant
double [] simulator.geometry.Bulk._sIn |
Array of doubles that specify the feed flow concentration of each solute in this simulation (if applicable)
Simulator simulator.geometry.Bulk.mySim |
The simulation object being used to simulate the conditions specified in the protocol file