Skip to content

Commit

Permalink
feat(Granulator): Add residual moisture of granules
Browse files Browse the repository at this point in the history
  • Loading branch information
vasylskorych committed Jul 11, 2024
1 parent d20dbd1 commit 35c4c6b
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 46 deletions.
46 changes: 36 additions & 10 deletions Documentation/003_models/unit_granulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ Continuous granulator
\dot{m}_{out} = \dot{m}_{in} + \dot{m}_{e}
.. math::
\dot{m}_{in,liq} = (1 - K_{os}) \cdot \dot{m}_{sus,liq} + \dot{m}_{nuc,liq} + \dot{m}_{gas,liq}
.. math::
\dot{m}_{gran,liq} =
\begin{cases}
u_{moist} \cdot \dot{m}_{out} & u_{moist} \cdot \dot{m}_{out} \leq \dot{m}_{in,liq} \\
\dot{m}_{in,liq} & u_{moist} \cdot \dot{m}_{out} > \dot{m}_{in,liq} \\
\end{cases}
.. math::
\dot{m}_{dust} = \dot{m}_{s,susp}\cdot K_{os} + (\dot{m}_{susp} - \dot{m}_{s,susp} + \dot{m}_{fl,g})
\dot{m}_{dust} = \dot{m}_{s,susp}\cdot K_{os} + (\dot{m}_{susp} - \dot{m}_{s,susp} + \dot{m}_{fl,g} - \dot{m}_{gran,liq})
Batch granulator
^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -93,8 +105,20 @@ Batch granulator

:math:`\dot{m}_{e}` – effective mass stream of the injected suspension

:math:`\dot{m}_{gran,liq}` – liquid mass flow leaving the granulator with granules

:math:`\dot{m}_{in,liq}` – total effective mass flow of liquid

:math:`\dot{m}_{sus,liq}` – mass flow of the liquid phase in the **Suspension** inlet

:math:`\dot{m}_{nuc,liq}` – mass flow of the liquid phase in the **ExternalNuclei** inlet

:math:`\dot{m}_{gas,liq}` – mass flow of the liquid phase in the **FluidizationGas** inlet

:math:`M_{tot}` – holdup mass

:math:`u_{moist}` – moisture content of granules (dry basis)

:math:`\rho_{s,susp}` – density of solids in the holdup

:math:`G_{e}` – effective growth rate
Expand All @@ -109,15 +133,17 @@ Batch granulator

.. note:: Input parameters needed for the simulation:

+------+-----------------+----------------------------------------+-------+--------------+
| Name | Symbol | Description | Units | Boundaries |
+======+=================+========================================+=======+==============+
| Kos | :math:`K_{os}` | Overspray part in the suspension | [--] | 0 ≤ Kos ≤ 1 |
+------+-----------------+----------------------------------------+-------+--------------+
| RTol | -- | Relative tolerance for equation solver | [--] | 0 < RTol ≤ 1 |
+------+-----------------+----------------------------------------+-------+--------------+
| ATol | -- | Absolute tolerance for equation solver | [--] | 0 < ATol ≤ 1 |
+------+-----------------+----------------------------------------+-------+--------------+
+---------------------------+-------------------+------------------------------------------+-------+------------------------+
| Name | Symbol | Description | Units | Boundaries |
+===========================+===================+==========================================+=======+========================+
| Kos | :math:`K_{os}` | Overspray part in the suspension | [--] | 0 ≤ :math:`K_{os}` ≤ 1 |
+---------------------------+-------------------+------------------------------------------+-------+------------------------+
| Granules moisture content | :math:`u_{moist}` | Moisture content of granules (dry basis) | [--] | 0 ≤ :math:`u_{moist}` |
+---------------------------+-------------------+------------------------------------------+-------+------------------------+
| Relative tolerance | -- | Relative tolerance for equation solver | [--] | 0 < RTol ≤ 1 |
+---------------------------+-------------------+------------------------------------------+-------+------------------------+
| Absolute tolerance | -- | Absolute tolerance for equation solver | [--] | 0 < ATol ≤ 1 |
+---------------------------+-------------------+------------------------------------------+-------+------------------------+


.. note:: State variables:
Expand Down
19 changes: 15 additions & 4 deletions Units/Granulator/Granulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void CSimpleGranulator::CreateStructure()

/// Add unit parameters ///
AddTDParameter ("Kos" , 0.0, "-", "Overspray part of solution" , 0.0, 1.0);
AddTDParameter("Granules moisture content", 0.0, "-", "Residual moisture content in granules on a dry basis", 0.0);
AddConstRealParameter("Relative tolerance", 0.0, "-", "Solver relative tolerance. Set to 0 to use flowsheet-wide value", 0 );
AddConstRealParameter("Absolute tolerance", 0.0, "-", "Solver absolute tolerance. Set to 0 to use flowsheet-wide value", 0 );

