Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add residual implementation for visocisities #4

Open
daklauss opened this issue Jul 2, 2024 · 3 comments
Open

Add residual implementation for visocisities #4

daklauss opened this issue Jul 2, 2024 · 3 comments

Comments

@daklauss
Copy link
Member

daklauss commented Jul 2, 2024

In GitLab by @schmoelder on Jul 2, 2024, 15:13

There are different models for calculating viscosities, see also Wikipedia.

At first, we will start with a simple Arrhenius model

Arrhenius

$$ \ln \eta_{mix} = \sum_{i=1}^{N} x_{i} \ln \eta_{i} $$

where $\eta_{mix}$ is the viscosity of the liquid mixture, $\eta_{i}$ is the viscosity for fluid component $i$ when flowing as a pure fluid, and $x_{i}$ is the molar fraction of component $i$ in the liquid mixture.

Note, this requires knowing the viscosities for each component of the mixture. To simplify this, we will at first make the following assumptions:

  • Dissolved components (i.e. salts, proteins, sugars etc) are highly diluted (low concentration) and do not contribute to the mixture's viscosity. Consequently, we will only consider the solvent's (e.g. water / EtOH) viscosity.
  • Missing: How to justify x_i = Q_i/Q_tot (see below)

Then, we can also formulate the mixing viscosity of different streams as such:

$$ \ln \eta_{mix, u} = \sum_{j=1}^{N_{inlets}} \frac{Q_{j}}{Q_{total}} \ln \eta_{j} $$

where $\eta_{mix, u}$ is the viscosity of the liquid mixture entering unit operation $u$, $\eta_{j}$ is the viscosity of the liquid leaving the upstream unit operation $j$, and $Q_{j}$ is the flow rate of that unit operation flowing into unit operation $u$.

$$ Q_{total} = \sum_{j=1}^{N_{inlets}} Q_j $$

While we already understand how to calculate this on system level (when coupling unit operations), we still don't know how to implement this in residual form for the unit operation. Maybe @AntoniaBerger can help us? :nerd:

@daklauss
Copy link
Member Author

daklauss commented Jul 3, 2024

In GitLab by @schmoelder on Jul 3, 2024, 09:48

This comment serves to summarize the following assumption:

$$ \frac{Q_j}{Q_{total}} = x_i $$

As reminder, we use the following indices:

  • $i$: component
  • $j$: upstream unit operation

When mixing two streams with different flow rates $Q_i$, we assume that the volumetric fraction is proportional to the molar fraction.

Implicitly, this means that

  • densities of both streams are identical
  • molar masses of both solvents are identical

First, the molar fraction $x_j$ is defined as

$$ x_j = \frac{n_j}{\sum_l n_l} = \frac{n_j}{\sum_l n_l} $$

with:
$$
n_{total} = \sum_j^{N_{inlets}} n_j
$$

$$ \rho_j = m_j / V $$

$$ M_j = m_j / n_j $$

$$ Q_j = dV / dt $$


$$x_j = \frac{m_j/M_j}{\sum_j m_j/M_j}$$

$$x_i = \frac{(\rho_i * V)/M_i}{\sum_j (\rho_i * V)/M_j}$$

hier: noch nicht ganz sicher... hehe

$$x_i = \frac{(\rho_i * Q)/M_i}{\sum_j (\rho_i * Q)/M_j}$$

@daklauss
Copy link
Member Author

daklauss commented Jul 5, 2024

In GitLab by @AntoniaBerger on Jul 5, 2024, 09:50

Some people tend to work with volume fraction rather than flow fraction.
(1)
With that the mixture from two inlets (CASE 1) and the mixture from the bulk mix with one inlet (CASE 2) would have the same viscosity:

CASE 1:

  • Inlet 1: with velociy $\eta_1 = 1$, Volume $V_1 = 1$
  • Inlet 2: with velociy $\eta_2 = 2$, Volume $V_2 = 1$

$\Rightarrow$

  • Volume fraction: $V_1/(V_1+V_2) = V_2/(V_1+V_2) = 0.5$
  • $ln(\eta_{mix1}) = 0.5\ln(2) + 0.5\ln(1) = \ln(\sqrt{2})$

CASE 2:

  • Inlet 1: with velociy $\eta_1 = 1$, Volume $V_1 = 1$
  • CSTR: with velociy $\eta_2 = 2$, Volume $V_2 = 1$

$\Rightarrow$

  • Volume fraction: $V_1/(V_1+V_2) = V_2/(V_1+V_2) = 0.5$
  • $ln(\eta_{mix2}) = 0.5\ln(2) + 0.5\ln(1) = \ln(\sqrt{2})$

This way we could model the viscosity as a funktion of volume over time and not directly over time.

Maybe this makes sense...

@daklauss
Copy link
Member Author

daklauss commented Jul 8, 2024

In GitLab by @AntoniaBerger on Jul 8, 2024, 10:53

More (but not total) generel:

For CASE 2: CSTR ($\eta_2$) and one Inlet ($\eta_2$):

For $t=0$ we have:

$$ln(\eta_{mix}^{(0)}) = \phi_1^{(0)} ln(\eta_1) + \phi_2^{(0)} ln(\eta_2)$$

with

$$ \phi_j^{(0)} = \frac{V^{0}_j}{V^{(0)}_1 + V^{(0)}_2} $$

And $t=1$ we have:

$$ln(\eta_{mix}^{(1)}) = \phi_1^{(1)} ln(\eta_1) + \phi_2^{(1)} ln(\eta_{mix}^{(0)})$$

So we have for a iteration step $t = i$:

$$ln(\eta_{mix}^{(i)}) = \phi_1^{(i)} ln(\eta_1) + \phi_2^{(i)} ln(\eta_{mix}^{(i-1)})$$

If we interpret the last equation as an $ith$ euler method step ( i.e $y_{i} = y_{i-1} + f(t^{(i-1)},y_{i-1})$ ) from an unknown differential equation ( i.e $\dot{y} = f(t,y)$ ) we
see that the equation correspond to a constant "ODE" ( $\dot{y} = c(t)$ ).
Which can be solved by integretaion.
This leads me to the assumption that we don't need a differential equation discribing velocity for the CSTR unit. Instead we get a DAE with one addtionally algebraic equation for velocity.

@schmoelder , @d.klauss what do you think? Do you agree with me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant