Sign in

    zhaoyuanjuns/moonbit_extractor/units does not have a README file

    Amount

    pub(all) struct Amount {
    value : Double
    unit : AmountUnit
    } derive(Eq, ToJson,
    Debug
    )

    Amount::add

    fn Amount::add(self : Amount, other : Amount) -> Amount

    Amount::convert

    fn Amount::convert(self : Amount, unit : AmountUnit) -> Amount

    Amount::kilomole

    fn Amount::kilomole(self : Amount) -> Double

    Amount::mole

    fn Amount::mole(self : Amount) -> Double

    Amount::pound_mole

    fn Amount::pound_mole(self : Amount) -> Double

    AmountUnit

    pub(all) enum AmountUnit {
    Mole
    KiloMole
    PoundMole
    } derive(Eq, ToJson,
    Debug
    )

    Amount units used for molar balances.

    CapacityCheck

    pub(all) struct CapacityCheck {
    name : String
    required : Double
    available : Double
    utilization : Double
    margin : Double
    feasible : Bool
    } derive(Eq, ToJson,
    Debug
    )

    Concentration

    pub(all) struct Concentration {
    solute_mass : Mass
    carrier_mass : Mass
    } derive(Eq, ToJson,
    Debug
    )

    Concentration::mass_fraction

    fn Concentration::mass_fraction(self : Concentration) -> Double

    Concentration::new

    Concentration::ratio

    fn Concentration::ratio(self : Concentration) -> Double

    Density

    pub(all) struct Density {
    mass_kg_per_cubic_meter : Double
    } derive(Eq, ToJson,
    Debug
    )

    DimensionlessGroups

    pub(all) struct DimensionlessGroups {
    reynolds : Double
    schmidt : Double
    peclet : Double
    weber : Double
    froude : Double
    } derive(Eq, ToJson,
    Debug
    )

    Duration

    pub(all) struct Duration {
    value : Double
    unit : TimeUnit
    } derive(Eq, ToJson,
    Debug
    )

    Duration::per_second

    fn Duration::per_second(self : Duration) -> Double

    DynamicViscosity

    pub(all) struct DynamicViscosity {
    pascal_second : Double
    } derive(Eq, ToJson,
    Debug
    )

    DynamicViscosity::centipoise

    fn DynamicViscosity::centipoise(self : DynamicViscosity) -> Double

    DynamicViscosity::kinematic

    fn DynamicViscosity::kinematic(self : DynamicViscosity, density : Density) -> Double

    Energy

    pub(all) struct Energy {
    value : Double
    unit : EnergyUnit
    } derive(Eq, ToJson,
    Debug
    )

    Energy::add

    fn Energy::add(self : Energy, other : Energy) -> Energy

    Energy::convert

    fn Energy::convert(self : Energy, unit : EnergyUnit) -> Energy

    Energy::joule

    fn Energy::joule(self : Energy) -> Double

    Energy::kilojoule

    fn Energy::kilojoule(self : Energy) -> Double

    Energy::kilowatt_hour

    fn Energy::kilowatt_hour(self : Energy) -> Double

    Energy::megajoule

    fn Energy::megajoule(self : Energy) -> Double

    Energy::scale

    fn Energy::scale(self : Energy, factor : Double) -> Energy

    EnergyUnit

    pub(all) enum EnergyUnit {
    Joule
    KiloJoule
    MegaJoule
    KilowattHour
    } derive(Eq, ToJson,
    Debug
    )

    Energy units for heating and cooling duty estimates.

    Mass

    pub(all) struct Mass {
    value : Double
    unit : MassUnit
    } derive(Eq, ToJson,
    Debug
    )

    Mass::add

    fn Mass::add(self : Mass, other : Mass) -> Mass

    Mass::convert

    fn Mass::convert(self : Mass, target : MassUnit) -> Mass

    Mass::unit

    fn Mass::unit(self : Mass) -> MassUnit

    Mass::value

    fn Mass::value(self : Mass) -> Double

    MassFlow

    pub(all) struct MassFlow {
    mass : Mass
    duration : Duration
    } derive(Eq, ToJson,
    Debug
    )

    MassFlow::kg_per_hour

    fn MassFlow::kg_per_hour(self : MassFlow) -> Double

    MassFlow::kg_per_second

    fn MassFlow::kg_per_second(self : MassFlow) -> Double

    MassFlow::new

    fn MassFlow::new(mass~ : Mass, duration~ : Duration) -> MassFlow

    MassUnit

    pub(all) enum MassUnit {
    Kilogram
    Gram
    Pound
    } derive(Eq, ToJson,
    Debug
    )

    Explicit engineering quantities prevent accidental mixing of kg/h and kg/s.

    MolarFlow

    pub(all) struct MolarFlow {
    amount : Amount
    duration : Duration
    } derive(Eq, ToJson,
    Debug
    )

    MolarFlow::kilomole_per_hour

    fn MolarFlow::kilomole_per_hour(self : MolarFlow) -> Double

    MolarFlow::mole_per_second

    fn MolarFlow::mole_per_second(self : MolarFlow) -> Double

    MolarFlow::new

    fn MolarFlow::new(amount~ : Amount, duration~ : Duration) -> MolarFlow

    OperatingConditions

    pub(all) struct OperatingConditions {
    temperature : Temperature
    pressure : Pressure
    residence_time : Duration
    } derive(Eq, ToJson,
    Debug
    )

    A consistent operating point passed between process calculations.

    OperatingConditions::new

    fn OperatingConditions::new(temperature~ : Temperature, pressure~ : Pressure, residence_time~ : Duration) -> OperatingConditions

    OperatingConditions::pressure

    OperatingConditions::residence_time

    fn OperatingConditions::residence_time(self : OperatingConditions) -> Duration

    OperatingConditions::temperature

    OperatingConditions::with_pressure

    fn OperatingConditions::with_pressure(self : OperatingConditions, pressure : Pressure) -> OperatingConditions

    OperatingConditions::with_residence_time

    fn OperatingConditions::with_residence_time(self : OperatingConditions, residence_time : Duration) -> OperatingConditions

    OperatingConditions::with_temperature

    fn OperatingConditions::with_temperature(self : OperatingConditions, temperature : Temperature) -> OperatingConditions

    Power

    pub(all) struct Power {
    energy : Energy
    duration : Duration
    } derive(Eq, ToJson,
    Debug
    )

    Power is energy delivered per unit time.

    Power::energy_for

    fn Power::energy_for(self : Power, duration : Duration) -> Energy

    Power::kilowatt

    fn Power::kilowatt(self : Power) -> Double

    Power::new

    fn Power::new(energy~ : Energy, duration~ : Duration) -> Power

    Power::watt

    fn Power::watt(self : Power) -> Double

    Pressure

    pub(all) struct Pressure {
    value : Double
    unit : PressureUnit
    } derive(Eq, ToJson,
    Debug
    )

    Pressure::atmosphere

    fn Pressure::atmosphere(self : Pressure) -> Double

    Pressure::bar

    fn Pressure::bar(self : Pressure) -> Double

    Pressure::convert

    fn Pressure::convert(self : Pressure, unit : PressureUnit) -> Pressure

    Pressure::drop

    fn Pressure::drop(self : Pressure, downstream : Pressure) -> Pressure

    Pressure::kilopascal

    fn Pressure::kilopascal(self : Pressure) -> Double

    Pressure::millimeter_hg

    fn Pressure::millimeter_hg(self : Pressure) -> Double

    Pressure::pascal

    fn Pressure::pascal(self : Pressure) -> Double

    Pressure::ratio

    fn Pressure::ratio(self : Pressure, reference : Pressure) -> Double

    Pressure::unit

    fn Pressure::unit(self : Pressure) -> PressureUnit

    Pressure::value

    fn Pressure::value(self : Pressure) -> Double

    PressureUnit

    pub(all) enum PressureUnit {
    Pascal
    KiloPascal
    Bar
    Atmosphere
    MillimeterHg
    } derive(Eq, ToJson,
    Debug
    )

    Pressure units used by equilibrium and equipment models.

    StorageSizing

    pub(all) struct StorageSizing {
    working_volume : Double
    surge_volume : Double
    total_volume : Double
    diameter : Double
    height : Double
    aspect_ratio : Double
    } derive(Eq, ToJson,
    Debug
    )

    Temperature

    pub(all) struct Temperature {
    value : Double
    unit : TemperatureUnit
    } derive(Eq, ToJson,
    Debug
    )

    A non-negative absolute temperature with explicit units.

    Temperature::celsius

    fn Temperature::celsius(self : Temperature) -> Double

    Temperature::convert

    fn Temperature::convert(self : Temperature, unit : TemperatureUnit) -> Temperature

    Temperature::delta

    fn Temperature::delta(self : Temperature, other : Temperature) -> Double

    Temperature::fahrenheit

    fn Temperature::fahrenheit(self : Temperature) -> Double

    Temperature::kelvin

    fn Temperature::kelvin(self : Temperature) -> Double

    Temperature::shift

    fn Temperature::shift(self : Temperature, delta_kelvin : Double) -> Temperature

    Temperature::unit

    Temperature::value

    fn Temperature::value(self : Temperature) -> Double

    TemperatureUnit

    pub(all) enum TemperatureUnit {
    Celsius
    Kelvin
    Fahrenheit
    } derive(Eq, ToJson,
    Debug
    )

    Temperature scales supported by process calculations.

    TimeUnit

    pub(all) enum TimeUnit {
    Second
    Minute
    Hour
    Day
    } derive(Eq, ToJson,
    Debug
    )

    UnitInterval

    pub(all) struct UnitInterval {
    lower : Double
    upper : Double
    } derive(Eq, ToJson,
    Debug
    )

    UnitInterval::contains

    fn UnitInterval::contains(self : UnitInterval, value : Double) -> Bool

    UnitInterval::map

    fn UnitInterval::map(self : UnitInterval, value : Double, target : UnitInterval) -> Double

    UnitInterval::midpoint

    fn UnitInterval::midpoint(self : UnitInterval) -> Double

    UnitInterval::new

    UnitInterval::normalized

    fn UnitInterval::normalized(self : UnitInterval, value : Double) -> Double

    UnitInterval::width

    fn UnitInterval::width(self : UnitInterval) -> Double

    UtilityKind

    pub(all) enum UtilityKind {
    CoolingWater
    ChilledWater
    Steam
    Electricity
    CompressedAir
    Nitrogen
    } derive(Eq,
    Debug
    )

    UtilityLoad

    pub(all) struct UtilityLoad {
    name : String
    design_load : Double
    operating_load : Double
    margin : Double
    unit : String
    } derive(Eq, ToJson,
    Debug
    )

    Preliminary utility and capacity sizing helpers for early process design.

    These calculations intentionally expose assumptions and margins instead of hiding them in a single black-box equipment factor.

    Volume

    pub(all) struct Volume {
    value : Double
    unit : VolumeUnit
    } derive(Eq, ToJson,
    Debug
    )

    Volume::add

    fn Volume::add(self : Volume, other : Volume) -> Volume

    Volume::convert

    fn Volume::convert(self : Volume, unit : VolumeUnit) -> Volume

    Volume::cubic_meter

    fn Volume::cubic_meter(self : Volume) -> Double

    Volume::gallon

    fn Volume::gallon(self : Volume) -> Double

    Volume::liter

    fn Volume::liter(self : Volume) -> Double

    Volume::milliliter

    fn Volume::milliliter(self : Volume) -> Double

    Volume::value

    fn Volume::value(self : Volume) -> Double

    VolumeUnit

    pub(all) enum VolumeUnit {
    CubicMeter
    Liter
    Milliliter
    Gallon
    } derive(Eq, ToJson,
    Debug
    )

    Volumetric units for solvent and equipment sizing.

    annualized_energy

    fn annualized_energy(power : Double, operating_hours : Double, load_factor : Double) -> Double raise
    ExtractionError

    calculate_dimensionless_groups

    fn calculate_dimensionless_groups(density~ : Density, velocity_m_per_second~ : Double, diameter_meter~ : Double, viscosity~ : DynamicViscosity, diffusivity_square_meter_per_second~ : Double, surface_tension_newton_per_meter~ : Double) -> DimensionlessGroups raise
    ExtractionError

    capacity_checks_feasible

    fn capacity_checks_feasible(checks : ArrayView[CapacityCheck]) -> Bool

    capacity_checks_markdown

    fn capacity_checks_markdown(checks : ArrayView[CapacityCheck]) -> String

    capacity_checks_worst_utilization

    fn capacity_checks_worst_utilization(checks : ArrayView[CapacityCheck]) -> Double

    carbon_emissions

    fn carbon_emissions(energy : Double, emission_factor : Double) -> Double raise
    ExtractionError

    check_capacity

    fn check_capacity(name : String, required : Double, available : Double, design_margin? : Double) -> CapacityCheck raise
    ExtractionError

    chilled_water_flow

    fn chilled_water_flow(duty : Double, inlet_temperature : Double, outlet_temperature : Double, heat_capacity? : Double) -> Double raise
    ExtractionError

    compressor_power

    fn compressor_power(molar_flow : Double, inlet_temperature : Double, pressure_ratio : Double, heat_capacity_ratio : Double, efficiency : Double) -> Double raise
    ExtractionError

    concentration_from_fraction

    fn concentration_from_fraction(fraction : Double, carrier_mass : Mass) -> Concentration raise
    ExtractionError

    cooling_water_flow

    fn cooling_water_flow(duty : Double, inlet_temperature : Double, outlet_temperature : Double, heat_capacity? : Double) -> Double raise
    ExtractionError

    design_load

    fn design_load(operating_load : Double, design_margin? : Double) -> Double raise
    ExtractionError

    energy_balance_residual

    fn energy_balance_residual(inlet : Energy, outlet : Energy, duty : Energy) -> Double

    fan_power

    fn fan_power(volumetric_flow : Double, pressure_rise : Double, efficiency : Double) -> Double raise
    ExtractionError

    friction_factor_blasius

    fn friction_factor_blasius(reynolds : Double) -> Double raise
    ExtractionError

    froude_number

    fn froude_number(velocity_m_per_second~ : Double, length_meter~ : Double, gravity_m_per_second_squared? : Double) -> Double raise
    ExtractionError

    heat_transfer_coefficient

    fn heat_transfer_coefficient(nusselt~ : Double, thermal_conductivity_w_per_meter_k~ : Double, characteristic_length_meter~ : Double) -> Double raise
    ExtractionError

    latent_heat_duty

    fn latent_heat_duty(mass_flow : Double, latent_heat : Double) -> Double raise
    ExtractionError

    make_utility_load

    fn make_utility_load(name : String, operating_load : Double, margin? : Double, unit? : String) -> UtilityLoad raise
    ExtractionError

    mass_flow_concentration

    fn mass_flow_concentration(solute : MassFlow, carrier : MassFlow) -> Double

    Convert a mass flow to a concentration ratio using a common mass basis.

    mass_flow_from_volume

    fn mass_flow_from_volume(volume~ : Volume, density~ : Density, duration~ : Duration) -> MassFlow raise
    ExtractionError

    mixing_power_number

    fn mixing_power_number(power_watt~ : Double, density~ : Density, rotational_speed_per_second~ : Double, impeller_diameter_meter~ : Double) -> Double raise
    ExtractionError

    nusselt_laminar_pipe

    fn nusselt_laminar_pipe(reynolds : Double, prandtl : Double) -> Double raise
    ExtractionError

    parallel_capacity

    fn parallel_capacity(capacities : ArrayView[Double]) -> Double raise
    ExtractionError

    peclet_number

    fn peclet_number(velocity_m_per_second~ : Double, length_meter~ : Double, diffusivity_square_meter_per_second~ : Double) -> Double raise
    ExtractionError

    pipe_area

    fn pipe_area(diameter : Double) -> Double raise
    ExtractionError

    pipe_diameter_for_velocity

    fn pipe_diameter_for_velocity(volumetric_flow : Double, target_velocity : Double) -> Double raise
    ExtractionError

    pipe_pressure_drop

    fn pipe_pressure_drop(length : Double, diameter : Double, density : Double, velocity : Double, friction_factor : Double) -> Double raise
    ExtractionError

    pipe_velocity

    fn pipe_velocity(volumetric_flow : Double, diameter : Double) -> Double raise
    ExtractionError

    pressure_drop_fraction

    fn pressure_drop_fraction(inlet : Pressure, outlet : Pressure) -> Double

    pressure_drop_pipe

    fn pressure_drop_pipe(friction_factor~ : Double, length_meter~ : Double, diameter_meter~ : Double, density~ : Density, velocity_m_per_second~ : Double) -> Pressure raise
    ExtractionError

    pump_power

    fn pump_power(volumetric_flow : Double, pressure_rise : Double, efficiency : Double) -> Double raise
    ExtractionError

    residence_time_from_flow

    fn residence_time_from_flow(vessel_volume~ : Volume, volumetric_flow~ : Volume, duration~ : Duration) -> Duration raise
    ExtractionError

    Convert a volumetric flow into a residence time for a vessel.

    residence_time_from_geometry

    fn residence_time_from_geometry(vessel_volume~ : Volume, carrier_flow~ : Volume, solvent_flow~ : Volume, duration~ : Duration) -> Duration raise
    ExtractionError

    reynolds_number

    fn reynolds_number(density~ : Density, velocity_m_per_second~ : Double, diameter_meter~ : Double, viscosity~ : DynamicViscosity) -> Double raise
    ExtractionError

    schmidt_number

    fn schmidt_number(viscosity~ : DynamicViscosity, density~ : Density, diffusivity_square_meter_per_second~ : Double) -> Double raise
    ExtractionError

    sensible_heat_duty

    fn sensible_heat_duty(mass_flow : Double, heat_capacity : Double, inlet_temperature : Double, outlet_temperature : Double) -> Double raise
    ExtractionError

    series_resistance

    fn series_resistance(resistances : ArrayView[Double]) -> Double raise
    ExtractionError

    size_horizontal_tank

    fn size_horizontal_tank(working_volume : Double, surge_fraction? : Double, length_to_diameter? : Double) -> StorageSizing raise
    ExtractionError

    size_vertical_tank

    fn size_vertical_tank(working_volume : Double, surge_fraction? : Double, aspect_ratio? : Double) -> StorageSizing raise
    ExtractionError

    steam_flow

    fn steam_flow(duty : Double, latent_heat : Double, condensate_subcooling? : Double, heat_capacity? : Double) -> Double raise
    ExtractionError

    storage_volume

    fn storage_volume(flow_rate : Double, residence_time : Double, surge_fraction? : Double) -> Double raise
    ExtractionError

    temperature_rise

    fn temperature_rise(inlet : Temperature, outlet : Temperature) -> Double

    thermal_duty_from_heat_capacity

    fn thermal_duty_from_heat_capacity(mass_flow_kg_per_second~ : Double, heat_capacity_kj_per_kg_k~ : Double, inlet~ : Temperature, outlet~ : Temperature) -> Energy raise
    ExtractionError

    thermal_load_split

    fn thermal_load_split(total_duty : Double, hot_fraction : Double) -> (Double, Double) raise
    ExtractionError

    utility_cost

    fn utility_cost(consumption : Double, unit_price : Double) -> Double raise
    ExtractionError

    utility_loads_markdown

    fn utility_loads_markdown(loads : ArrayView[UtilityLoad]) -> String

    utility_loads_total

    fn utility_loads_total(loads : ArrayView[UtilityLoad]) -> Double

    utility_name

    fn utility_name(kind : UtilityKind) -> String

    volume_flow_from_mass

    fn volume_flow_from_mass(mass_flow~ : MassFlow, density~ : Density) -> Volume

    weber_number

    fn weber_number(density~ : Density, velocity_m_per_second~ : Double, length_meter~ : Double, surface_tension_newton_per_meter~ : Double) -> Double raise
    ExtractionError