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

Updating Phase #50

Open
commander9999 opened this issue May 26, 2023 · 1 comment
Open

Updating Phase #50

commander9999 opened this issue May 26, 2023 · 1 comment

Comments

@commander9999
Copy link

Hello Community,
I am trying to simulate an originary heatpump with sharpfluids. The pressure of evaporator and compressor is known. Starting with Point 1 (after Evaporator, before Compressor), I have saturated gas. If I check the temperature table it must be the value for Vapor, but SharpFluids always returns the value for Liquid. How can I update the fluid to gas, and later to superheated vapor after the compressor?

@MadsKirkFoged
Copy link
Owner

Hi Commander9999,

Here is an code example for a heatpump running with Ammonia.
Hope this can give you an idea of how to get started.
Feel free to ask more questions if you have any :-)

//Setting up the fluids
Fluid CompressorIn = new Fluid(FluidList.Ammonia);
Fluid CompressorOut = new Fluid(FluidList.Ammonia);

Fluid CondenserIn = new Fluid(FluidList.Ammonia);
Fluid CondenserOut = new Fluid(FluidList.Ammonia);

Fluid ExpansionValveIn = new Fluid(FluidList.Ammonia);
Fluid ExpansionValveOut = new Fluid(FluidList.Ammonia);

Fluid EvaporatorIn = new Fluid(FluidList.Ammonia);
Fluid EvaporatorOut = new Fluid(FluidList.Ammonia);

//Setting for heatpump
Pressure PEvap = Pressure.FromBar(10);
Pressure Pcond = Pressure.FromBar(20);
Temperature SuperHeat = Temperature.FromKelvins(5);

//Evap
EvaporatorIn.UpdatePX(PEvap, 0);
EvaporatorOut.UpdatePX(PEvap, 1);

 //Adding superheat to evap
EvaporatorOut.UpdatePT(EvaporatorOut.Pressure, EvaporatorOut.Temperature + SuperHeat);

//Compresser
CompressorIn.Copy(EvaporatorOut);
CompressorOut.UpdatePS(Pcond, CompressorIn.Entropy);
SpecificEnergy H2s = CompressorOut.Enthalpy;

//Compressor equation
SpecificEnergy h2 = ((H2s - CompressorIn.Enthalpy) / 0.85) + CompressorIn.Enthalpy;
CompressorOut.UpdatePH(Pcond, h2);

CondenserIn.Copy(CompressorOut);
CondenserOut.UpdatePX(CondenserIn.Pressure,0);

 ExpansionValveIn.Copy(CondenserOut);
ExpansionValveOut.UpdatePH(EvaporatorIn.Pressure, ExpansionValveIn.Enthalpy);

EvaporatorIn.Copy(ExpansionValveOut);

 //Run this in loop until it is stable

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

2 participants