ThermoState.jl icon indicating copy to clipboard operation
ThermoState.jl copied to clipboard

more mass balances, solvent balances and volume balances

Open longemen3000 opened this issue 3 years ago • 0 comments

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 avatar Oct 27 '20 02:10 longemen3000