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

more mass balances, solvent balances and volume balances #3

Open
3 tasks
longemen3000 opened this issue Oct 27, 2020 · 0 comments
Open
3 tasks

more mass balances, solvent balances and volume balances #3

longemen3000 opened this issue Oct 27, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed pending clear need a feature without a clear need, but useful

Comments

@longemen3000
Copy link
Owner

More mass balances, solvent balances

with MoistAir.jl i added a new Compounds type, HumiditySpec, and that spec contains an specification called "humid molar fraction". the thing with this spec is that be generalized. If we have a solution of n compounds, composed of a solvent(n[x]) and solutes (n[not(x)]), then new balances can be specified, for example:
new material amounts:

MaterialAmount(MassOfOne) 
MaterialAmount(MolesOfOne)
MaterialAmount(MassRemaining) 
MaterialAmount(MolesRemaining)

where XOfOne represents the material amount of 1 compound in a list of many (water in air), and XRemaining is the material amount of all compounds except one (for example, a list of solutes in water)
a proper interface would be by passing a Pair ( a Tuple is also reasonable, but the Pair, in my opinion, express intent: at this position there are x moles):

n = rand(5)
x = n ./ sum(n)
state(t=1,p=2,mass_of_one=1=>32.0u"kg",xn=x)

also mol fractions, mass fractions, mol numbers and mass numbers can be specified with MassOfOne,MolesOfOne,MolesRemaining,MassRemaining.
To abreviate:
mass1,moles1 = a MaterialAmount with MolesOfOne or MassOfOne
massR,molesR = a MaterialAmount with MolesRemaining or MassRemaining

Same with MaterialCompounds
now we need to view the conjugations:

  • mass1,moles1 -> xn,xm
  • massR,molesR -> xn,xm
    xn1,xm1 -> nR,mR MaterialCompounds seems to not make sense if the number of compounds > 2
    so, this is aproximately 16 new balances that can be added.

volume balances

for volume balances, you can define:
volume fraction : (MaterialCompounds{VOLUME,FRACTION} (xvols)
volume number : (MaterialCompounds{VOLUME,FRACTION} (vols)
where volume fraction is the fraction of volumes that each compound have in a mix (dont confuse with volumes before mixing, as mixing_volume != sum(volumes) )
the trickiest part is defining a correct balance here, to make a complete state specification:
xvols requires a volume amount and any material compound
- vols requires any material compound the only resolution for vols is to make the assumption of mixing volume = sum(volumes). as a state doesnt assume anything, this can't be done (in ThermoState). It can be added, but the balance machinery must another package that requires it.
in summary, those balances can be added to ThermoState, but a clear need must be found and then, look for:

  • An appropriate tuple of Type name, keyword, long name and accesor functions if necesary
  • writing the apropiate mass balances
  • in the case of xvols, find the apropiate balances. ((mass,moles) and total volume is trivial, but i dont know the rest)
@longemen3000 longemen3000 added enhancement New feature or request help wanted Extra attention is needed pending clear need a feature without a clear need, but useful labels Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed pending clear need a feature without a clear need, but useful
Projects
None yet
Development

No branches or pull requests

1 participant