Expand Down Expand Up @@ -125,12 +126,17 @@ void CUnitDAEModel::ResultsHandler(double _time, double* _vars, double* _ders, v

const double mSolut = unit->m_inSolutStream->GetPhaseMassFlow(_time, EPhase::SOLID); // Mass flow of solid phase in solution for current time
const double Kos = unit->GetTDParameterValue("Kos", _time); // Overspray part in solution for current time
const double moistureContent = unit->GetTDParameterValue("Granules moisture content", _time); // Moisture content of output granules [kg(liq)/kg(sol)]
const double me = mSolut * (1 - Kos); // Effective mass stream of the injected solution for current time
const double totLiqMass = (1 - Kos) * unit->m_inSolutStream->GetPhaseMassFlow(_time, EPhase::LIQUID) + unit->m_inNuclStream->GetPhaseMassFlow(_time, EPhase::LIQUID) + unit->m_inGasStream->GetPhaseMassFlow(_time, EPhase::LIQUID);
const double mInNucl = unit->m_inNuclStream->GetPhaseMassFlow(_time, EPhase::SOLID); // Mass of input nuclei - solid part
const double mOutTemp = mInNucl + me;

const double dustMass = _vars[m_iMdust];

// Output mass flow of liquid in the granules
const double moistureMassFlow = ClampR(moistureContent * mOutTemp, totLiqMass);

unit->m_holdup->AddTimePoint(_time);

std::vector<double> temp(unit->m_classesNum, 0);
Expand All @@ -153,9 +159,9 @@ void CUnitDAEModel::ResultsHandler(double _time, double* _vars, double* _ders, v

unit->m_holdup->SetMass(_time, holdupMass);

unit->m_outNuclStream->CopyFromHoldup(_time, unit->m_holdup, mOutTemp);
unit->m_outNuclStream->SetPhaseFraction(_time, EPhase::SOLID, 1);
unit->m_outNuclStream->SetPhaseFraction(_time, EPhase::LIQUID, 0);
unit->m_outNuclStream->CopyFromHoldup(_time, unit->m_holdup, mOutTemp + moistureMassFlow);
unit->m_outNuclStream->SetPhaseFraction(_time, EPhase::SOLID, mOutTemp / (mOutTemp + moistureMassFlow));
unit->m_outNuclStream->SetPhaseFraction(_time, EPhase::LIQUID, moistureMassFlow / (mOutTemp + moistureMassFlow));
unit->m_outNuclStream->SetPhaseFraction(_time, EPhase::VAPOR, 0);

unit->m_outDustStream->CopyFromHoldup(_time, unit->m_holdup, unit->m_holdup->GetMass(_time));
Expand Down Expand Up @@ -188,7 +194,9 @@ void CUnitDAEModel::CalculateResiduals(double _time, double* _vars, double* _der
const double mSusp = unit->m_inSolutStream->GetPhaseMassFlow(_time, EPhase::SOLID); // Mass flow of solid phase in solution for current time
const double mNotSol = unit->m_inSolutStream->GetMassFlow(_time) - mSusp; // Mass flow of all phases except solid in solution for current time
const double Kos = unit->GetTDParameterValue("Kos", _time); // Overspray part in solution for current time
const double moistureContent = unit->GetTDParameterValue("Granules moisture content", _time); // Moisture content of output granules [kg(liq)/kg(sol)]
const double me = mSusp * (1 - Kos); // Effective mass stream of the injected solution for current time
const double totLiqMass = (1 - Kos) * unit->m_inSolutStream->GetPhaseMassFlow(_time, EPhase::LIQUID) + unit->m_inNuclStream->GetPhaseMassFlow(_time, EPhase::LIQUID) + unit->m_inGasStream->GetPhaseMassFlow(_time, EPhase::LIQUID);
const double solutSolDens = unit->m_inSolutStream->GetPhaseProperty(_time, EPhase::SOLID, DENSITY); // Density of the solid in the solution
const double mInNucl = unit->m_inNuclStream->GetPhaseMassFlow(_time, EPhase::SOLID); // Mass of input nuclei - solid part
const double mInNuclNotSol = unit->m_inNuclStream->GetMassFlow(_time) - mInNucl; // Mass of input nuclei - not solid part
Expand All @@ -206,8 +214,11 @@ void CUnitDAEModel::CalculateResiduals(double _time, double* _vars, double* _der
// Output mass flow of nuclei (MOut)
_res[m_iMout] = mOut - (mInNucl + me);

// Output mass flow of liquid in the granules
const double moistureMassFlow = ClampR(moistureContent * mOut, totLiqMass);

// Output mass flow of dust (MDust)
_res[m_iMdust] = mDust - (mInNuclNotSol + mSusp*Kos + mNotSol + totGasMass);
_res[m_iMdust] = mDust - (mInNuclNotSol + mSusp*Kos + mNotSol + totGasMass - moistureMassFlow);

// Growth rate (G)
if (ATot != 0)
Expand Down
Loading

0 comments on commit 35c4c6b

Please sign in to comment.