Sign in

    zhaoyuanjuns/moonbit_extractor/stages does not have a README file

    AllocationPlan

    pub(all) struct AllocationPlan {
    stages : Array[StageAllocation]
    average_efficiency : Double
    minimum_efficiency : Double
    maximum_efficiency : Double
    total_transfer : Double
    balanced : Bool
    } derive(Eq, ToJson,
    Debug
    )

    EfficiencyScenario

    pub(all) struct EfficiencyScenario {
    name : String
    multiplier : Double
    recovery : Double
    required_stages : Int
    } derive(Eq, ToJson,
    Debug
    )

    EfficiencyStageResult

    pub(all) struct EfficiencyStageResult {
    steps : Array[EfficiencyStep]
    actual_stages : Double
    complete_stages : Int
    target_raffinate : Double
    feed_concentration_reached : Double
    average_efficiency : Double
    } derive(Eq, ToJson,
    Debug
    )

    EfficiencyStep

    pub(all) struct EfficiencyStep {
    stage : Int
    efficiency : Double
    raffinate_out : Double
    equilibrium_extract : Double
    actual_extract_out : Double
    raffinate_in : Double
    extract_in : Double
    equilibrium_approach : Double
    } derive(Eq, ToJson,
    Debug
    )

    ExtractionStep

    pub(all) struct ExtractionStep {
    stage : Int
    raffinate_out : Double
    extract_out : Double
    raffinate_in : Double
    extract_in : Double
    horizontal_span : Double
    } derive(Eq, ToJson,
    Debug
    )

    ProfileAlert

    pub(all) struct ProfileAlert {
    stage : Int
    code : String
    severity : String
    measured : Double
    threshold : Double
    message : String
    } derive(Eq, ToJson,
    Debug
    )

    StageAllocation

    pub(all) struct StageAllocation {
    stage : Int
    ideal_efficiency : Double
    allocated_efficiency : Double
    expected_transfer : Double
    load_fraction : Double
    adjustment : Double
    } derive(Eq, ToJson,
    Debug
    )

    Stage-efficiency allocation and capacity planning utilities.

    StageCountResult

    pub(all) struct StageCountResult {
    steps : Array[ExtractionStep]
    theoretical_stages : Double
    complete_stages : Int
    feed_concentration_reached : Double
    target_raffinate : Double
    balance_residual : Double
    } derive(Eq, ToJson,
    Debug
    )

    StageProfile

    pub(all) struct StageProfile {
    points : Array[StageProfilePoint]
    total_transfer : Double
    average_driving_force : Double
    minimum_driving_force : Double
    limiting_stage : Int
    minimum_efficiency : Double
    maximum_efficiency : Double
    } derive(Eq, ToJson,
    Debug
    )

    StageProfile::efficiency_range

    fn StageProfile::efficiency_range(self : StageProfile) -> Double

    StageProfile::stage_count

    fn StageProfile::stage_count(self : StageProfile) -> Int

    StageProfile::to_csv

    fn StageProfile::to_csv(self : StageProfile) -> String

    StageProfile::to_markdown

    fn StageProfile::to_markdown(self : StageProfile) -> String

    StageProfile::uniformity

    fn StageProfile::uniformity(self : StageProfile) -> Double

    StageProfilePoint

    pub(all) struct StageProfilePoint {
    stage : Int
    raffinate : Double
    extract : Double
    driving_force : Double
    efficiency : Double
    solute_transfer : Double
    cumulative_transfer : Double
    } derive(Eq, ToJson,
    Debug
    )

    A normalized stage profile suitable for plotting and equipment review.

    allocate_by_load

    fn allocate_by_load(ideal_efficiencies : ArrayView[Double], stage_loads : ArrayView[Double], total_efficiency : Double) -> AllocationPlan raise
    ExtractionError

    allocate_efficiency_budget

    fn allocate_efficiency_budget(stage_count~ : Int, average_efficiency~ : Double, limiting_stage~ : Int, limiting_efficiency~ : Double) -> Array[Double] raise
    ExtractionError

    allocate_uniform

    fn allocate_uniform(stage_count : Int, efficiency : Double) -> AllocationPlan raise
    ExtractionError

    allocation_adjustments

    fn allocation_adjustments(plan : AllocationPlan) -> Array[Double]

    allocation_csv

    fn allocation_csv(plan : AllocationPlan) -> String

    allocation_is_stable

    fn allocation_is_stable(plan : AllocationPlan, maximum_adjustment : Double) -> Bool

    allocation_markdown

    fn allocation_markdown(plan : AllocationPlan) -> String

    allocation_max_adjustment

    fn allocation_max_adjustment(plan : AllocationPlan) -> Double

    allocation_transfer

    fn allocation_transfer(plan : AllocationPlan) -> Array[Double]

    limiting_efficiency_scenario

    mccabe_thiele_stages

    fn mccabe_thiele_stages(equilibrium~ :
    EquilibriumTable
    , carrier_flow~ : Double, solvent_flow~ : Double, feed_concentration~ : Double, target_raffinate~ : Double, solvent_inlet_concentration? : Double, maximum_stages? : Int, tolerance? : Double) -> StageCountResult raise
    ExtractionError

    McCabe-Thiele style stepping for countercurrent liquid extraction.

    Starting at the raffinate product end, each step first reaches the equilibrium curve and then follows a stage material-balance line toward the feed. A fractional final stage is reported by linear interpolation of the last horizontal concentration span.

    operating_line

    fn operating_line(carrier_flow~ : Double, solvent_flow~ : Double, raffinate_product~ : Double, solvent_inlet~ : Double, xs : ArrayView[Double]) -> Array[
    EquilibriumPoint
    ] raise
    ExtractionError

    Build points on the overall operating line for plotting or tabulation.

    plan_rebalance

    fn plan_rebalance(plan : AllocationPlan, target_efficiency : Double) -> AllocationPlan raise
    ExtractionError

    plan_total_efficiency

    fn plan_total_efficiency(plan : AllocationPlan) -> Double

    profile_efficiency_result

    profile_transfer_fraction

    fn profile_transfer_fraction(profile : StageProfile, stage : Int) -> Double raise
    ExtractionError

    required_efficiency_for_target

    fn required_efficiency_for_target(theoretical_stages~ : Double, actual_stage_limit~ : Double) -> Double raise
    ExtractionError

    required_stages_for_efficiency

    fn required_stages_for_efficiency(target_recovery : Double, stage_efficiency : Double) -> Int raise
    ExtractionError

    review_profile

    fn review_profile(profile : StageProfile, minimum_efficiency~ : Double, minimum_driving_force~ : Double) -> Array[ProfileAlert] raise
    ExtractionError

    scenario_markdown

    fn scenario_markdown(scenarios : ArrayView[EfficiencyScenario]) -> String

    scenario_requirements

    fn scenario_requirements(names : ArrayView[String], multipliers : ArrayView[Double], target_recovery : Double, base_efficiency : Double) -> Array[EfficiencyScenario] raise
    ExtractionError

    shortcut_actual_stages

    fn shortcut_actual_stages(theoretical_stages : Double, overall_efficiency : Double) -> Double raise
    ExtractionError

    Convert ideal theoretical stages to a shortcut actual-stage estimate.

    smooth_efficiency_profile

    fn smooth_efficiency_profile(efficiencies : ArrayView[Double], window~ : Int) -> Array[Double] raise
    ExtractionError

    stages_with_efficiency_profile

    fn stages_with_efficiency_profile(equilibrium~ :
    EquilibriumTable
    , carrier_flow~ : Double, solvent_flow~ : Double, feed_concentration~ : Double, target_raffinate~ : Double, efficiencies : ArrayView[Double], solvent_inlet_concentration? : Double, tolerance? : Double) -> EfficiencyStageResult raise
    ExtractionError

    Step through a countercurrent extractor with per-stage Murphree-style extract-phase efficiencies.

    For each contact, y_actual = y_in + eta (y_equilibrium - y_in). The resulting solute transfer determines the raffinate concentration entering the next contact toward the feed end.

    stages_with_uniform_efficiency

    fn stages_with_uniform_efficiency(equilibrium~ :
    EquilibriumTable
    , carrier_flow~ : Double, solvent_flow~ : Double, feed_concentration~ : Double, target_raffinate~ : Double, efficiency~ : Double, solvent_inlet_concentration? : Double, maximum_stages? : Int, tolerance? : Double) -> EfficiencyStageResult raise
    ExtractionError

    Uniform-efficiency wrapper that allocates at most maximum_stages steps.

    validate_efficiencies

    fn validate_efficiencies(efficiencies : ArrayView[Double]) -> Bool

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io