Class AnaerobicDigester
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.TwoPortEquipment
neqsim.process.equipment.reactor.StirredTankReactor
neqsim.process.equipment.reactor.Fermenter
neqsim.process.equipment.reactor.AnaerobicDigester
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Anaerobic digester for biogas production from organic substrates.
Models single-stage continuous stirred-tank reactor (CSTR) anaerobic digestion using
stoichiometric conversion of a defined organic substrate to biogas (CH4 + CO2). The digester
extends Fermenter to reuse its reactor vessel, mixing, and stream management
infrastructure, adding biogas-specific calculations.
Key Parameters
- Organic loading rate (OLR) — kg VS / (m3 * day)
- Hydraulic retention time (HRT) — days
- Volatile solids (VS) destruction — fraction of VS converted
- Specific methane yield — Nm3 CH4 / kg VS destroyed
Substrate Types
| Substrate | Specific CH4 Yield (Nm3/kg VS) | Default VS Destruction |
|---|---|---|
| SEWAGE_SLUDGE | 0.30 | 55% |
| FOOD_WASTE | 0.45 | 80% |
| MANURE | 0.20 | 45% |
| CROP_RESIDUE | 0.28 | 50% |
| ENERGY_CROP | 0.35 | 65% |
| CUSTOM | user-defined | user-defined |
Usage example:
AnaerobicDigester digester = new AnaerobicDigester("AD-1");
digester.setSubstrateType(AnaerobicDigester.SubstrateType.FOOD_WASTE);
digester.setFeedRate(10000.0, 0.25); // 10 t/hr at 25% total solids
digester.setVesselVolume(5000.0);
digester.setDigesterTemperature(37.0, "C");
digester.run();
double biogasFlow = digester.getBiogasFlowRateNm3PerDay();
double methaneContent = digester.getMethaneContentPercent();
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSubstrate type enumeration.static enumTemperature regime enumeration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleActual specific methane yield used.private doubleVS destruction achieved.private doubleBiogas flow rate in Nm3/day.private StreamInterfaceBiogas product stream.private StreamInterfaceDigestate (effluent) outlet stream.private booleanWhether the digester has been run.private doubleDigester temperature in Kelvin.private doubleFeed rate in kg/hr (total wet mass).private doubleHydraulic retention time in days.private static final org.apache.logging.log4j.LoggerLogger instance.private doubleMethane content in biogas (volume fraction, default 0.60).private doubleMethane production rate in Nm3/day.private doubleOrganic loading rate in kg VS / (m3 * day).private static final longSerialization version UID.private doubleSpecific methane yield override (Nm3 CH4 / kg VS destroyed).private AnaerobicDigester.SubstrateTypeSubstrate type.Temperature regime.private doubleTotal solids fraction of the feed (0-1).private doubleVS destruction fraction override.private doubleVS/TS ratio (volatile solids as fraction of total solids).Fields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionAnaerobicDigester(String name) Creates an anaerobic digester with the given name.AnaerobicDigester(String name, StreamInterface inletStream) Creates an anaerobic digester with the given name and inlet stream. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the actual VS destruction achieved.doubleReturns the biogas flow rate in Nm3/day.Returns the biogas outlet stream.Returns the digestate outlet stream.doubleGets the digester temperature in Kelvin.doubleGets the feed rate in kg/hr.doubleReturns the hydraulic retention time in days.doubleReturns the methane content as a volume percent.doubleReturns the methane production rate in Nm3/day.doubleReturns the organic loading rate in kg VS / (m3 * day).Returns all outlet streams produced by this equipment.Returns a map of key results from the digester simulation.Gets the substrate type.Gets the temperature regime.doubleGets the total solids fraction.voidRuns the anaerobic digester simulation.voidsetDigesterTemperature(double temperatureK) Sets the digester temperature in Kelvin.voidsetDigesterTemperature(double temperature, String unit) Sets the digester temperature with unit specification.voidsetFeedRate(double feedRateKgPerHr, double totalSolidsFrac) Sets the feed rate and total solids content.voidsetMethaneFraction(double fraction) Sets the methane fraction in biogas.voidsetSpecificMethaneYield(double yieldNm3PerKgVS) Sets the specific methane yield override.voidSets the substrate type.voidsetVSDestruction(double fraction) Sets the VS destruction override.voidsetVSTSRatio(double ratio) Sets the VS/TS ratio (overrides the substrate type default).toJson()Returns a JSON string with the digester results.toString()private voidUpdates the temperature regime classification based on digester temperature.Methods inherited from class Fermenter
getAerationPower, getAerationRate, getCellYield, getCO2EvolutionRate, getKLa, getMaintenanceCoefficient, getTargetPH, getTotalPower, isAerobic, setAerationRate, setAerobic, setCellYield, setKLa, setMaintenanceCoefficient, setTargetPHMethods inherited from class StirredTankReactor
addReaction, clearReactions, getAgitatorPower, getAgitatorPowerPerVolume, getHeatDuty, getHeatDuty, getPressureDrop, getReactions, getReactorPressure, getReactorTemperature, getResidenceTime, getVesselVolume, isIsothermal, setAgitatorPowerPerVolume, setIsothermal, setPressureDrop, setReactorPressure, setReactorTemperature, setReactorTemperature, setResidenceTime, setVesselVolumeMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletStreams, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletPressure, setOutletStream, setOutletTemperature, setOutletTemperature, toJson, validateSetupMethods inherited from class ProcessEquipmentBaseClass
addCapacityConstraint, addController, copy, displayResult, equals, getAvailableMargin, getAvailableMarginPercent, getBottleneckConstraint, getCapacityConstraints, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMaxUtilization, getMaxUtilizationPercent, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, initMechanicalDesign, isActive, isActive, isCapacityAnalysisEnabled, isCapacityExceeded, isFailed, isHardLimitExceeded, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getElectricalDesign, getEquipmentState, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletTemperature, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from interface TwoPortInterface
getInStream, getOutStream, setOutPressure, setOutPressure, setOutTemperature, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger instance. -
substrateType
Substrate type. -
feedRateKgPerHr
private double feedRateKgPerHrFeed rate in kg/hr (total wet mass). -
totalSolidsFraction
private double totalSolidsFractionTotal solids fraction of the feed (0-1). -
vstsFraction
private double vstsFractionVS/TS ratio (volatile solids as fraction of total solids). -
digesterTemperature
private double digesterTemperatureDigester temperature in Kelvin. -
temperatureRegime
Temperature regime. -
specificMethaneYield
private double specificMethaneYieldSpecific methane yield override (Nm3 CH4 / kg VS destroyed). -
vsDestruction
private double vsDestructionVS destruction fraction override. -
methaneFraction
private double methaneFractionMethane content in biogas (volume fraction, default 0.60). -
biogasOutStream
Biogas product stream. -
digestateOutStream
Digestate (effluent) outlet stream. -
biogasFlowRateNm3PerDay
private double biogasFlowRateNm3PerDayBiogas flow rate in Nm3/day. -
methaneProductionNm3PerDay
private double methaneProductionNm3PerDayMethane production rate in Nm3/day. -
organicLoadingRate
private double organicLoadingRateOrganic loading rate in kg VS / (m3 * day). -
hydraulicRetentionTimeDays
private double hydraulicRetentionTimeDaysHydraulic retention time in days. -
actualVsDestruction
private double actualVsDestructionVS destruction achieved. -
actualSpecificMethaneYield
private double actualSpecificMethaneYieldActual specific methane yield used. -
digesterHasRun
private boolean digesterHasRunWhether the digester has been run.
-
-
Constructor Details
-
AnaerobicDigester
Creates an anaerobic digester with the given name.- Parameters:
name- equipment name
-
AnaerobicDigester
Creates an anaerobic digester with the given name and inlet stream.- Parameters:
name- equipment nameinletStream- the sludge/substrate inlet stream
-
-
Method Details
-
setSubstrateType
Sets the substrate type. This sets default values for specific methane yield, VS destruction, and VS/TS ratio.- Parameters:
type- the substrate type
-
getSubstrateType
Gets the substrate type.- Returns:
- substrate type
-
setFeedRate
public void setFeedRate(double feedRateKgPerHr, double totalSolidsFrac) Sets the feed rate and total solids content.- Parameters:
feedRateKgPerHr- total wet feed rate in kg/hrtotalSolidsFrac- total solids fraction (0-1)
-
getFeedRateKgPerHr
public double getFeedRateKgPerHr()Gets the feed rate in kg/hr.- Returns:
- feed rate in kg/hr
-
getTotalSolidsFraction
public double getTotalSolidsFraction()Gets the total solids fraction.- Returns:
- total solids fraction (0-1)
-
setVSTSRatio
public void setVSTSRatio(double ratio) Sets the VS/TS ratio (overrides the substrate type default).- Parameters:
ratio- VS/TS ratio (0-1)
-
setDigesterTemperature
public void setDigesterTemperature(double temperatureK) Sets the digester temperature in Kelvin.- Parameters:
temperatureK- temperature in Kelvin
-
setDigesterTemperature
Sets the digester temperature with unit specification.- Parameters:
temperature- temperature valueunit- unit string ("K", "C", "F")
-
getDigesterTemperature
public double getDigesterTemperature()Gets the digester temperature in Kelvin.- Returns:
- digester temperature in K
-
getTemperatureRegime
Gets the temperature regime.- Returns:
- temperature regime
-
setSpecificMethaneYield
public void setSpecificMethaneYield(double yieldNm3PerKgVS) Sets the specific methane yield override.- Parameters:
yieldNm3PerKgVS- specific methane yield in Nm3 CH4 / kg VS destroyed
-
setVSDestruction
public void setVSDestruction(double fraction) Sets the VS destruction override.- Parameters:
fraction- VS destruction fraction (0-1)
-
setMethaneFraction
public void setMethaneFraction(double fraction) Sets the methane fraction in biogas.- Parameters:
fraction- methane volume fraction (0-1)
-
getBiogasOutStream
Returns the biogas outlet stream.- Returns:
- biogas outlet stream, or null if not yet run
-
getDigestateOutStream
Returns the digestate outlet stream.- Returns:
- digestate outlet stream, or null if not yet run
-
getBiogasFlowRateNm3PerDay
public double getBiogasFlowRateNm3PerDay()Returns the biogas flow rate in Nm3/day.- Returns:
- biogas flow rate
-
getMethaneProductionNm3PerDay
public double getMethaneProductionNm3PerDay()Returns the methane production rate in Nm3/day.- Returns:
- methane production rate
-
getMethaneContentPercent
public double getMethaneContentPercent()Returns the methane content as a volume percent.- Returns:
- methane volume percent
-
getOrganicLoadingRate
public double getOrganicLoadingRate()Returns the organic loading rate in kg VS / (m3 * day).- Returns:
- organic loading rate
-
getHydraulicRetentionTimeDays
public double getHydraulicRetentionTimeDays()Returns the hydraulic retention time in days.- Returns:
- HRT in days
-
getActualVsDestruction
public double getActualVsDestruction()Returns the actual VS destruction achieved.- Returns:
- VS destruction (0-1)
-
getOutletStreams
Returns all outlet streams produced by this equipment. Subclasses override to report their specific outlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Specified by:
getOutletStreamsin interfaceProcessEquipmentInterface- Overrides:
getOutletStreamsin classTwoPortEquipment- Returns:
- unmodifiable list of outlet streams (empty by default)
-
run
Runs the anaerobic digester simulation.- Specified by:
runin interfaceSimulationInterface- Overrides:
runin classFermenter- Parameters:
id- UUID for this run
-
updateTemperatureRegime
private void updateTemperatureRegime()Updates the temperature regime classification based on digester temperature. -
getResults
-
toJson
Returns a JSON string with the digester results.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classStirredTankReactor- Returns:
- JSON results string
-
toString
-