TomLXXVI / python-hvac

A multi-package for HVAC engineering written in Python.
MIT License
51 stars 15 forks source link

No module named " No module named 'hvac.heat_exchanger.recuperator'" #9

Open MechEngr opened 2 months ago

MechEngr commented 2 months ago

Great library, thank you for sharing! I was able to install the python package, but when I can the example code from air cooling coil example 1, I get the error about the heat_exchanger.recuperator module not being available.

Could you please help?

Code snippet below:

import warnings from hvac import Quantity from hvac.fluids import HumidAir, Fluid, CoolPropWarning from hvac.heat_exchanger.recuperator.fintube.continuous_fin import ( PlainFinTubeAirToWaterCounterFlowHeatExchanger )

warnings.filterwarnings('ignore', category=CoolPropWarning)

Q_ = Quantity

TomLXXVI commented 2 months ago

I've tried to reproduce your problem, but I haven't encountered any problem. Below are the steps that I took. You need the program Poetry installed on your computer to set up the project's virtual environment. The Python IDE I use, is PyCharm Professional (version 2024.2).

  1. From the project main page on GitHub, download the project in a ZIP file on your computer (see the green button "<> Code"). The ZIP file will be named "python-hvac-master.zip".
  2. Unzip the ZIP-file "python-hvac-master.zip" on your computer. This should create a folder "python-hvac-master" on your computer, within it another folder which is also called "python-hvac-master".
  3. Copy (or cut) this last folder into your own projects directory.
  4. Open the project folder "python-hvac-master" in your projects directory with PyCharm. Normally, PyCharm will automatically detect that there is a "pyproject.toml" file present in the project folder and it will propose to setup the Poetry virtual environment for you.
  5. Accept this and when PyCharm is ready, you should be able to run the Python scripts and Jupyter notebooks in the projects docs/examples-folder.

Another possibility (after unzipping), that doesn't need Poetry (or PyCharm), could be to only copy the wheel-file "python_hvac-0.1.2-py3-none-any.whl" (i.e. the most recent version) from the "dist" folder. Create your own new project folder with an associated virtual environment and then copy-paste the wheel-file into this project folder. After activating the associated virtual environment, run "pip install python_hvac-0.1.2-py3-none-any.whl" in this folder. This will install all the dependencies in the virtual environment. After that, you can copy-paste the examples into your project folder. Normally, they should run (at least they do on my computer).

MechEngr commented 2 months ago

Hi, Tom:

Thank you so much for your response. I don't have Pycharm, but I was able to upgrade Anaconda and use Spyder to install the package. I was able to run the example without any hitches. I really appreciated the feedback you provided.

A few follow up questions on the example itself:

  1. The use case in "air_cooling_coil_01.ipynb" is focused on using water to cool air. For my use case, I also want to use air to cool water. I tried to simply update the water inlet temperature to be higher (40C) than the air inlet temperature (27C). but that did not work. The script gave me this error: "ValueError: Humid air state cannot be determined: parameter h is NaN or None." It seems this is because the script is using "humid air", whereas in a case where the water temperature is higher than the air temperature, the air would essentially be dry. Any suggestions on how to make the reverse case work?

  2. For my use case, I know the heat load as an input, along with the water inlet and outlet temperature. My unknowns are the mass flowrate and the corresponding air temperature. Do you have a script that does this version? If not, I can use your script iteratively to make it do the analysis.

Regards,

Mudasir

On Fri, Aug 16, 2024 at 3:14 AM Tom Christiaens @.***> wrote:

I've tried to reproduce your problem, but I haven't encountered any problem. Below are the steps that I took. You need the program Poetry installed on your computer to set up the project's virtual environment. The Python IDE I use, is PyCharm Professional (version 2024.2).

  1. From the project main page on GitHub, download the project in a ZIP file on your computer (see the green button "<> Code"). The ZIP file will be named "python-hvac-master.zip".
  2. Unzip the ZIP-file "python-hvac-master.zip" on your computer. This should create a folder "python-hvac-master" on your computer, within it another folder which is also called "python-hvac-master".
  3. Copy (or cut) this last folder into your own projects directory.
  4. Open the project folder "python-hvac-master" in your projects directory with PyCharm. Normally, PyCharm will automatically detect that there is a "pyproject.toml" file present in the project folder and it will propose to setup the Poetry virtual environment for you.
  5. Accept this and when PyCharm is ready, you should be able to run the Python scripts and Jupyter notebooks in the projects docs/examples-folder.

Another possibility (after unzipping), that doesn't need Poetry (or PyCharm), could be to only copy the wheel-file "python_hvac-0.1.2-py3-none-any.whl" (i.e. the most recent version) from the "dist" folder. Create your own new project folder with an associated virtual environment and then copy-paste the wheel-file into this project folder. After activating the associated virtual environment, run "pip install python_hvac-0.1.2-py3-none-any.whl" in this folder. This will install all the dependencies in the virtual environment. After that, you can copy-paste the examples into your project folder. Normally, they should run (at least they do on my computer).

— Reply to this email directly, view it on GitHub https://github.com/TomLXXVI/python-hvac/issues/9#issuecomment-2293236059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNSKBZI5GN22N67GWJB3MLZRXGJNAVCNFSM6AAAAABMRHETUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTGIZTMMBVHE . You are receiving this because you authored the thread.Message ID: @.***>