Skip to content

Add flooding#1

Open
ibell wants to merge 74 commits intoibell:masterfrom
davideziviani:AddFlooding
Open

Add flooding#1
ibell wants to merge 74 commits intoibell:masterfrom
davideziviani:AddFlooding

Conversation

@ibell
Copy link
Owner

@ibell ibell commented Apr 25, 2015

No description provided.

dziviani added 2 commits April 21, 2015 10:42
Create a new StateFlooded class derived from CoolProp State class
@ibell
Copy link
Owner Author

ibell commented Apr 25, 2015

In FloodState, you should almost never be calling PropsSI, you should always try to call self.pAS.keyed_output instead

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not do it like this, you should call

self.pAS.keyed_output(iTcrit)

@ibell
Copy link
Owner Author

ibell commented May 7, 2015

You need to implement all the methods of the base class - get_T, get_p, etc. You'll notice that in the pdsim code, we call the get_T, get_rho.. methods in order to not need to pass at all into the python layer. If you don't implement these functions, it will call the base class function, which is not what you want at all.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST(!) derive from State class. That is the whole point.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, better to name StateFlooded - that is more standard. Class definitions should be CamelCase, without underscores.

@ibell
Copy link
Owner Author

ibell commented May 7, 2015

You should try to get your code to compile now. You will need to add your file in setup.py (in the list of pyx files).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do it like this - in the init function for the class you need to create the pointer to the AbstractState as is done in the State class in CoolProp. Otherwise this makes a local definition for HEOS which is definitely not what you want.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is necessary to define p_crit and T_crit within StateFlooded class, since it can be called from PDSim directly from AbstractState class.

@ibell ibell mentioned this pull request Jun 19, 2016
ibell pushed a commit that referenced this pull request Apr 23, 2020
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

Successfully merging this pull request may close these issues.

3 participants