repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
ssalentin/plip | plip/modules/preparation.py | Ligand.find_charged | def find_charged(self, all_atoms):
"""Identify all positively charged groups in a ligand. This search is not exhaustive, as the cases can be quite
diverse. The typical cases seem to be protonated amines, quaternary ammoinium and sulfonium
as mentioned in 'Cation-pi interactions in ligand recogni... | python | def find_charged(self, all_atoms):
"""Identify all positively charged groups in a ligand. This search is not exhaustive, as the cases can be quite
diverse. The typical cases seem to be protonated amines, quaternary ammoinium and sulfonium
as mentioned in 'Cation-pi interactions in ligand recogni... | [
"def",
"find_charged",
"(",
"self",
",",
"all_atoms",
")",
":",
"data",
"=",
"namedtuple",
"(",
"'lcharge'",
",",
"'atoms orig_atoms atoms_orig_idx type center fgroup'",
")",
"a_set",
"=",
"[",
"]",
"for",
"a",
"in",
"all_atoms",
":",
"a_orig_idx",
"=",
"self",
... | Identify all positively charged groups in a ligand. This search is not exhaustive, as the cases can be quite
diverse. The typical cases seem to be protonated amines, quaternary ammoinium and sulfonium
as mentioned in 'Cation-pi interactions in ligand recognition and catalysis' (Zacharias et al., 2002)).... | [
"Identify",
"all",
"positively",
"charged",
"groups",
"in",
"a",
"ligand",
".",
"This",
"search",
"is",
"not",
"exhaustive",
"as",
"the",
"cases",
"can",
"be",
"quite",
"diverse",
".",
"The",
"typical",
"cases",
"seem",
"to",
"be",
"protonated",
"amines",
... | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1131-L1195 |
ssalentin/plip | plip/modules/preparation.py | Ligand.find_metal_binding | def find_metal_binding(self, lig_atoms, water_oxygens):
"""Looks for atoms that could possibly be involved in binding a metal ion.
This can be any water oxygen, as well as oxygen from carboxylate, phophoryl, phenolate, alcohol;
nitrogen from imidazole; sulfur from thiolate.
"""
a... | python | def find_metal_binding(self, lig_atoms, water_oxygens):
"""Looks for atoms that could possibly be involved in binding a metal ion.
This can be any water oxygen, as well as oxygen from carboxylate, phophoryl, phenolate, alcohol;
nitrogen from imidazole; sulfur from thiolate.
"""
a... | [
"def",
"find_metal_binding",
"(",
"self",
",",
"lig_atoms",
",",
"water_oxygens",
")",
":",
"a_set",
"=",
"[",
"]",
"data",
"=",
"namedtuple",
"(",
"'metal_binding'",
",",
"'atom orig_atom atom_orig_idx type fgroup restype resnr reschain location'",
")",
"for",
"oxygen"... | Looks for atoms that could possibly be involved in binding a metal ion.
This can be any water oxygen, as well as oxygen from carboxylate, phophoryl, phenolate, alcohol;
nitrogen from imidazole; sulfur from thiolate. | [
"Looks",
"for",
"atoms",
"that",
"could",
"possibly",
"be",
"involved",
"in",
"binding",
"a",
"metal",
"ion",
".",
"This",
"can",
"be",
"any",
"water",
"oxygen",
"as",
"well",
"as",
"oxygen",
"from",
"carboxylate",
"phophoryl",
"phenolate",
"alcohol",
";",
... | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1197-L1263 |
ssalentin/plip | plip/modules/preparation.py | PDBComplex.load_pdb | def load_pdb(self, pdbpath, as_string=False):
"""Loads a pdb file with protein AND ligand(s), separates and prepares them.
If specified 'as_string', the input is a PDB string instead of a path."""
if as_string:
self.sourcefiles['pdbcomplex.original'] = None
self.sourcefil... | python | def load_pdb(self, pdbpath, as_string=False):
"""Loads a pdb file with protein AND ligand(s), separates and prepares them.
If specified 'as_string', the input is a PDB string instead of a path."""
if as_string:
self.sourcefiles['pdbcomplex.original'] = None
self.sourcefil... | [
"def",
"load_pdb",
"(",
"self",
",",
"pdbpath",
",",
"as_string",
"=",
"False",
")",
":",
"if",
"as_string",
":",
"self",
".",
"sourcefiles",
"[",
"'pdbcomplex.original'",
"]",
"=",
"None",
"self",
".",
"sourcefiles",
"[",
"'pdbcomplex'",
"]",
"=",
"None",... | Loads a pdb file with protein AND ligand(s), separates and prepares them.
If specified 'as_string', the input is a PDB string instead of a path. | [
"Loads",
"a",
"pdb",
"file",
"with",
"protein",
"AND",
"ligand",
"(",
"s",
")",
"separates",
"and",
"prepares",
"them",
".",
"If",
"specified",
"as_string",
"the",
"input",
"is",
"a",
"PDB",
"string",
"instead",
"of",
"a",
"path",
"."
] | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1294-L1377 |
ssalentin/plip | plip/modules/preparation.py | PDBComplex.characterize_complex | def characterize_complex(self, ligand):
"""Handles all basic functions for characterizing the interactions for one ligand"""
single_sites = []
for member in ligand.members:
single_sites.append(':'.join([str(x) for x in member]))
site = ' + '.join(single_sites)
site =... | python | def characterize_complex(self, ligand):
"""Handles all basic functions for characterizing the interactions for one ligand"""
single_sites = []
for member in ligand.members:
single_sites.append(':'.join([str(x) for x in member]))
site = ' + '.join(single_sites)
site =... | [
"def",
"characterize_complex",
"(",
"self",
",",
"ligand",
")",
":",
"single_sites",
"=",
"[",
"]",
"for",
"member",
"in",
"ligand",
".",
"members",
":",
"single_sites",
".",
"append",
"(",
"':'",
".",
"join",
"(",
"[",
"str",
"(",
"x",
")",
"for",
"... | Handles all basic functions for characterizing the interactions for one ligand | [
"Handles",
"all",
"basic",
"functions",
"for",
"characterizing",
"the",
"interactions",
"for",
"one",
"ligand"
] | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1384-L1440 |
ssalentin/plip | plip/modules/preparation.py | PDBComplex.extract_bs | def extract_bs(self, cutoff, ligcentroid, resis):
"""Return list of ids from residues belonging to the binding site"""
return [obres.GetIdx() for obres in resis if self.res_belongs_to_bs(obres, cutoff, ligcentroid)] | python | def extract_bs(self, cutoff, ligcentroid, resis):
"""Return list of ids from residues belonging to the binding site"""
return [obres.GetIdx() for obres in resis if self.res_belongs_to_bs(obres, cutoff, ligcentroid)] | [
"def",
"extract_bs",
"(",
"self",
",",
"cutoff",
",",
"ligcentroid",
",",
"resis",
")",
":",
"return",
"[",
"obres",
".",
"GetIdx",
"(",
")",
"for",
"obres",
"in",
"resis",
"if",
"self",
".",
"res_belongs_to_bs",
"(",
"obres",
",",
"cutoff",
",",
"ligc... | Return list of ids from residues belonging to the binding site | [
"Return",
"list",
"of",
"ids",
"from",
"residues",
"belonging",
"to",
"the",
"binding",
"site"
] | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1442-L1444 |
ssalentin/plip | plip/modules/preparation.py | PDBComplex.res_belongs_to_bs | def res_belongs_to_bs(self, res, cutoff, ligcentroid):
"""Check for each residue if its centroid is within a certain distance to the ligand centroid.
Additionally checks if a residue belongs to a chain restricted by the user (e.g. by defining a peptide chain)"""
rescentroid = centroid([(atm.x(),... | python | def res_belongs_to_bs(self, res, cutoff, ligcentroid):
"""Check for each residue if its centroid is within a certain distance to the ligand centroid.
Additionally checks if a residue belongs to a chain restricted by the user (e.g. by defining a peptide chain)"""
rescentroid = centroid([(atm.x(),... | [
"def",
"res_belongs_to_bs",
"(",
"self",
",",
"res",
",",
"cutoff",
",",
"ligcentroid",
")",
":",
"rescentroid",
"=",
"centroid",
"(",
"[",
"(",
"atm",
".",
"x",
"(",
")",
",",
"atm",
".",
"y",
"(",
")",
",",
"atm",
".",
"z",
"(",
")",
")",
"fo... | Check for each residue if its centroid is within a certain distance to the ligand centroid.
Additionally checks if a residue belongs to a chain restricted by the user (e.g. by defining a peptide chain) | [
"Check",
"for",
"each",
"residue",
"if",
"its",
"centroid",
"is",
"within",
"a",
"certain",
"distance",
"to",
"the",
"ligand",
"centroid",
".",
"Additionally",
"checks",
"if",
"a",
"residue",
"belongs",
"to",
"a",
"chain",
"restricted",
"by",
"the",
"user",
... | train | https://github.com/ssalentin/plip/blob/906c8d36463689779b403f6c2c9ed06174acaf9a/plip/modules/preparation.py#L1446-L1454 |
ella/ella | ella/core/context_processors.py | url_info | def url_info(request):
"""
Make MEDIA_URL and current HttpRequest object
available in template code.
"""
return {
'MEDIA_URL' : core_settings.MEDIA_URL,
'STATIC_URL': core_settings.STATIC_URL,
'VERSION' : core_settings.VERSION,
'SERVER_INFO' : core_settings.SERVER_IN... | python | def url_info(request):
"""
Make MEDIA_URL and current HttpRequest object
available in template code.
"""
return {
'MEDIA_URL' : core_settings.MEDIA_URL,
'STATIC_URL': core_settings.STATIC_URL,
'VERSION' : core_settings.VERSION,
'SERVER_INFO' : core_settings.SERVER_IN... | [
"def",
"url_info",
"(",
"request",
")",
":",
"return",
"{",
"'MEDIA_URL'",
":",
"core_settings",
".",
"MEDIA_URL",
",",
"'STATIC_URL'",
":",
"core_settings",
".",
"STATIC_URL",
",",
"'VERSION'",
":",
"core_settings",
".",
"VERSION",
",",
"'SERVER_INFO'",
":",
... | Make MEDIA_URL and current HttpRequest object
available in template code. | [
"Make",
"MEDIA_URL",
"and",
"current",
"HttpRequest",
"object",
"available",
"in",
"template",
"code",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/context_processors.py#L9-L22 |
ella/ella | ella/core/middleware.py | UpdateCacheMiddleware.process_response | def process_response(self, request, response):
"""Sets the cache, if needed."""
# never cache headers + ETag
add_never_cache_headers(response)
if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
# We don't need to update the cache, just return... | python | def process_response(self, request, response):
"""Sets the cache, if needed."""
# never cache headers + ETag
add_never_cache_headers(response)
if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
# We don't need to update the cache, just return... | [
"def",
"process_response",
"(",
"self",
",",
"request",
",",
"response",
")",
":",
"# never cache headers + ETag",
"add_never_cache_headers",
"(",
"response",
")",
"if",
"not",
"hasattr",
"(",
"request",
",",
"'_cache_update_cache'",
")",
"or",
"not",
"request",
"... | Sets the cache, if needed. | [
"Sets",
"the",
"cache",
"if",
"needed",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/middleware.py#L85-L111 |
ella/ella | ella/core/middleware.py | FetchFromCacheMiddleware.process_request | def process_request(self, request):
"""
Checks whether the page is already cached and returns the cached
version if available.
"""
if self.cache_anonymous_only:
assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True req... | python | def process_request(self, request):
"""
Checks whether the page is already cached and returns the cached
version if available.
"""
if self.cache_anonymous_only:
assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True req... | [
"def",
"process_request",
"(",
"self",
",",
"request",
")",
":",
"if",
"self",
".",
"cache_anonymous_only",
":",
"assert",
"hasattr",
"(",
"request",
",",
"'user'",
")",
",",
"\"The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication mi... | Checks whether the page is already cached and returns the cached
version if available. | [
"Checks",
"whether",
"the",
"page",
"is",
"already",
"cached",
"and",
"returns",
"the",
"cached",
"version",
"if",
"available",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/middleware.py#L128-L166 |
ella/ella | ella/core/managers.py | RelatedManager.collect_related | def collect_related(self, finder_funcs, obj, count, *args, **kwargs):
"""
Collects objects related to ``obj`` using a list of ``finder_funcs``.
Stops when required count is collected or the function list is
exhausted.
"""
collected = []
for func in finder_funcs:
... | python | def collect_related(self, finder_funcs, obj, count, *args, **kwargs):
"""
Collects objects related to ``obj`` using a list of ``finder_funcs``.
Stops when required count is collected or the function list is
exhausted.
"""
collected = []
for func in finder_funcs:
... | [
"def",
"collect_related",
"(",
"self",
",",
"finder_funcs",
",",
"obj",
",",
"count",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"collected",
"=",
"[",
"]",
"for",
"func",
"in",
"finder_funcs",
":",
"gathered",
"=",
"func",
"(",
"obj",
",",... | Collects objects related to ``obj`` using a list of ``finder_funcs``.
Stops when required count is collected or the function list is
exhausted. | [
"Collects",
"objects",
"related",
"to",
"obj",
"using",
"a",
"list",
"of",
"finder_funcs",
".",
"Stops",
"when",
"required",
"count",
"is",
"collected",
"or",
"the",
"function",
"list",
"is",
"exhausted",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/managers.py#L83-L97 |
ella/ella | ella/core/managers.py | RelatedManager.get_related_for_object | def get_related_for_object(self, obj, count, finder=None, mods=[], only_from_same_site=True):
"""
Returns at most ``count`` publishable objects related to ``obj`` using
named related finder ``finder``.
If only specific type of publishable is prefered, use ``mods`` attribute
to l... | python | def get_related_for_object(self, obj, count, finder=None, mods=[], only_from_same_site=True):
"""
Returns at most ``count`` publishable objects related to ``obj`` using
named related finder ``finder``.
If only specific type of publishable is prefered, use ``mods`` attribute
to l... | [
"def",
"get_related_for_object",
"(",
"self",
",",
"obj",
",",
"count",
",",
"finder",
"=",
"None",
",",
"mods",
"=",
"[",
"]",
",",
"only_from_same_site",
"=",
"True",
")",
":",
"return",
"self",
".",
"collect_related",
"(",
"self",
".",
"_get_finders",
... | Returns at most ``count`` publishable objects related to ``obj`` using
named related finder ``finder``.
If only specific type of publishable is prefered, use ``mods`` attribute
to list required classes.
Finally, use ``only_from_same_site`` if you don't want cross-site
content.
... | [
"Returns",
"at",
"most",
"count",
"publishable",
"objects",
"related",
"to",
"obj",
"using",
"named",
"related",
"finder",
"finder",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/managers.py#L123-L138 |
ella/ella | ella/core/managers.py | ListingManager.get_listing | def get_listing(self, category=None, children=ListingHandler.NONE, count=10, offset=0, content_types=[], date_range=(), exclude=None, **kwargs):
"""
Get top objects for given category and potentionally also its child categories.
Params:
category - Category object to list objects for... | python | def get_listing(self, category=None, children=ListingHandler.NONE, count=10, offset=0, content_types=[], date_range=(), exclude=None, **kwargs):
"""
Get top objects for given category and potentionally also its child categories.
Params:
category - Category object to list objects for... | [
"def",
"get_listing",
"(",
"self",
",",
"category",
"=",
"None",
",",
"children",
"=",
"ListingHandler",
".",
"NONE",
",",
"count",
"=",
"10",
",",
"offset",
"=",
"0",
",",
"content_types",
"=",
"[",
"]",
",",
"date_range",
"=",
"(",
")",
",",
"exclu... | Get top objects for given category and potentionally also its child categories.
Params:
category - Category object to list objects for. None if any category will do
count - number of objects to output, defaults to 10
offset - starting with object number... 1-based
... | [
"Get",
"top",
"objects",
"for",
"given",
"category",
"and",
"potentionally",
"also",
"its",
"child",
"categories",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/managers.py#L258-L306 |
ella/ella | ella/core/templatetags/pagination.py | paginator | def paginator(context, adjacent_pages=2, template_name=None):
"""
Renders a ``inclusion_tags/paginator.html`` or ``inc/paginator.html``
template with additional pagination context. To be used in conjunction
with the ``object_list`` generic
view.
If ``TEMPLATE_NAME`` parameter is given,
``in... | python | def paginator(context, adjacent_pages=2, template_name=None):
"""
Renders a ``inclusion_tags/paginator.html`` or ``inc/paginator.html``
template with additional pagination context. To be used in conjunction
with the ``object_list`` generic
view.
If ``TEMPLATE_NAME`` parameter is given,
``in... | [
"def",
"paginator",
"(",
"context",
",",
"adjacent_pages",
"=",
"2",
",",
"template_name",
"=",
"None",
")",
":",
"tname",
",",
"context",
"=",
"_do_paginator",
"(",
"context",
",",
"adjacent_pages",
",",
"template_name",
")",
"return",
"render_to_string",
"("... | Renders a ``inclusion_tags/paginator.html`` or ``inc/paginator.html``
template with additional pagination context. To be used in conjunction
with the ``object_list`` generic
view.
If ``TEMPLATE_NAME`` parameter is given,
``inclusion_tags/paginator_TEMPLATE_NAME.html`` or
``inc/paginator_TEMPLA... | [
"Renders",
"a",
"inclusion_tags",
"/",
"paginator",
".",
"html",
"or",
"inc",
"/",
"paginator",
".",
"html",
"template",
"with",
"additional",
"pagination",
"context",
".",
"To",
"be",
"used",
"in",
"conjunction",
"with",
"the",
"object_list",
"generic",
"view... | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/templatetags/pagination.py#L45-L75 |
ella/ella | ella/core/templatetags/authors.py | do_author_listing | def do_author_listing(parser, token):
"""
Get N listing objects that were published by given author recently and optionally
omit a publishable object in results.
**Usage**::
{% author_listing <author> <limit> as <result> [omit <obj>] %}
**Parameters**::
===========================... | python | def do_author_listing(parser, token):
"""
Get N listing objects that were published by given author recently and optionally
omit a publishable object in results.
**Usage**::
{% author_listing <author> <limit> as <result> [omit <obj>] %}
**Parameters**::
===========================... | [
"def",
"do_author_listing",
"(",
"parser",
",",
"token",
")",
":",
"contents",
"=",
"token",
".",
"split_contents",
"(",
")",
"if",
"len",
"(",
"contents",
")",
"not",
"in",
"[",
"5",
",",
"7",
"]",
":",
"raise",
"template",
".",
"TemplateSyntaxError",
... | Get N listing objects that were published by given author recently and optionally
omit a publishable object in results.
**Usage**::
{% author_listing <author> <limit> as <result> [omit <obj>] %}
**Parameters**::
================================== =========================================... | [
"Get",
"N",
"listing",
"objects",
"that",
"were",
"published",
"by",
"given",
"author",
"recently",
"and",
"optionally",
"omit",
"a",
"publishable",
"object",
"in",
"results",
"."
] | train | https://github.com/ella/ella/blob/4a1414991f649dc21c4b777dc6b41a922a13faa7/ella/core/templatetags/authors.py#L40-L72 |
jjgomera/iapws | iapws/iapws08.py | _Tb | def _Tb(P, S):
"""Procedure to calculate the boiling temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tb : float
Boiling temperature, [K]
References
----------
IAPWS, Advisory Note ... | python | def _Tb(P, S):
"""Procedure to calculate the boiling temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tb : float
Boiling temperature, [K]
References
----------
IAPWS, Advisory Note ... | [
"def",
"_Tb",
"(",
"P",
",",
"S",
")",
":",
"def",
"f",
"(",
"T",
")",
":",
"pw",
"=",
"_Region1",
"(",
"T",
",",
"P",
")",
"gw",
"=",
"pw",
"[",
"\"h\"",
"]",
"-",
"T",
"*",
"pw",
"[",
"\"s\"",
"]",
"pv",
"=",
"_Region2",
"(",
"T",
","... | Procedure to calculate the boiling temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tb : float
Boiling temperature, [K]
References
----------
IAPWS, Advisory Note No. 5: Industrial Calc... | [
"Procedure",
"to",
"calculate",
"the",
"boiling",
"temperature",
"of",
"seawater"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L408-L439 |
jjgomera/iapws | iapws/iapws08.py | _Tf | def _Tf(P, S):
"""Procedure to calculate the freezing temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tf : float
Freezing temperature, [K]
References
----------
IAPWS, Advisory Not... | python | def _Tf(P, S):
"""Procedure to calculate the freezing temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tf : float
Freezing temperature, [K]
References
----------
IAPWS, Advisory Not... | [
"def",
"_Tf",
"(",
"P",
",",
"S",
")",
":",
"def",
"f",
"(",
"T",
")",
":",
"T",
"=",
"float",
"(",
"T",
")",
"pw",
"=",
"_Region1",
"(",
"T",
",",
"P",
")",
"gw",
"=",
"pw",
"[",
"\"h\"",
"]",
"-",
"T",
"*",
"pw",
"[",
"\"s\"",
"]",
... | Procedure to calculate the freezing temperature of seawater
Parameters
----------
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Tf : float
Freezing temperature, [K]
References
----------
IAPWS, Advisory Note No. 5: Industrial Ca... | [
"Procedure",
"to",
"calculate",
"the",
"freezing",
"temperature",
"of",
"seawater"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L442-L473 |
jjgomera/iapws | iapws/iapws08.py | _Triple | def _Triple(S):
"""Procedure to calculate the triple point pressure and temperature for
seawater
Parameters
----------
S : float
Salinity, [kg/kg]
Returns
-------
prop : dict
Dictionary with the triple point properties:
* Tt: Triple point temperature, [K]
... | python | def _Triple(S):
"""Procedure to calculate the triple point pressure and temperature for
seawater
Parameters
----------
S : float
Salinity, [kg/kg]
Returns
-------
prop : dict
Dictionary with the triple point properties:
* Tt: Triple point temperature, [K]
... | [
"def",
"_Triple",
"(",
"S",
")",
":",
"def",
"f",
"(",
"parr",
")",
":",
"T",
",",
"P",
"=",
"parr",
"pw",
"=",
"_Region1",
"(",
"T",
",",
"P",
")",
"gw",
"=",
"pw",
"[",
"\"h\"",
"]",
"-",
"T",
"*",
"pw",
"[",
"\"s\"",
"]",
"pv",
"=",
... | Procedure to calculate the triple point pressure and temperature for
seawater
Parameters
----------
S : float
Salinity, [kg/kg]
Returns
-------
prop : dict
Dictionary with the triple point properties:
* Tt: Triple point temperature, [K]
* Pt: Triple... | [
"Procedure",
"to",
"calculate",
"the",
"triple",
"point",
"pressure",
"and",
"temperature",
"for",
"seawater"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L476-L516 |
jjgomera/iapws | iapws/iapws08.py | _OsmoticPressure | def _OsmoticPressure(T, P, S):
"""Procedure to calculate the osmotic pressure of seawater
Parameters
----------
T : float
Tmperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Posm : float
Osmotic pressure, [MPa]
... | python | def _OsmoticPressure(T, P, S):
"""Procedure to calculate the osmotic pressure of seawater
Parameters
----------
T : float
Tmperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Posm : float
Osmotic pressure, [MPa]
... | [
"def",
"_OsmoticPressure",
"(",
"T",
",",
"P",
",",
"S",
")",
":",
"pw",
"=",
"_Region1",
"(",
"T",
",",
"P",
")",
"gw",
"=",
"pw",
"[",
"\"h\"",
"]",
"-",
"T",
"*",
"pw",
"[",
"\"s\"",
"]",
"def",
"f",
"(",
"Posm",
")",
":",
"pw2",
"=",
... | Procedure to calculate the osmotic pressure of seawater
Parameters
----------
T : float
Tmperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
Posm : float
Osmotic pressure, [MPa]
References
----------
IAPWS, ... | [
"Procedure",
"to",
"calculate",
"the",
"osmotic",
"pressure",
"of",
"seawater"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L519-L551 |
jjgomera/iapws | iapws/iapws08.py | _ThCond_SeaWater | def _ThCond_SeaWater(T, P, S):
"""Equation for the thermal conductivity of seawater
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
k : float
Thermal conductivity excess relative ... | python | def _ThCond_SeaWater(T, P, S):
"""Equation for the thermal conductivity of seawater
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
k : float
Thermal conductivity excess relative ... | [
"def",
"_ThCond_SeaWater",
"(",
"T",
",",
"P",
",",
"S",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"273.15",
"or",
"T",
">",
"523.15",
"or",
"P",
"<",
"0",
"or",
"P",
">",
"140",
"or",
"S",
"<",
"0",
"or",
"S",
">",
"0.17",
":",
"ra... | Equation for the thermal conductivity of seawater
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
S : float
Salinity, [kg/kg]
Returns
-------
k : float
Thermal conductivity excess relative to that of the pure water, [W/mK]
... | [
"Equation",
"for",
"the",
"thermal",
"conductivity",
"of",
"seawater"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L554-L606 |
jjgomera/iapws | iapws/iapws08.py | _solNa2SO4 | def _solNa2SO4(T, mH2SO4, mNaCl):
"""Equation for the solubility of sodium sulfate in aqueous mixtures of
sodium chloride and sulfuric acid
Parameters
----------
T : float
Temperature, [K]
mH2SO4 : float
Molality of sufuric acid, [mol/kg(water)]
mNaCl : float
Molalit... | python | def _solNa2SO4(T, mH2SO4, mNaCl):
"""Equation for the solubility of sodium sulfate in aqueous mixtures of
sodium chloride and sulfuric acid
Parameters
----------
T : float
Temperature, [K]
mH2SO4 : float
Molality of sufuric acid, [mol/kg(water)]
mNaCl : float
Molalit... | [
"def",
"_solNa2SO4",
"(",
"T",
",",
"mH2SO4",
",",
"mNaCl",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"523.15",
"or",
"T",
">",
"623.15",
"or",
"mH2SO4",
"<",
"0",
"or",
"mH2SO4",
">",
"0.75",
"or",
"mNaCl",
"<",
"0",
"or",
"mNaCl",
">",
... | Equation for the solubility of sodium sulfate in aqueous mixtures of
sodium chloride and sulfuric acid
Parameters
----------
T : float
Temperature, [K]
mH2SO4 : float
Molality of sufuric acid, [mol/kg(water)]
mNaCl : float
Molality of sodium chloride, [mol/kg(water)]
... | [
"Equation",
"for",
"the",
"solubility",
"of",
"sodium",
"sulfate",
"in",
"aqueous",
"mixtures",
"of",
"sodium",
"chloride",
"and",
"sulfuric",
"acid"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L609-L663 |
jjgomera/iapws | iapws/iapws08.py | _critNaCl | def _critNaCl(x):
"""Equation for the critical locus of aqueous solutions of sodium chloride
Parameters
----------
x : float
Mole fraction of NaCl, [-]
Returns
-------
prop : dict
A dictionary withe the properties:
* Tc: critical temperature, [K]
* ... | python | def _critNaCl(x):
"""Equation for the critical locus of aqueous solutions of sodium chloride
Parameters
----------
x : float
Mole fraction of NaCl, [-]
Returns
-------
prop : dict
A dictionary withe the properties:
* Tc: critical temperature, [K]
* ... | [
"def",
"_critNaCl",
"(",
"x",
")",
":",
"# Check input parameters",
"if",
"x",
"<",
"0",
"or",
"x",
">",
"0.12",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"T1",
"=",
"Tc",
"*",
"(",
"1",
"+",
"2.3e1",
"*",
"x",
"-",
"3... | Equation for the critical locus of aqueous solutions of sodium chloride
Parameters
----------
x : float
Mole fraction of NaCl, [-]
Returns
-------
prop : dict
A dictionary withe the properties:
* Tc: critical temperature, [K]
* Pc: critical pressure, [M... | [
"Equation",
"for",
"the",
"critical",
"locus",
"of",
"aqueous",
"solutions",
"of",
"sodium",
"chloride"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L666-L725 |
jjgomera/iapws | iapws/iapws08.py | SeaWater.calculo | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
P = self.kwargs["P"]
S = self.kwargs["S"]
self.m = S/(1-S)/Ms
if self.kwargs["fast"] and T <= 313.15:
pw = self._waterSupp(T, P)
elif self.kwargs["IF97"]:
pw = self._waterIF... | python | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
P = self.kwargs["P"]
S = self.kwargs["S"]
self.m = S/(1-S)/Ms
if self.kwargs["fast"] and T <= 313.15:
pw = self._waterSupp(T, P)
elif self.kwargs["IF97"]:
pw = self._waterIF... | [
"def",
"calculo",
"(",
"self",
")",
":",
"T",
"=",
"self",
".",
"kwargs",
"[",
"\"T\"",
"]",
"P",
"=",
"self",
".",
"kwargs",
"[",
"\"P\"",
"]",
"S",
"=",
"self",
".",
"kwargs",
"[",
"\"S\"",
"]",
"self",
".",
"m",
"=",
"S",
"/",
"(",
"1",
... | Calculate procedure | [
"Calculate",
"procedure"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L178-L236 |
jjgomera/iapws | iapws/iapws08.py | SeaWater._water | def _water(cls, T, P):
"""Get properties of pure water, Table4 pag 8"""
water = IAPWS95(P=P, T=T)
prop = {}
prop["g"] = water.h-T*water.s
prop["gt"] = -water.s
prop["gp"] = 1./water.rho
prop["gtt"] = -water.cp/T
prop["gtp"] = water.betas*water.cp/T
... | python | def _water(cls, T, P):
"""Get properties of pure water, Table4 pag 8"""
water = IAPWS95(P=P, T=T)
prop = {}
prop["g"] = water.h-T*water.s
prop["gt"] = -water.s
prop["gp"] = 1./water.rho
prop["gtt"] = -water.cp/T
prop["gtp"] = water.betas*water.cp/T
... | [
"def",
"_water",
"(",
"cls",
",",
"T",
",",
"P",
")",
":",
"water",
"=",
"IAPWS95",
"(",
"P",
"=",
"P",
",",
"T",
"=",
"T",
")",
"prop",
"=",
"{",
"}",
"prop",
"[",
"\"g\"",
"]",
"=",
"water",
".",
"h",
"-",
"T",
"*",
"water",
".",
"s",
... | Get properties of pure water, Table4 pag 8 | [
"Get",
"properties",
"of",
"pure",
"water",
"Table4",
"pag",
"8"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L244-L257 |
jjgomera/iapws | iapws/iapws08.py | SeaWater._waterSupp | def _waterSupp(cls, T, P):
"""Get properties of pure water using the supplementary release SR7-09,
Table4 pag 6"""
tau = (T-273.15)/40
pi = (P-0.101325)/100
J = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5,... | python | def _waterSupp(cls, T, P):
"""Get properties of pure water using the supplementary release SR7-09,
Table4 pag 6"""
tau = (T-273.15)/40
pi = (P-0.101325)/100
J = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5,... | [
"def",
"_waterSupp",
"(",
"cls",
",",
"T",
",",
"P",
")",
":",
"tau",
"=",
"(",
"T",
"-",
"273.15",
")",
"/",
"40",
"pi",
"=",
"(",
"P",
"-",
"0.101325",
")",
"/",
"100",
"J",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
... | Get properties of pure water using the supplementary release SR7-09,
Table4 pag 6 | [
"Get",
"properties",
"of",
"pure",
"water",
"using",
"the",
"supplementary",
"release",
"SR7",
"-",
"09",
"Table4",
"pag",
"6"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L275-L323 |
jjgomera/iapws | iapws/iapws08.py | SeaWater._saline | def _saline(cls, T, P, S):
"""Eq 4"""
# Check input in range of validity
if T <= 261 or T > 353 or P <= 0 or P > 100 or S < 0 or S > 0.12:
warnings.warn("Incoming out of bound")
S_ = 0.03516504*40/35
X = (S/S_)**0.5
tau = (T-273.15)/40
pi = (P-0.1013... | python | def _saline(cls, T, P, S):
"""Eq 4"""
# Check input in range of validity
if T <= 261 or T > 353 or P <= 0 or P > 100 or S < 0 or S > 0.12:
warnings.warn("Incoming out of bound")
S_ = 0.03516504*40/35
X = (S/S_)**0.5
tau = (T-273.15)/40
pi = (P-0.1013... | [
"def",
"_saline",
"(",
"cls",
",",
"T",
",",
"P",
",",
"S",
")",
":",
"# Check input in range of validity",
"if",
"T",
"<=",
"261",
"or",
"T",
">",
"353",
"or",
"P",
"<=",
"0",
"or",
"P",
">",
"100",
"or",
"S",
"<",
"0",
"or",
"S",
">",
"0.12",... | Eq 4 | [
"Eq",
"4"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws08.py#L326-L405 |
jjgomera/iapws | iapws/iapws95.py | _phir | def _phir(tau, delta, coef):
"""Residual contribution to the adimensional free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
coef : dict
Dictionary with equation of state parameters
... | python | def _phir(tau, delta, coef):
"""Residual contribution to the adimensional free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
coef : dict
Dictionary with equation of state parameters
... | [
"def",
"_phir",
"(",
"tau",
",",
"delta",
",",
"coef",
")",
":",
"fir",
"=",
"0",
"# Polinomial terms",
"nr1",
"=",
"coef",
".",
"get",
"(",
"\"nr1\"",
",",
"[",
"]",
")",
"d1",
"=",
"coef",
".",
"get",
"(",
"\"d1\"",
",",
"[",
"]",
")",
"t1",
... | Residual contribution to the adimensional free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
coef : dict
Dictionary with equation of state parameters
Returns
-------
fir : flo... | [
"Residual",
"contribution",
"to",
"the",
"adimensional",
"free",
"Helmholtz",
"energy"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L28-L96 |
jjgomera/iapws | iapws/iapws95.py | mainClassDoc | def mainClassDoc():
"""Function decorator used to automatic adiction of base class MEoS in
subclass __doc__"""
def decorator(f):
# __doc__ is only writable in python3.
# The doc build must be done with python3 so this snnippet do the work
py_version = platform.python_version()
... | python | def mainClassDoc():
"""Function decorator used to automatic adiction of base class MEoS in
subclass __doc__"""
def decorator(f):
# __doc__ is only writable in python3.
# The doc build must be done with python3 so this snnippet do the work
py_version = platform.python_version()
... | [
"def",
"mainClassDoc",
"(",
")",
":",
"def",
"decorator",
"(",
"f",
")",
":",
"# __doc__ is only writable in python3.",
"# The doc build must be done with python3 so this snnippet do the work",
"py_version",
"=",
"platform",
".",
"python_version",
"(",
")",
"if",
"py_versio... | Function decorator used to automatic adiction of base class MEoS in
subclass __doc__ | [
"Function",
"decorator",
"used",
"to",
"automatic",
"adiction",
"of",
"base",
"class",
"MEoS",
"in",
"subclass",
"__doc__"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2195-L2217 |
jjgomera/iapws | iapws/iapws95.py | MEoS.calculable | def calculable(self):
"""Check if inputs are enough to define state"""
self._mode = ""
if self.kwargs["T"] and self.kwargs["P"]:
self._mode = "TP"
elif self.kwargs["T"] and self.kwargs["rho"]:
self._mode = "Trho"
elif self.kwargs["T"] and self.kwargs["h"] ... | python | def calculable(self):
"""Check if inputs are enough to define state"""
self._mode = ""
if self.kwargs["T"] and self.kwargs["P"]:
self._mode = "TP"
elif self.kwargs["T"] and self.kwargs["rho"]:
self._mode = "Trho"
elif self.kwargs["T"] and self.kwargs["h"] ... | [
"def",
"calculable",
"(",
"self",
")",
":",
"self",
".",
"_mode",
"=",
"\"\"",
"if",
"self",
".",
"kwargs",
"[",
"\"T\"",
"]",
"and",
"self",
".",
"kwargs",
"[",
"\"P\"",
"]",
":",
"self",
".",
"_mode",
"=",
"\"TP\"",
"elif",
"self",
".",
"kwargs",... | Check if inputs are enough to define state | [
"Check",
"if",
"inputs",
"are",
"enough",
"to",
"define",
"state"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L434-L471 |
jjgomera/iapws | iapws/iapws95.py | MEoS.calculo | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
rho = self.kwargs["rho"]
P = self.kwargs["P"]
s = self.kwargs["s"]
h = self.kwargs["h"]
u = self.kwargs["u"]
x = self.kwargs["x"]
# Initial values
T0 = self.kwargs["T0"]
... | python | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
rho = self.kwargs["rho"]
P = self.kwargs["P"]
s = self.kwargs["s"]
h = self.kwargs["h"]
u = self.kwargs["u"]
x = self.kwargs["x"]
# Initial values
T0 = self.kwargs["T0"]
... | [
"def",
"calculo",
"(",
"self",
")",
":",
"T",
"=",
"self",
".",
"kwargs",
"[",
"\"T\"",
"]",
"rho",
"=",
"self",
".",
"kwargs",
"[",
"\"rho\"",
"]",
"P",
"=",
"self",
".",
"kwargs",
"[",
"\"P\"",
"]",
"s",
"=",
"self",
".",
"kwargs",
"[",
"\"s\... | Calculate procedure | [
"Calculate",
"procedure"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L473-L1477 |
jjgomera/iapws | iapws/iapws95.py | MEoS.fill | def fill(self, fase, estado):
"""Fill phase properties"""
fase.rho = estado["rho"]
fase.v = 1/fase.rho
fase.h = estado["h"]
fase.s = estado["s"]
fase.u = fase.h-self.P*1000*fase.v
fase.a = fase.u-self.T*fase.s
fase.g = fase.h-self.T*fase.s
fase.Z... | python | def fill(self, fase, estado):
"""Fill phase properties"""
fase.rho = estado["rho"]
fase.v = 1/fase.rho
fase.h = estado["h"]
fase.s = estado["s"]
fase.u = fase.h-self.P*1000*fase.v
fase.a = fase.u-self.T*fase.s
fase.g = fase.h-self.T*fase.s
fase.Z... | [
"def",
"fill",
"(",
"self",
",",
"fase",
",",
"estado",
")",
":",
"fase",
".",
"rho",
"=",
"estado",
"[",
"\"rho\"",
"]",
"fase",
".",
"v",
"=",
"1",
"/",
"fase",
".",
"rho",
"fase",
".",
"h",
"=",
"estado",
"[",
"\"h\"",
"]",
"fase",
".",
"s... | Fill phase properties | [
"Fill",
"phase",
"properties"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1479-L1555 |
jjgomera/iapws | iapws/iapws95.py | MEoS.derivative | def derivative(self, z, x, y, fase):
"""Wrapper derivative for custom derived properties
where x, y, z can be: P, T, v, rho, u, h, s, g, a"""
return deriv_H(self, z, x, y, fase) | python | def derivative(self, z, x, y, fase):
"""Wrapper derivative for custom derived properties
where x, y, z can be: P, T, v, rho, u, h, s, g, a"""
return deriv_H(self, z, x, y, fase) | [
"def",
"derivative",
"(",
"self",
",",
"z",
",",
"x",
",",
"y",
",",
"fase",
")",
":",
"return",
"deriv_H",
"(",
"self",
",",
"z",
",",
"x",
",",
"y",
",",
"fase",
")"
] | Wrapper derivative for custom derived properties
where x, y, z can be: P, T, v, rho, u, h, s, g, a | [
"Wrapper",
"derivative",
"for",
"custom",
"derived",
"properties",
"where",
"x",
"y",
"z",
"can",
"be",
":",
"P",
"T",
"v",
"rho",
"u",
"h",
"s",
"g",
"a"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1557-L1560 |
jjgomera/iapws | iapws/iapws95.py | MEoS._saturation | def _saturation(self, T):
"""Saturation calculation for two phase search"""
rhoc = self._constants.get("rhoref", self.rhoc)
Tc = self._constants.get("Tref", self.Tc)
if T > Tc:
T = Tc
tau = Tc/T
rhoLo = self._Liquid_Density(T)
rhoGo = self._Vapor_Den... | python | def _saturation(self, T):
"""Saturation calculation for two phase search"""
rhoc = self._constants.get("rhoref", self.rhoc)
Tc = self._constants.get("Tref", self.Tc)
if T > Tc:
T = Tc
tau = Tc/T
rhoLo = self._Liquid_Density(T)
rhoGo = self._Vapor_Den... | [
"def",
"_saturation",
"(",
"self",
",",
"T",
")",
":",
"rhoc",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"rhoref\"",
",",
"self",
".",
"rhoc",
")",
"Tc",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"Tref\"",
",",
"self",
".",
"Tc",
... | Saturation calculation for two phase search | [
"Saturation",
"calculation",
"for",
"two",
"phase",
"search"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1562-L1598 |
jjgomera/iapws | iapws/iapws95.py | MEoS._Helmholtz | def _Helmholtz(self, rho, T):
"""Calculated properties from helmholtz free energy and derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictionary wit... | python | def _Helmholtz(self, rho, T):
"""Calculated properties from helmholtz free energy and derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictionary wit... | [
"def",
"_Helmholtz",
"(",
"self",
",",
"rho",
",",
"T",
")",
":",
"if",
"isinstance",
"(",
"rho",
",",
"ndarray",
")",
":",
"rho",
"=",
"rho",
"[",
"0",
"]",
"if",
"isinstance",
"(",
"T",
",",
"ndarray",
")",
":",
"T",
"=",
"T",
"[",
"0",
"]"... | Calculated properties from helmholtz free energy and derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictionary with calculated properties:
... | [
"Calculated",
"properties",
"from",
"helmholtz",
"free",
"energy",
"and",
"derivatives"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1600-L1671 |
jjgomera/iapws | iapws/iapws95.py | MEoS._prop0 | def _prop0(self, rho, T):
"""Ideal gas properties"""
rhoc = self._constants.get("rhoref", self.rhoc)
Tc = self._constants.get("Tref", self.Tc)
delta = rho/rhoc
tau = Tc/T
ideal = self._phi0(tau, delta)
fio = ideal["fio"]
fiot = ideal["fiot"]
fiott ... | python | def _prop0(self, rho, T):
"""Ideal gas properties"""
rhoc = self._constants.get("rhoref", self.rhoc)
Tc = self._constants.get("Tref", self.Tc)
delta = rho/rhoc
tau = Tc/T
ideal = self._phi0(tau, delta)
fio = ideal["fio"]
fiot = ideal["fiot"]
fiott ... | [
"def",
"_prop0",
"(",
"self",
",",
"rho",
",",
"T",
")",
":",
"rhoc",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"rhoref\"",
",",
"self",
".",
"rhoc",
")",
"Tc",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"Tref\"",
",",
"self",
".... | Ideal gas properties | [
"Ideal",
"gas",
"properties"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1673-L1691 |
jjgomera/iapws | iapws/iapws95.py | MEoS._phi0 | def _phi0(self, tau, delta):
"""Ideal gas Helmholtz free energy and derivatives
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dictionary ... | python | def _phi0(self, tau, delta):
"""Ideal gas Helmholtz free energy and derivatives
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dictionary ... | [
"def",
"_phi0",
"(",
"self",
",",
"tau",
",",
"delta",
")",
":",
"Fi0",
"=",
"self",
".",
"Fi0",
"fio",
"=",
"Fi0",
"[",
"\"ao_log\"",
"]",
"[",
"0",
"]",
"*",
"log",
"(",
"delta",
")",
"+",
"Fi0",
"[",
"\"ao_log\"",
"]",
"[",
"1",
"]",
"*",
... | Ideal gas Helmholtz free energy and derivatives
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dictionary with ideal adimensional helmholtz energy... | [
"Ideal",
"gas",
"Helmholtz",
"free",
"energy",
"and",
"derivatives"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1693-L1756 |
jjgomera/iapws | iapws/iapws95.py | MEoS._phir | def _phir(self, tau, delta):
"""Residual contribution to the free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dict
... | python | def _phir(self, tau, delta):
"""Residual contribution to the free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dict
... | [
"def",
"_phir",
"(",
"self",
",",
"tau",
",",
"delta",
")",
":",
"fir",
"=",
"fird",
"=",
"firdd",
"=",
"firt",
"=",
"firtt",
"=",
"firdt",
"=",
"0",
"# Polinomial terms",
"nr1",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"nr1\"",
",",
"[",... | Residual contribution to the free Helmholtz energy
Parameters
----------
tau : float
Inverse reduced temperature Tc/T, [-]
delta : float
Reduced density rho/rhoc, [-]
Returns
-------
prop : dict
Dictionary with residual adimensi... | [
"Residual",
"contribution",
"to",
"the",
"free",
"Helmholtz",
"energy"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1758-L1890 |
jjgomera/iapws | iapws/iapws95.py | MEoS._virial | def _virial(self, T):
"""Virial coefficient
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with residual adimensional helmholtz energy:
* B: ∂fir/∂δ|δ->0
* C: ∂²fir/∂... | python | def _virial(self, T):
"""Virial coefficient
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with residual adimensional helmholtz energy:
* B: ∂fir/∂δ|δ->0
* C: ∂²fir/∂... | [
"def",
"_virial",
"(",
"self",
",",
"T",
")",
":",
"Tc",
"=",
"self",
".",
"_constants",
".",
"get",
"(",
"\"Tref\"",
",",
"self",
".",
"Tc",
")",
"tau",
"=",
"Tc",
"/",
"T",
"B",
"=",
"C",
"=",
"0",
"delta",
"=",
"1e-200",
"# Polinomial terms",
... | Virial coefficient
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with residual adimensional helmholtz energy:
* B: ∂fir/∂δ|δ->0
* C: ∂²fir/∂δ²|δ->0 | [
"Virial",
"coefficient"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1892-L1978 |
jjgomera/iapws | iapws/iapws95.py | MEoS._derivDimensional | def _derivDimensional(self, rho, T):
"""Calcule the dimensional form or Helmholtz free energy derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictio... | python | def _derivDimensional(self, rho, T):
"""Calcule the dimensional form or Helmholtz free energy derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictio... | [
"def",
"_derivDimensional",
"(",
"self",
",",
"rho",
",",
"T",
")",
":",
"if",
"not",
"rho",
":",
"prop",
"=",
"{",
"}",
"prop",
"[",
"\"fir\"",
"]",
"=",
"0",
"prop",
"[",
"\"firt\"",
"]",
"=",
"0",
"prop",
"[",
"\"fird\"",
"]",
"=",
"0",
"pro... | Calcule the dimensional form or Helmholtz free energy derivatives
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dictionary with residual helmholtz energy and derivati... | [
"Calcule",
"the",
"dimensional",
"form",
"or",
"Helmholtz",
"free",
"energy",
"derivatives"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L1980-L2047 |
jjgomera/iapws | iapws/iapws95.py | MEoS._surface | def _surface(self, T):
"""Generic equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
-----
Need a _surf dict in the derived cla... | python | def _surface(self, T):
"""Generic equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
-----
Need a _surf dict in the derived cla... | [
"def",
"_surface",
"(",
"self",
",",
"T",
")",
":",
"tau",
"=",
"1",
"-",
"T",
"/",
"self",
".",
"Tc",
"sigma",
"=",
"0",
"for",
"n",
",",
"t",
"in",
"zip",
"(",
"self",
".",
"_surf",
"[",
"\"sigma\"",
"]",
",",
"self",
".",
"_surf",
"[",
"... | Generic equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
-----
Need a _surf dict in the derived class with the parameters keys:
... | [
"Generic",
"equation",
"for",
"the",
"surface",
"tension"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2049-L2072 |
jjgomera/iapws | iapws/iapws95.py | MEoS._Vapor_Pressure | def _Vapor_Pressure(cls, T):
"""Auxiliary equation for the vapour pressure
Parameters
----------
T : float
Temperature, [K]
Returns
-------
Pv : float
Vapour pressure, [Pa]
References
----------
IAPWS, Revised Sup... | python | def _Vapor_Pressure(cls, T):
"""Auxiliary equation for the vapour pressure
Parameters
----------
T : float
Temperature, [K]
Returns
-------
Pv : float
Vapour pressure, [Pa]
References
----------
IAPWS, Revised Sup... | [
"def",
"_Vapor_Pressure",
"(",
"cls",
",",
"T",
")",
":",
"Tita",
"=",
"1",
"-",
"T",
"/",
"cls",
".",
"Tc",
"suma",
"=",
"0",
"for",
"n",
",",
"x",
"in",
"zip",
"(",
"cls",
".",
"_Pv",
"[",
"\"ao\"",
"]",
",",
"cls",
".",
"_Pv",
"[",
"\"ex... | Auxiliary equation for the vapour pressure
Parameters
----------
T : float
Temperature, [K]
Returns
-------
Pv : float
Vapour pressure, [Pa]
References
----------
IAPWS, Revised Supplementary Release on Saturation Propert... | [
"Auxiliary",
"equation",
"for",
"the",
"vapour",
"pressure"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2075-L2100 |
jjgomera/iapws | iapws/iapws95.py | MEoS._Liquid_Density | def _Liquid_Density(cls, T):
"""Auxiliary equation for the density of saturated liquid
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated liquid density, [kg/m³]
References
----------
... | python | def _Liquid_Density(cls, T):
"""Auxiliary equation for the density of saturated liquid
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated liquid density, [kg/m³]
References
----------
... | [
"def",
"_Liquid_Density",
"(",
"cls",
",",
"T",
")",
":",
"eq",
"=",
"cls",
".",
"_rhoL",
"[",
"\"eq\"",
"]",
"Tita",
"=",
"1",
"-",
"T",
"/",
"cls",
".",
"Tc",
"if",
"eq",
"==",
"2",
":",
"Tita",
"=",
"Tita",
"**",
"(",
"1.",
"/",
"3",
")"... | Auxiliary equation for the density of saturated liquid
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated liquid density, [kg/m³]
References
----------
IAPWS, Revised Supplementary Rele... | [
"Auxiliary",
"equation",
"for",
"the",
"density",
"of",
"saturated",
"liquid"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2103-L2131 |
jjgomera/iapws | iapws/iapws95.py | MEoS._Vapor_Density | def _Vapor_Density(cls, T):
"""Auxiliary equation for the density of saturated vapor
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated vapor density, [kg/m³]
References
----------
... | python | def _Vapor_Density(cls, T):
"""Auxiliary equation for the density of saturated vapor
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated vapor density, [kg/m³]
References
----------
... | [
"def",
"_Vapor_Density",
"(",
"cls",
",",
"T",
")",
":",
"eq",
"=",
"cls",
".",
"_rhoG",
"[",
"\"eq\"",
"]",
"Tita",
"=",
"1",
"-",
"T",
"/",
"cls",
".",
"Tc",
"if",
"eq",
"==",
"4",
":",
"Tita",
"=",
"Tita",
"**",
"(",
"1.",
"/",
"3",
")",... | Auxiliary equation for the density of saturated vapor
Parameters
----------
T : float
Temperature, [K]
Returns
-------
rho : float
Saturated vapor density, [kg/m³]
References
----------
IAPWS, Revised Supplementary Releas... | [
"Auxiliary",
"equation",
"for",
"the",
"density",
"of",
"saturated",
"vapor"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2134-L2162 |
jjgomera/iapws | iapws/iapws95.py | MEoS._dPdT_sat | def _dPdT_sat(cls, T):
"""Auxiliary equation for the dP/dT along saturation line
Parameters
----------
T : float
Temperature, [K]
Returns
-------
dPdT : float
dPdT, [MPa/K]
References
----------
IAPWS, Revised Sup... | python | def _dPdT_sat(cls, T):
"""Auxiliary equation for the dP/dT along saturation line
Parameters
----------
T : float
Temperature, [K]
Returns
-------
dPdT : float
dPdT, [MPa/K]
References
----------
IAPWS, Revised Sup... | [
"def",
"_dPdT_sat",
"(",
"cls",
",",
"T",
")",
":",
"Tita",
"=",
"1",
"-",
"T",
"/",
"cls",
".",
"Tc",
"suma1",
"=",
"0",
"suma2",
"=",
"0",
"for",
"n",
",",
"x",
"in",
"zip",
"(",
"cls",
".",
"_Pv",
"[",
"\"ao\"",
"]",
",",
"cls",
".",
"... | Auxiliary equation for the dP/dT along saturation line
Parameters
----------
T : float
Temperature, [K]
Returns
-------
dPdT : float
dPdT, [MPa/K]
References
----------
IAPWS, Revised Supplementary Release on Saturation P... | [
"Auxiliary",
"equation",
"for",
"the",
"dP",
"/",
"dT",
"along",
"saturation",
"line"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws95.py#L2165-L2192 |
jjgomera/iapws | iapws/humidAir.py | _virial | def _virial(T):
"""Virial equations for humid air
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with critical coefficient:
* Baa: Second virial coefficient of dry air, [m³/mol]
* Baw: Second air-water cross v... | python | def _virial(T):
"""Virial equations for humid air
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with critical coefficient:
* Baa: Second virial coefficient of dry air, [m³/mol]
* Baw: Second air-water cross v... | [
"def",
"_virial",
"(",
"T",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"60",
"or",
"T",
">",
"2000",
":",
"warnings",
".",
"warn",
"(",
"\"Baa out of validity range\"",
")",
"if",
"T",
"<",
"130",
"or",
"T",
">",
"2000",
":",
"warnings",
"."... | Virial equations for humid air
Parameters
----------
T : float
Temperature [K]
Returns
-------
prop : dict
Dictionary with critical coefficient:
* Baa: Second virial coefficient of dry air, [m³/mol]
* Baw: Second air-water cross virial coefficient, [m³/... | [
"Virial",
"equations",
"for",
"humid",
"air"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L32-L198 |
jjgomera/iapws | iapws/humidAir.py | _fugacity | def _fugacity(T, P, x):
"""Fugacity equation for humid air
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Mole fraction of water-vapor, [-]
Returns
-------
fv : float
fugacity coefficient, [MPa]
Notes
--... | python | def _fugacity(T, P, x):
"""Fugacity equation for humid air
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Mole fraction of water-vapor, [-]
Returns
-------
fv : float
fugacity coefficient, [MPa]
Notes
--... | [
"def",
"_fugacity",
"(",
"T",
",",
"P",
",",
"x",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"193",
"or",
"T",
">",
"473",
"or",
"P",
"<",
"0",
"or",
"P",
">",
"5",
"or",
"x",
"<",
"0",
"or",
"x",
">",
"1",
":",
"raise",
"(",
"No... | Fugacity equation for humid air
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Mole fraction of water-vapor, [-]
Returns
-------
fv : float
fugacity coefficient, [MPa]
Notes
------
Raise :class:`NotImple... | [
"Fugacity",
"equation",
"for",
"humid",
"air"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L201-L258 |
jjgomera/iapws | iapws/humidAir.py | MEoSBlend._bubbleP | def _bubbleP(cls, T):
"""Using ancillary equation return the pressure of bubble point"""
c = cls._blend["bubble"]
Tj = cls._blend["Tj"]
Pj = cls._blend["Pj"]
Tita = 1-T/Tj
suma = 0
for i, n in zip(c["i"], c["n"]):
suma += n*Tita**(i/2.)
P = Pj... | python | def _bubbleP(cls, T):
"""Using ancillary equation return the pressure of bubble point"""
c = cls._blend["bubble"]
Tj = cls._blend["Tj"]
Pj = cls._blend["Pj"]
Tita = 1-T/Tj
suma = 0
for i, n in zip(c["i"], c["n"]):
suma += n*Tita**(i/2.)
P = Pj... | [
"def",
"_bubbleP",
"(",
"cls",
",",
"T",
")",
":",
"c",
"=",
"cls",
".",
"_blend",
"[",
"\"bubble\"",
"]",
"Tj",
"=",
"cls",
".",
"_blend",
"[",
"\"Tj\"",
"]",
"Pj",
"=",
"cls",
".",
"_blend",
"[",
"\"Pj\"",
"]",
"Tita",
"=",
"1",
"-",
"T",
"... | Using ancillary equation return the pressure of bubble point | [
"Using",
"ancillary",
"equation",
"return",
"the",
"pressure",
"of",
"bubble",
"point"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L279-L290 |
jjgomera/iapws | iapws/humidAir.py | HumidAir.calculable | def calculable(self):
"""Check if inputs are enough to define state"""
self._mode = ""
if self.kwargs["T"] and self.kwargs["P"]:
self._mode = "TP"
elif self.kwargs["T"] and self.kwargs["rho"]:
self._mode = "Trho"
elif self.kwargs["P"] and self.kwargs["rho"... | python | def calculable(self):
"""Check if inputs are enough to define state"""
self._mode = ""
if self.kwargs["T"] and self.kwargs["P"]:
self._mode = "TP"
elif self.kwargs["T"] and self.kwargs["rho"]:
self._mode = "Trho"
elif self.kwargs["P"] and self.kwargs["rho"... | [
"def",
"calculable",
"(",
"self",
")",
":",
"self",
".",
"_mode",
"=",
"\"\"",
"if",
"self",
".",
"kwargs",
"[",
"\"T\"",
"]",
"and",
"self",
".",
"kwargs",
"[",
"\"P\"",
"]",
":",
"self",
".",
"_mode",
"=",
"\"TP\"",
"elif",
"self",
".",
"kwargs",... | Check if inputs are enough to define state | [
"Check",
"if",
"inputs",
"are",
"enough",
"to",
"define",
"state"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L643-L660 |
jjgomera/iapws | iapws/humidAir.py | HumidAir.calculo | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
rho = self.kwargs["rho"]
P = self.kwargs["P"]
# Composition alternate definition
if self._composition == "A":
A = self.kwargs["A"]
elif self._composition == "xa":
xa = self.... | python | def calculo(self):
"""Calculate procedure"""
T = self.kwargs["T"]
rho = self.kwargs["rho"]
P = self.kwargs["P"]
# Composition alternate definition
if self._composition == "A":
A = self.kwargs["A"]
elif self._composition == "xa":
xa = self.... | [
"def",
"calculo",
"(",
"self",
")",
":",
"T",
"=",
"self",
".",
"kwargs",
"[",
"\"T\"",
"]",
"rho",
"=",
"self",
".",
"kwargs",
"[",
"\"rho\"",
"]",
"P",
"=",
"self",
".",
"kwargs",
"[",
"\"P\"",
"]",
"# Composition alternate definition",
"if",
"self",... | Calculate procedure | [
"Calculate",
"procedure"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L662-L722 |
jjgomera/iapws | iapws/humidAir.py | HumidAir._eq | def _eq(self, T, P):
"""Procedure for calculate the composition in saturation state
Parameters
----------
T : float
Temperature [K]
P : float
Pressure [MPa]
Returns
-------
Asat : float
Saturation mass fraction of dry ... | python | def _eq(self, T, P):
"""Procedure for calculate the composition in saturation state
Parameters
----------
T : float
Temperature [K]
P : float
Pressure [MPa]
Returns
-------
Asat : float
Saturation mass fraction of dry ... | [
"def",
"_eq",
"(",
"self",
",",
"T",
",",
"P",
")",
":",
"if",
"T",
"<=",
"273.16",
":",
"ice",
"=",
"_Ice",
"(",
"T",
",",
"P",
")",
"gw",
"=",
"ice",
"[",
"\"g\"",
"]",
"else",
":",
"water",
"=",
"IAPWS95",
"(",
"T",
"=",
"T",
",",
"P",... | Procedure for calculate the composition in saturation state
Parameters
----------
T : float
Temperature [K]
P : float
Pressure [MPa]
Returns
-------
Asat : float
Saturation mass fraction of dry air in humid air [kg/kg] | [
"Procedure",
"for",
"calculate",
"the",
"composition",
"in",
"saturation",
"state"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L729-L761 |
jjgomera/iapws | iapws/humidAir.py | HumidAir._prop | def _prop(self, T, rho, fav):
"""Thermodynamic properties of humid air
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
fav : dict
dictionary with helmholtz energy and derivatives
Returns
-... | python | def _prop(self, T, rho, fav):
"""Thermodynamic properties of humid air
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
fav : dict
dictionary with helmholtz energy and derivatives
Returns
-... | [
"def",
"_prop",
"(",
"self",
",",
"T",
",",
"rho",
",",
"fav",
")",
":",
"prop",
"=",
"{",
"}",
"prop",
"[",
"\"P\"",
"]",
"=",
"rho",
"**",
"2",
"*",
"fav",
"[",
"\"fird\"",
"]",
"/",
"1000",
"# Eq T1",
"prop",
"[",
"\"s\"",
"]",
"=",
"-",
... | Thermodynamic properties of humid air
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
fav : dict
dictionary with helmholtz energy and derivatives
Returns
-------
prop : dict
Di... | [
"Thermodynamic",
"properties",
"of",
"humid",
"air"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L763-L813 |
jjgomera/iapws | iapws/humidAir.py | HumidAir._coligative | def _coligative(self, rho, A, fav):
"""Miscelaneous properties of humid air
Parameters
----------
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
fav : dict
dictionary with helmholtz energy and der... | python | def _coligative(self, rho, A, fav):
"""Miscelaneous properties of humid air
Parameters
----------
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
fav : dict
dictionary with helmholtz energy and der... | [
"def",
"_coligative",
"(",
"self",
",",
"rho",
",",
"A",
",",
"fav",
")",
":",
"prop",
"=",
"{",
"}",
"prop",
"[",
"\"mu\"",
"]",
"=",
"fav",
"[",
"\"fira\"",
"]",
"prop",
"[",
"\"muw\"",
"]",
"=",
"fav",
"[",
"\"fir\"",
"]",
"+",
"rho",
"*",
... | Miscelaneous properties of humid air
Parameters
----------
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
fav : dict
dictionary with helmholtz energy and derivatives
Returns
-------
... | [
"Miscelaneous",
"properties",
"of",
"humid",
"air"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L815-L853 |
jjgomera/iapws | iapws/humidAir.py | HumidAir._fav | def _fav(self, T, rho, A):
r"""Specific Helmholtz energy of humid air and derivatives
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Retur... | python | def _fav(self, T, rho, A):
r"""Specific Helmholtz energy of humid air and derivatives
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Retur... | [
"def",
"_fav",
"(",
"self",
",",
"T",
",",
"rho",
",",
"A",
")",
":",
"water",
"=",
"IAPWS95",
"(",
")",
"rhov",
"=",
"(",
"1",
"-",
"A",
")",
"*",
"rho",
"fv",
"=",
"water",
".",
"_derivDimensional",
"(",
"rhov",
",",
"T",
")",
"air",
"=",
... | r"""Specific Helmholtz energy of humid air and derivatives
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Returns
-------
prop : d... | [
"r",
"Specific",
"Helmholtz",
"energy",
"of",
"humid",
"air",
"and",
"derivatives"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L855-L925 |
jjgomera/iapws | iapws/humidAir.py | HumidAir._fmix | def _fmix(self, T, rho, A):
r"""Specific Helmholtz energy of air-water interaction
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Returns
... | python | def _fmix(self, T, rho, A):
r"""Specific Helmholtz energy of air-water interaction
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Returns
... | [
"def",
"_fmix",
"(",
"self",
",",
"T",
",",
"rho",
",",
"A",
")",
":",
"Ma",
"=",
"Air",
".",
"M",
"/",
"1000",
"Mw",
"=",
"IAPWS95",
".",
"M",
"/",
"1000",
"vir",
"=",
"_virial",
"(",
"T",
")",
"Baw",
"=",
"vir",
"[",
"\"Baw\"",
"]",
"Bawt... | r"""Specific Helmholtz energy of air-water interaction
Parameters
----------
T : float
Temperature, [K]
rho : float
Density, [kg/m³]
A : float
Mass fraction of dry air in humid air, [kg/kg]
Returns
-------
prop : dict
... | [
"r",
"Specific",
"Helmholtz",
"energy",
"of",
"air",
"-",
"water",
"interaction"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/humidAir.py#L927-L1013 |
jjgomera/iapws | iapws/_iapws.py | _Ice | def _Ice(T, P):
"""Basic state equation for Ice Ih
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of ice. The available properties are:
* rho: Density, [kg/m³]
... | python | def _Ice(T, P):
"""Basic state equation for Ice Ih
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of ice. The available properties are:
* rho: Density, [kg/m³]
... | [
"def",
"_Ice",
"(",
"T",
",",
"P",
")",
":",
"# Check input in range of validity",
"if",
"T",
">",
"273.16",
":",
"# No Ice Ih stable",
"warnings",
".",
"warn",
"(",
"\"Metastable ice\"",
")",
"elif",
"P",
">",
"208.566",
":",
"# Ice Ih limit upper pressure",
"r... | Basic state equation for Ice Ih
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of ice. The available properties are:
* rho: Density, [kg/m³]
* h: Specifi... | [
"Basic",
"state",
"equation",
"for",
"Ice",
"Ih"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L62-L206 |
jjgomera/iapws | iapws/_iapws.py | _Liquid | def _Liquid(T, P=0.1):
"""Supplementary release on properties of liquid water at 0.1 MPa
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Although this relation is for P=0.1MPa, can be extrapoled at pressure
0.3 MPa
Returns
-------
... | python | def _Liquid(T, P=0.1):
"""Supplementary release on properties of liquid water at 0.1 MPa
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Although this relation is for P=0.1MPa, can be extrapoled at pressure
0.3 MPa
Returns
-------
... | [
"def",
"_Liquid",
"(",
"T",
",",
"P",
"=",
"0.1",
")",
":",
"# Check input in range of validity",
"if",
"T",
"<=",
"253.15",
"or",
"T",
">=",
"383.15",
"or",
"P",
"<",
"0.1",
"or",
"P",
">",
"0.3",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming ou... | Supplementary release on properties of liquid water at 0.1 MPa
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Although this relation is for P=0.1MPa, can be extrapoled at pressure
0.3 MPa
Returns
-------
prop : dict
Dict w... | [
"Supplementary",
"release",
"on",
"properties",
"of",
"liquid",
"water",
"at",
"0",
".",
"1",
"MPa"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L210-L385 |
jjgomera/iapws | iapws/_iapws.py | _Supercooled | def _Supercooled(T, P):
"""Guideline on thermodynamic properties of supercooled water
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of water. The available properties are:
... | python | def _Supercooled(T, P):
"""Guideline on thermodynamic properties of supercooled water
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of water. The available properties are:
... | [
"def",
"_Supercooled",
"(",
"T",
",",
"P",
")",
":",
"# Check input in range of validity",
"if",
"P",
"<",
"198.9",
":",
"Tita",
"=",
"T",
"/",
"235.15",
"Ph",
"=",
"0.1",
"+",
"228.27",
"*",
"(",
"1",
"-",
"Tita",
"**",
"6.243",
")",
"+",
"15.724",
... | Guideline on thermodynamic properties of supercooled water
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties of water. The available properties are:
* L: Ordering field... | [
"Guideline",
"on",
"thermodynamic",
"properties",
"of",
"supercooled",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L389-L561 |
jjgomera/iapws | iapws/_iapws.py | _Sublimation_Pressure | def _Sublimation_Pressure(T):
"""Sublimation Pressure correlation
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* ... | python | def _Sublimation_Pressure(T):
"""Sublimation Pressure correlation
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* ... | [
"def",
"_Sublimation_Pressure",
"(",
"T",
")",
":",
"if",
"50",
"<=",
"T",
"<=",
"273.16",
":",
"Tita",
"=",
"T",
"/",
"Tt",
"suma",
"=",
"0",
"a",
"=",
"[",
"-",
"0.212144006e2",
",",
"0.273203819e2",
",",
"-",
"0.61059813e1",
"]",
"expo",
"=",
"[... | Sublimation Pressure correlation
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 50 ≤ T ≤ 273.16
Examples
---... | [
"Sublimation",
"Pressure",
"correlation"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L564-L602 |
jjgomera/iapws | iapws/_iapws.py | _Melting_Pressure | def _Melting_Pressure(T, ice="Ih"):
"""Melting Pressure correlation
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 273.15 is a mandatory input, the ice Ih is the default value.
Above 273.15, the ice type is unnece... | python | def _Melting_Pressure(T, ice="Ih"):
"""Melting Pressure correlation
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 273.15 is a mandatory input, the ice Ih is the default value.
Above 273.15, the ice type is unnece... | [
"def",
"_Melting_Pressure",
"(",
"T",
",",
"ice",
"=",
"\"Ih\"",
")",
":",
"if",
"ice",
"==",
"\"Ih\"",
"and",
"251.165",
"<=",
"T",
"<=",
"273.16",
":",
"# Ice Ih",
"Tref",
"=",
"Tt",
"Pref",
"=",
"Pt",
"Tita",
"=",
"T",
"/",
"Tref",
"a",
"=",
"... | Melting Pressure correlation
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 273.15 is a mandatory input, the ice Ih is the default value.
Above 273.15, the ice type is unnecesary.
Returns
-------
P : floa... | [
"Melting",
"Pressure",
"correlation"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L605-L678 |
jjgomera/iapws | iapws/_iapws.py | _Viscosity | def _Viscosity(rho, T, fase=None, drho=None):
"""Equation for the Viscosity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calculate crit... | python | def _Viscosity(rho, T, fase=None, drho=None):
"""Equation for the Viscosity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calculate crit... | [
"def",
"_Viscosity",
"(",
"rho",
",",
"T",
",",
"fase",
"=",
"None",
",",
"drho",
"=",
"None",
")",
":",
"Tr",
"=",
"T",
"/",
"Tc",
"Dr",
"=",
"rho",
"/",
"rhoc",
"# Eq 11",
"H",
"=",
"[",
"1.67752",
",",
"2.20462",
",",
"0.6366564",
",",
"-",
... | Equation for the Viscosity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calculate critical enhancement
[∂ρ/∂P]T at reference state,... | [
"Equation",
"for",
"the",
"Viscosity"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L682-L768 |
jjgomera/iapws | iapws/_iapws.py | _ThCond | def _ThCond(rho, T, fase=None, drho=None):
"""Equation for the thermal conductivity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calcul... | python | def _ThCond(rho, T, fase=None, drho=None):
"""Equation for the thermal conductivity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calcul... | [
"def",
"_ThCond",
"(",
"rho",
",",
"T",
",",
"fase",
"=",
"None",
",",
"drho",
"=",
"None",
")",
":",
"d",
"=",
"rho",
"/",
"rhoc",
"Tr",
"=",
"T",
"/",
"Tc",
"# Eq 16",
"no",
"=",
"[",
"2.443221e-3",
",",
"1.323095e-2",
",",
"6.770357e-3",
",",
... | Equation for the thermal conductivity
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
fase: dict, optional for calculate critical enhancement
phase properties
drho: float, optional for calculate critical enhancement
[∂ρ/∂P]T at refer... | [
"Equation",
"for",
"the",
"thermal",
"conductivity"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L771-L869 |
jjgomera/iapws | iapws/_iapws.py | _Tension | def _Tension(T):
"""Equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 248.15 ≤ T ≤ 647
*... | python | def _Tension(T):
"""Equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 248.15 ≤ T ≤ 647
*... | [
"def",
"_Tension",
"(",
"T",
")",
":",
"if",
"248.15",
"<=",
"T",
"<=",
"Tc",
":",
"Tr",
"=",
"T",
"/",
"Tc",
"return",
"1e-3",
"*",
"(",
"235.8",
"*",
"(",
"1",
"-",
"Tr",
")",
"**",
"1.256",
"*",
"(",
"1",
"-",
"0.625",
"*",
"(",
"1",
"... | Equation for the surface tension
Parameters
----------
T : float
Temperature, [K]
Returns
-------
σ : float
Surface tension, [N/m]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 248.15 ≤ T ≤ 647
* Estrapolate to -25ºC in... | [
"Equation",
"for",
"the",
"surface",
"tension"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L872-L908 |
jjgomera/iapws | iapws/_iapws.py | _Dielectric | def _Dielectric(rho, T):
"""Equation for the Dielectric constant
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
epsilon : float
Dielectric constant, [-]
Notes
------
Raise :class:`NotImplementedError` i... | python | def _Dielectric(rho, T):
"""Equation for the Dielectric constant
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
epsilon : float
Dielectric constant, [-]
Notes
------
Raise :class:`NotImplementedError` i... | [
"def",
"_Dielectric",
"(",
"rho",
",",
"T",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"238",
"or",
"T",
">",
"1200",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"k",
"=",
"1.380658e-23",
"Na",
"=",
"6.0221367e23",
... | Equation for the Dielectric constant
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
epsilon : float
Dielectric constant, [-]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
... | [
"Equation",
"for",
"the",
"Dielectric",
"constant"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L911-L970 |
jjgomera/iapws | iapws/_iapws.py | _Refractive | def _Refractive(rho, T, l=0.5893):
"""Equation for the refractive index
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
l : float, optional
Light Wavelength, [μm]
Returns
-------
n : float
Refractive index, [-]
Note... | python | def _Refractive(rho, T, l=0.5893):
"""Equation for the refractive index
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
l : float, optional
Light Wavelength, [μm]
Returns
-------
n : float
Refractive index, [-]
Note... | [
"def",
"_Refractive",
"(",
"rho",
",",
"T",
",",
"l",
"=",
"0.5893",
")",
":",
"# Check input parameters",
"if",
"rho",
"<",
"0",
"or",
"rho",
">",
"1060",
"or",
"T",
"<",
"261.15",
"or",
"T",
">",
"773.15",
"or",
"l",
"<",
"0.2",
"or",
"l",
">",... | Equation for the refractive index
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
l : float, optional
Light Wavelength, [μm]
Returns
-------
n : float
Refractive index, [-]
Notes
------
Raise :class:`NotImplemen... | [
"Equation",
"for",
"the",
"refractive",
"index"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L973-L1024 |
jjgomera/iapws | iapws/_iapws.py | _Kw | def _Kw(rho, T):
"""Equation for the ionization constant of ordinary water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
pKw : float
Ionization constant in -log10(kw), [-]
Notes
------
Raise :class:`No... | python | def _Kw(rho, T):
"""Equation for the ionization constant of ordinary water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
pKw : float
Ionization constant in -log10(kw), [-]
Notes
------
Raise :class:`No... | [
"def",
"_Kw",
"(",
"rho",
",",
"T",
")",
":",
"# Check input parameters",
"if",
"rho",
"<",
"0",
"or",
"rho",
">",
"1250",
"or",
"T",
"<",
"273.15",
"or",
"T",
">",
"1073.15",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"#... | Equation for the ionization constant of ordinary water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
pKw : float
Ionization constant in -log10(kw), [-]
Notes
------
Raise :class:`NotImplementedError` if in... | [
"Equation",
"for",
"the",
"ionization",
"constant",
"of",
"ordinary",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1027-L1077 |
jjgomera/iapws | iapws/_iapws.py | _Conductivity | def _Conductivity(rho, T):
"""Equation for the electrolytic conductivity of liquid and dense
supercrítical water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
K : float
Electrolytic conductivity, [S/m]
Not... | python | def _Conductivity(rho, T):
"""Equation for the electrolytic conductivity of liquid and dense
supercrítical water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
K : float
Electrolytic conductivity, [S/m]
Not... | [
"def",
"_Conductivity",
"(",
"rho",
",",
"T",
")",
":",
"# FIXME: Dont work",
"rho_",
"=",
"rho",
"/",
"1000",
"kw",
"=",
"10",
"**",
"-",
"_Kw",
"(",
"rho",
",",
"T",
")",
"A",
"=",
"[",
"1850.",
",",
"1410.",
",",
"2.16417e-6",
",",
"1.81609e-7",... | Equation for the electrolytic conductivity of liquid and dense
supercrítical water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
K : float
Electrolytic conductivity, [S/m]
Notes
------
Raise :class:`No... | [
"Equation",
"for",
"the",
"electrolytic",
"conductivity",
"of",
"liquid",
"and",
"dense",
"supercrítical",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1080-L1130 |
jjgomera/iapws | iapws/_iapws.py | _D2O_Viscosity | def _D2O_Viscosity(rho, T):
"""Equation for the Viscosity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
μ : float
Viscosity, [Pa·s]
Examples
--------
>>> _D2O_Viscosity(998, 298.15)
... | python | def _D2O_Viscosity(rho, T):
"""Equation for the Viscosity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
μ : float
Viscosity, [Pa·s]
Examples
--------
>>> _D2O_Viscosity(998, 298.15)
... | [
"def",
"_D2O_Viscosity",
"(",
"rho",
",",
"T",
")",
":",
"Tr",
"=",
"T",
"/",
"643.847",
"rhor",
"=",
"rho",
"/",
"358.0",
"no",
"=",
"[",
"1.0",
",",
"0.940695",
",",
"0.578377",
",",
"-",
"0.202044",
"]",
"fi0",
"=",
"Tr",
"**",
"0.5",
"/",
"... | Equation for the Viscosity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
μ : float
Viscosity, [Pa·s]
Examples
--------
>>> _D2O_Viscosity(998, 298.15)
0.0008897351001498108
>>> _D2O_... | [
"Equation",
"for",
"the",
"Viscosity",
"of",
"heavy",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1134-L1180 |
jjgomera/iapws | iapws/_iapws.py | _D2O_ThCond | def _D2O_ThCond(rho, T):
"""Equation for the thermal conductivity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
k : float
Thermal conductivity, [W/mK]
Examples
--------
>>> _D2O_ThCond(9... | python | def _D2O_ThCond(rho, T):
"""Equation for the thermal conductivity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
k : float
Thermal conductivity, [W/mK]
Examples
--------
>>> _D2O_ThCond(9... | [
"def",
"_D2O_ThCond",
"(",
"rho",
",",
"T",
")",
":",
"rhor",
"=",
"rho",
"/",
"358",
"Tr",
"=",
"T",
"/",
"643.847",
"tau",
"=",
"Tr",
"/",
"(",
"abs",
"(",
"Tr",
"-",
"1.1",
")",
"+",
"1.1",
")",
"no",
"=",
"[",
"1.0",
",",
"37.3223",
","... | Equation for the thermal conductivity of heavy water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
k : float
Thermal conductivity, [W/mK]
Examples
--------
>>> _D2O_ThCond(998, 298.15)
0.60771286758806... | [
"Equation",
"for",
"the",
"thermal",
"conductivity",
"of",
"heavy",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1183-L1229 |
jjgomera/iapws | iapws/_iapws.py | _D2O_Sublimation_Pressure | def _D2O_Sublimation_Pressure(T):
"""Sublimation Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't i... | python | def _D2O_Sublimation_Pressure(T):
"""Sublimation Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't i... | [
"def",
"_D2O_Sublimation_Pressure",
"(",
"T",
")",
":",
"if",
"210",
"<=",
"T",
"<=",
"276.969",
":",
"Tita",
"=",
"T",
"/",
"276.969",
"suma",
"=",
"0",
"ai",
"=",
"[",
"-",
"0.1314226e2",
",",
"0.3212969e2",
"]",
"ti",
"=",
"[",
"-",
"1.73",
",",... | Sublimation Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure at sublimation line, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 210 ≤ T ≤ 276.969
... | [
"Sublimation",
"Pressure",
"correlation",
"for",
"heavy",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1270-L1308 |
jjgomera/iapws | iapws/_iapws.py | _D2O_Melting_Pressure | def _D2O_Melting_Pressure(T, ice="Ih"):
"""Melting Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 276.969 is a mandatory input, the ice Ih is the default value.
Above 276.969, ... | python | def _D2O_Melting_Pressure(T, ice="Ih"):
"""Melting Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 276.969 is a mandatory input, the ice Ih is the default value.
Above 276.969, ... | [
"def",
"_D2O_Melting_Pressure",
"(",
"T",
",",
"ice",
"=",
"\"Ih\"",
")",
":",
"if",
"ice",
"==",
"\"Ih\"",
"and",
"254.415",
"<=",
"T",
"<=",
"276.969",
":",
"# Ice Ih, Eq 9",
"Tita",
"=",
"T",
"/",
"276.969",
"ai",
"=",
"[",
"-",
"0.30153e5",
",",
... | Melting Pressure correlation for heavy water
Parameters
----------
T : float
Temperature, [K]
ice: string
Type of ice: Ih, III, V, VI, VII.
Below 276.969 is a mandatory input, the ice Ih is the default value.
Above 276.969, the ice type is unnecesary.
Returns
--... | [
"Melting",
"Pressure",
"correlation",
"for",
"heavy",
"water"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1311-L1369 |
jjgomera/iapws | iapws/_iapws.py | _Henry | def _Henry(T, gas, liquid="H2O"):
"""Equation for the calculation of Henry's constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
--... | python | def _Henry(T, gas, liquid="H2O"):
"""Equation for the calculation of Henry's constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
--... | [
"def",
"_Henry",
"(",
"T",
",",
"gas",
",",
"liquid",
"=",
"\"H2O\"",
")",
":",
"if",
"liquid",
"==",
"\"D2O\"",
":",
"gas",
"+=",
"\"(D2O)\"",
"limit",
"=",
"{",
"\"He\"",
":",
"(",
"273.21",
",",
"553.18",
")",
",",
"\"Ne\"",
":",
"(",
"273.20",
... | Equation for the calculation of Henry's constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
-------
kw : float
Henry's cons... | [
"Equation",
"for",
"the",
"calculation",
"of",
"Henry",
"s",
"constant"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1372-L1493 |
jjgomera/iapws | iapws/_iapws.py | _Kvalue | def _Kvalue(T, gas, liquid="H2O"):
"""Equation for the vapor-liquid distribution constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
... | python | def _Kvalue(T, gas, liquid="H2O"):
"""Equation for the vapor-liquid distribution constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
... | [
"def",
"_Kvalue",
"(",
"T",
",",
"gas",
",",
"liquid",
"=",
"\"H2O\"",
")",
":",
"if",
"liquid",
"==",
"\"D2O\"",
":",
"gas",
"+=",
"\"(D2O)\"",
"limit",
"=",
"{",
"\"He\"",
":",
"(",
"273.21",
",",
"553.18",
")",
",",
"\"Ne\"",
":",
"(",
"273.20",... | Equation for the vapor-liquid distribution constant
Parameters
----------
T : float
Temperature, [K]
gas : string
Name of gas to calculate solubility
liquid : string
Name of liquid solvent, can be H20 (default) or D2O
Returns
-------
kd : float
Vapor-liq... | [
"Equation",
"for",
"the",
"vapor",
"-",
"liquid",
"distribution",
"constant"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_iapws.py#L1496-L1617 |
jjgomera/iapws | iapws/_utils.py | getphase | def getphase(Tc, Pc, T, P, x, region):
"""Return fluid phase string name
Parameters
----------
Tc : float
Critical temperature, [K]
Pc : float
Critical pressure, [MPa]
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Quality, [-]
... | python | def getphase(Tc, Pc, T, P, x, region):
"""Return fluid phase string name
Parameters
----------
Tc : float
Critical temperature, [K]
Pc : float
Critical pressure, [MPa]
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Quality, [-]
... | [
"def",
"getphase",
"(",
"Tc",
",",
"Pc",
",",
"T",
",",
"P",
",",
"x",
",",
"region",
")",
":",
"# Avoid round problem",
"P",
"=",
"round",
"(",
"P",
",",
"8",
")",
"T",
"=",
"round",
"(",
"T",
",",
"8",
")",
"if",
"P",
">",
"Pc",
"and",
"T... | Return fluid phase string name
Parameters
----------
Tc : float
Critical temperature, [K]
Pc : float
Critical pressure, [MPa]
T : float
Temperature, [K]
P : float
Pressure, [MPa]
x : float
Quality, [-]
region: int
Region number, used only ... | [
"Return",
"fluid",
"phase",
"string",
"name"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_utils.py#L17-L61 |
jjgomera/iapws | iapws/_utils.py | deriv_H | def deriv_H(state, z, x, y, fase):
r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
helmholtz free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase... | python | def deriv_H(state, z, x, y, fase):
r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
helmholtz free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase... | [
"def",
"deriv_H",
"(",
"state",
",",
"z",
",",
"x",
",",
"y",
",",
"fase",
")",
":",
"# We use the relation between rho and v and his partial derivative",
"# ∂v/∂b|c = -1/ρ² ∂ρ/∂b|c",
"# ∂a/∂v|c = -ρ² ∂a/∂ρ|c",
"mul",
"=",
"1",
"if",
"z",
"==",
"\"rho\"",
":",
"mul"... | r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
helmholtz free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase specific properties
z : str
... | [
"r",
"Calculate",
"generic",
"partial",
"derivative",
":",
"math",
":",
"\\",
"left",
".",
"\\",
"frac",
"{",
"\\",
"partial",
"z",
"}",
"{",
"\\",
"partial",
"x",
"}",
"\\",
"right|_",
"{",
"y",
"}",
"from",
"a",
"fundamental",
"helmholtz",
"free",
... | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_utils.py#L119-L191 |
jjgomera/iapws | iapws/_utils.py | deriv_G | def deriv_G(state, z, x, y, fase):
r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
Gibbs free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase spe... | python | def deriv_G(state, z, x, y, fase):
r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
Gibbs free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase spe... | [
"def",
"deriv_G",
"(",
"state",
",",
"z",
",",
"x",
",",
"y",
",",
"fase",
")",
":",
"mul",
"=",
"1",
"if",
"z",
"==",
"\"rho\"",
":",
"mul",
"=",
"-",
"fase",
".",
"rho",
"**",
"2",
"z",
"=",
"\"v\"",
"if",
"x",
"==",
"\"rho\"",
":",
"mul"... | r"""Calculate generic partial derivative
:math:`\left.\frac{\partial z}{\partial x}\right|_{y}` from a fundamental
Gibbs free energy equation of state
Parameters
----------
state : any python object
Only need to define P and T properties, non phase specific properties
z : str
Na... | [
"r",
"Calculate",
"generic",
"partial",
"derivative",
":",
"math",
":",
"\\",
"left",
".",
"\\",
"frac",
"{",
"\\",
"partial",
"z",
"}",
"{",
"\\",
"partial",
"x",
"}",
"\\",
"right|_",
"{",
"y",
"}",
"from",
"a",
"fundamental",
"Gibbs",
"free",
"ene... | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/_utils.py#L194-L261 |
jjgomera/iapws | iapws/iapws97.py | _h13_s | def _h13_s(s):
"""Define the boundary between Region 1 and 3, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
... | python | def _h13_s(s):
"""Define the boundary between Region 1 and 3, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
... | [
"def",
"_h13_s",
"(",
"s",
")",
":",
"# Check input parameters",
"if",
"s",
"<",
"3.397782955",
"or",
"s",
">",
"3.77828134",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"sigma",
"=",
"s",
"/",
"3.8",
"I",
"=",
"[",
"0",
","... | Define the boundary between Region 1 and 3, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* s(100MPa,623.15K) ... | [
"Define",
"the",
"boundary",
"between",
"Region",
"1",
"and",
"3",
"h",
"=",
"f",
"(",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L106-L153 |
jjgomera/iapws | iapws/iapws97.py | _PSat_T | def _PSat_T(T):
"""Define the saturated line, P=f(T)
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 273.15 ≤ T ≤ 647.096
Referen... | python | def _PSat_T(T):
"""Define the saturated line, P=f(T)
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 273.15 ≤ T ≤ 647.096
Referen... | [
"def",
"_PSat_T",
"(",
"T",
")",
":",
"# Check input parameters",
"if",
"T",
"<",
"273.15",
"or",
"T",
">",
"Tc",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"n",
"=",
"[",
"0",
",",
"0.11670521452767E+04",
",",
"-",
"0.724213... | Define the saturated line, P=f(T)
Parameters
----------
T : float
Temperature, [K]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 273.15 ≤ T ≤ 647.096
References
----------
... | [
"Define",
"the",
"saturated",
"line",
"P",
"=",
"f",
"(",
"T",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L278-L320 |
jjgomera/iapws | iapws/iapws97.py | _TSat_P | def _TSat_P(P):
"""Define the saturated line, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 0.00061121 ≤ P ≤ 22.064
Refe... | python | def _TSat_P(P):
"""Define the saturated line, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 0.00061121 ≤ P ≤ 22.064
Refe... | [
"def",
"_TSat_P",
"(",
"P",
")",
":",
"# Check input parameters",
"if",
"P",
"<",
"611.212677",
"/",
"1e6",
"or",
"P",
">",
"22.064",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"n",
"=",
"[",
"0",
",",
"0.11670521452767E+04",
... | Define the saturated line, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* 0.00061121 ≤ P ≤ 22.064
References
----------
... | [
"Define",
"the",
"saturated",
"line",
"T",
"=",
"f",
"(",
"P",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L323-L366 |
jjgomera/iapws | iapws/iapws97.py | _PSat_h | def _PSat_h(h):
"""Define the saturated line, P=f(h) for region 3
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* h'(623.15K... | python | def _PSat_h(h):
"""Define the saturated line, P=f(h) for region 3
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* h'(623.15K... | [
"def",
"_PSat_h",
"(",
"h",
")",
":",
"# Check input parameters",
"hmin_Ps3",
"=",
"_Region1",
"(",
"623.15",
",",
"Ps_623",
")",
"[",
"\"h\"",
"]",
"hmax_Ps3",
"=",
"_Region2",
"(",
"623.15",
",",
"Ps_623",
")",
"[",
"\"h\"",
"]",
"if",
"h",
"<",
"hmi... | Define the saturated line, P=f(h) for region 3
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* h'(623.15K) ≤ h ≤ h''(623.15K)
... | [
"Define",
"the",
"saturated",
"line",
"P",
"=",
"f",
"(",
"h",
")",
"for",
"region",
"3"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L369-L420 |
jjgomera/iapws | iapws/iapws97.py | _PSat_s | def _PSat_s(s):
"""Define the saturated line, P=f(s) for region 3
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* s'(623.15K... | python | def _PSat_s(s):
"""Define the saturated line, P=f(s) for region 3
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* s'(623.15K... | [
"def",
"_PSat_s",
"(",
"s",
")",
":",
"# Check input parameters",
"smin_Ps3",
"=",
"_Region1",
"(",
"623.15",
",",
"Ps_623",
")",
"[",
"\"s\"",
"]",
"smax_Ps3",
"=",
"_Region2",
"(",
"623.15",
",",
"Ps_623",
")",
"[",
"\"s\"",
"]",
"if",
"s",
"<",
"smi... | Define the saturated line, P=f(s) for region 3
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
* s'(623.15K) ≤ s ≤ s''(623.15K)
... | [
"Define",
"the",
"saturated",
"line",
"P",
"=",
"f",
"(",
"s",
")",
"for",
"region",
"3"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L423-L473 |
jjgomera/iapws | iapws/iapws97.py | _h2ab_s | def _h2ab_s(s):
"""Define the saturated line boundary between Region 4 and 2a-2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn... | python | def _h2ab_s(s):
"""Define the saturated line boundary between Region 4 and 2a-2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn... | [
"def",
"_h2ab_s",
"(",
"s",
")",
":",
"# Check input parameters",
"if",
"s",
"<",
"5.85",
"or",
"s",
">",
"9.155759395",
":",
"raise",
"NotImplementedError",
"(",
"\"Incoming out of bound\"",
")",
"sigma1",
"=",
"s",
"/",
"5.21",
"sigma2",
"=",
"s",
"/",
"... | Define the saturated line boundary between Region 4 and 2a-2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
Notes
------
Raise :class:`NotImplementedError` if input isn't in limit:
*... | [
"Define",
"the",
"saturated",
"line",
"boundary",
"between",
"Region",
"4",
"and",
"2a",
"-",
"2b",
"h",
"=",
"f",
"(",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L590-L648 |
jjgomera/iapws | iapws/iapws97.py | _Region1 | def _Region1(T, P):
"""Basic equation for region 1
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
... | python | def _Region1(T, P):
"""Basic equation for region 1
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
... | [
"def",
"_Region1",
"(",
"T",
",",
"P",
")",
":",
"if",
"P",
"<",
"0",
":",
"P",
"=",
"Pmin",
"I",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1... | Basic equation for region 1
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
* h: Specific ent... | [
"Basic",
"equation",
"for",
"region",
"1"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L706-L800 |
jjgomera/iapws | iapws/iapws97.py | _Backward1_T_Ph | def _Backward1_T_Ph(P, h):
"""
Backward equation for region 1, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release ... | python | def _Backward1_T_Ph(P, h):
"""
Backward equation for region 1, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release ... | [
"def",
"_Backward1_T_Ph",
"(",
"P",
",",
"h",
")",
":",
"I",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"2",
",",
"2",
",",
"3",
",",
... | Backward equation for region 1, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release on the IAPWS Industrial Formulation 199... | [
"Backward",
"equation",
"for",
"region",
"1",
"T",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L803-L847 |
jjgomera/iapws | iapws/iapws97.py | _Backward1_P_hs | def _Backward1_P_hs(h, s):
"""Backward equation for region 1, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
References
----------
IAPWS, Revised Sup... | python | def _Backward1_P_hs(h, s):
"""Backward equation for region 1, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
References
----------
IAPWS, Revised Sup... | [
"def",
"_Backward1_P_hs",
"(",
"h",
",",
"s",
")",
":",
"I",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"2",
",",
"2",
",",
"2",
",",
"3",
",",
... | Backward equation for region 1, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
References
----------
IAPWS, Revised Supplementary Release on Backward Equ... | [
"Backward",
"equation",
"for",
"region",
"1",
"P",
"=",
"f",
"(",
"h",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L896-L942 |
jjgomera/iapws | iapws/iapws97.py | _Region2 | def _Region2(T, P):
"""Basic equation for region 2
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
... | python | def _Region2(T, P):
"""Basic equation for region 2
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
... | [
"def",
"_Region2",
"(",
"T",
",",
"P",
")",
":",
"if",
"P",
"<",
"0",
":",
"P",
"=",
"Pmin",
"Tr",
"=",
"540",
"/",
"T",
"Pr",
"=",
"P",
"/",
"1",
"go",
",",
"gop",
",",
"gopp",
",",
"got",
",",
"gott",
",",
"gopt",
"=",
"Region2_cp0",
"(... | Basic equation for region 2
Parameters
----------
T : float
Temperature, [K]
P : float
Pressure, [MPa]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
* h: Specific ent... | [
"Basic",
"equation",
"for",
"region",
"2"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L946-L1053 |
jjgomera/iapws | iapws/iapws97.py | Region2_cp0 | def Region2_cp0(Tr, Pr):
"""Ideal properties for Region 2
Parameters
----------
Tr : float
Reduced temperature, [-]
Pr : float
Reduced pressure, [-]
Returns
-------
prop : array
Array with ideal Gibbs energy partial derivatives:
* g: Ideal Specific ... | python | def Region2_cp0(Tr, Pr):
"""Ideal properties for Region 2
Parameters
----------
Tr : float
Reduced temperature, [-]
Pr : float
Reduced pressure, [-]
Returns
-------
prop : array
Array with ideal Gibbs energy partial derivatives:
* g: Ideal Specific ... | [
"def",
"Region2_cp0",
"(",
"Tr",
",",
"Pr",
")",
":",
"Jo",
"=",
"[",
"0",
",",
"1",
",",
"-",
"5",
",",
"-",
"4",
",",
"-",
"3",
",",
"-",
"2",
",",
"-",
"1",
",",
"2",
",",
"3",
"]",
"no",
"=",
"[",
"-",
"0.96927686500217E+01",
",",
"... | Ideal properties for Region 2
Parameters
----------
Tr : float
Reduced temperature, [-]
Pr : float
Reduced pressure, [-]
Returns
-------
prop : array
Array with ideal Gibbs energy partial derivatives:
* g: Ideal Specific Gibbs energy [kJ/kg]
... | [
"Ideal",
"properties",
"for",
"Region",
"2"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1056-L1097 |
jjgomera/iapws | iapws/iapws97.py | _hab_s | def _hab_s(s):
"""Define the boundary between Region 2a and 2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equatio... | python | def _hab_s(s):
"""Define the boundary between Region 2a and 2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equatio... | [
"def",
"_hab_s",
"(",
"s",
")",
":",
"smin",
"=",
"_Region2",
"(",
"_TSat_P",
"(",
"4",
")",
",",
"4",
")",
"[",
"\"s\"",
"]",
"smax",
"=",
"_Region2",
"(",
"1073.15",
",",
"4",
")",
"[",
"\"s\"",
"]",
"if",
"s",
"<",
"smin",
":",
"h",
"=",
... | Define the boundary between Region 2a and 2b, h=f(s)
Parameters
----------
s : float
Specific entropy, [kJ/kgK]
Returns
-------
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for Pressure
as... | [
"Define",
"the",
"boundary",
"between",
"Region",
"2a",
"and",
"2b",
"h",
"=",
"f",
"(",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1154-L1188 |
jjgomera/iapws | iapws/iapws97.py | _Backward2_T_Ph | def _Backward2_T_Ph(P, h):
"""Backward equation for region 2, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
"""
if P <= 4:
T = _Backward2a_T_Ph(P, h)
e... | python | def _Backward2_T_Ph(P, h):
"""Backward equation for region 2, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
"""
if P <= 4:
T = _Backward2a_T_Ph(P, h)
e... | [
"def",
"_Backward2_T_Ph",
"(",
"P",
",",
"h",
")",
":",
"if",
"P",
"<=",
"4",
":",
"T",
"=",
"_Backward2a_T_Ph",
"(",
"P",
",",
"h",
")",
"elif",
"4",
"<",
"P",
"<=",
"6.546699678",
":",
"T",
"=",
"_Backward2b_T_Ph",
"(",
"P",
",",
"h",
")",
"e... | Backward equation for region 2, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K] | [
"Backward",
"equation",
"for",
"region",
"2",
"T",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1347-L1376 |
jjgomera/iapws | iapws/iapws97.py | _Backward2a_T_Ps | def _Backward2a_T_Ps(P, s):
"""Backward equation for region 2a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release on ... | python | def _Backward2a_T_Ps(P, s):
"""Backward equation for region 2a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release on ... | [
"def",
"_Backward2a_T_Ps",
"(",
"P",
",",
"s",
")",
":",
"I",
"=",
"[",
"-",
"1.5",
",",
"-",
"1.5",
",",
"-",
"1.5",
",",
"-",
"1.5",
",",
"-",
"1.5",
",",
"-",
"1.5",
",",
"-",
"1.25",
",",
"-",
"1.25",
",",
"-",
"1.25",
",",
"-",
"1.0"... | Backward equation for region 2a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Release on the IAPWS Industrial Formulation 19... | [
"Backward",
"equation",
"for",
"region",
"2a",
"T",
"=",
"f",
"(",
"P",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1379-L1436 |
jjgomera/iapws | iapws/iapws97.py | _Backward2_T_Ps | def _Backward2_T_Ps(P, s):
"""Backward equation for region 2, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
"""
if P <= 4:
T = _Backward2a_T_Ps(P, s)
e... | python | def _Backward2_T_Ps(P, s):
"""Backward equation for region 2, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
"""
if P <= 4:
T = _Backward2a_T_Ps(P, s)
e... | [
"def",
"_Backward2_T_Ps",
"(",
"P",
",",
"s",
")",
":",
"if",
"P",
"<=",
"4",
":",
"T",
"=",
"_Backward2a_T_Ps",
"(",
"P",
",",
"s",
")",
"elif",
"s",
">=",
"5.85",
":",
"T",
"=",
"_Backward2b_T_Ps",
"(",
"P",
",",
"s",
")",
"else",
":",
"T",
... | Backward equation for region 2, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K] | [
"Backward",
"equation",
"for",
"region",
"2",
"T",
"=",
"f",
"(",
"P",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1547-L1572 |
jjgomera/iapws | iapws/iapws97.py | _Backward2_P_hs | def _Backward2_P_hs(h, s):
"""Backward equation for region 2, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
"""
sfbc = 5.85
hamin = _hab_s(s)
if ... | python | def _Backward2_P_hs(h, s):
"""Backward equation for region 2, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
"""
sfbc = 5.85
hamin = _hab_s(s)
if ... | [
"def",
"_Backward2_P_hs",
"(",
"h",
",",
"s",
")",
":",
"sfbc",
"=",
"5.85",
"hamin",
"=",
"_hab_s",
"(",
"s",
")",
"if",
"h",
"<=",
"hamin",
":",
"P",
"=",
"_Backward2a_P_hs",
"(",
"h",
",",
"s",
")",
"elif",
"s",
">=",
"sfbc",
":",
"P",
"=",
... | Backward equation for region 2, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa] | [
"Backward",
"equation",
"for",
"region",
"2",
"P",
"=",
"f",
"(",
"h",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1739-L1762 |
jjgomera/iapws | iapws/iapws97.py | _Region3 | def _Region3(rho, T):
"""Basic equation for region 3
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/k... | python | def _Region3(rho, T):
"""Basic equation for region 3
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/k... | [
"def",
"_Region3",
"(",
"rho",
",",
"T",
")",
":",
"I",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"2",
",",
"2",
",",
"2",
",",
"2",
",",
"2",
",",
"2",... | Basic equation for region 3
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
prop : dict
Dict with calculated properties. The available properties are:
* v: Specific volume, [m³/kg]
* h: Specific ... | [
"Basic",
"equation",
"for",
"region",
"3"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1766-L1865 |
jjgomera/iapws | iapws/iapws97.py | _tab_P | def _tab_P(P):
"""Define the boundary between Region 3a-3b, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for Specific
Volum... | python | def _tab_P(P):
"""Define the boundary between Region 3a-3b, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for Specific
Volum... | [
"def",
"_tab_P",
"(",
"P",
")",
":",
"I",
"=",
"[",
"0",
",",
"1",
",",
"2",
",",
"-",
"1",
",",
"-",
"2",
"]",
"n",
"=",
"[",
"0.154793642129415e4",
",",
"-",
"0.187661219490113e3",
",",
"0.213144632222113e2",
",",
"-",
"0.191887498864292e4",
",",
... | Define the boundary between Region 3a-3b, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for Specific
Volume as a Function of Pre... | [
"Define",
"the",
"boundary",
"between",
"Region",
"3a",
"-",
"3b",
"T",
"=",
"f",
"(",
"P",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L1890-L1923 |
jjgomera/iapws | iapws/iapws97.py | _txx_P | def _txx_P(P, xy):
"""Define the boundary between 3x-3y, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
xy: string
Subregions options: cd, gh, ij, jk, mn, qu, rx, uv
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Rev... | python | def _txx_P(P, xy):
"""Define the boundary between 3x-3y, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
xy: string
Subregions options: cd, gh, ij, jk, mn, qu, rx, uv
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Rev... | [
"def",
"_txx_P",
"(",
"P",
",",
"xy",
")",
":",
"ng",
"=",
"{",
"\"cd\"",
":",
"[",
"0.585276966696349e3",
",",
"0.278233532206915e1",
",",
"-",
"0.127283549295878e-1",
",",
"0.159090746562729e-3",
"]",
",",
"\"gh\"",
":",
"[",
"-",
"0.249284240900418e5",
",... | Define the boundary between 3x-3y, T=f(P)
Parameters
----------
P : float
Pressure, [MPa]
xy: string
Subregions options: cd, gh, ij, jk, mn, qu, rx, uv
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release... | [
"Define",
"the",
"boundary",
"between",
"3x",
"-",
"3y",
"T",
"=",
"f",
"(",
"P",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2026-L2090 |
jjgomera/iapws | iapws/iapws97.py | _Backward3a_v_Ph | def _Backward3a_v_Ph(P, h):
"""Backward equation for region 3a, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for the
Functions T(p,h), v... | python | def _Backward3a_v_Ph(P, h):
"""Backward equation for region 3a, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for the
Functions T(p,h), v... | [
"def",
"_Backward3a_v_Ph",
"(",
"P",
",",
"h",
")",
":",
"I",
"=",
"[",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"10",
",",
"-",
"10",
",",
"-",
"10",
",",
"-",
"8",
",",
"-",
"8",
",",
"-",
"6",
",",
"-",
... | Backward equation for region 3a, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations for the
Functions T(p,h), v(p,h) and T(p,s), v(p,s) for Region... | [
"Backward",
"equation",
"for",
"region",
"3a",
"v",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2093-L2143 |
jjgomera/iapws | iapws/iapws97.py | _Backward3_v_Ph | def _Backward3_v_Ph(P, h):
"""Backward equation for region 3, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
v : float
Specific volume, [m³/kg]
"""
hf = _h_3ab(P)
if h <= hf:
retu... | python | def _Backward3_v_Ph(P, h):
"""Backward equation for region 3, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
v : float
Specific volume, [m³/kg]
"""
hf = _h_3ab(P)
if h <= hf:
retu... | [
"def",
"_Backward3_v_Ph",
"(",
"P",
",",
"h",
")",
":",
"hf",
"=",
"_h_3ab",
"(",
"P",
")",
"if",
"h",
"<=",
"hf",
":",
"return",
"_Backward3a_v_Ph",
"(",
"P",
",",
"h",
")",
"else",
":",
"return",
"_Backward3b_v_Ph",
"(",
"P",
",",
"h",
")"
] | Backward equation for region 3, v=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
v : float
Specific volume, [m³/kg] | [
"Backward",
"equation",
"for",
"region",
"3",
"v",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2198-L2217 |
jjgomera/iapws | iapws/iapws97.py | _Backward3a_T_Ph | def _Backward3a_T_Ph(P, h):
"""Backward equation for region 3a, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementa... | python | def _Backward3a_T_Ph(P, h):
"""Backward equation for region 3a, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementa... | [
"def",
"_Backward3a_T_Ph",
"(",
"P",
",",
"h",
")",
":",
"I",
"=",
"[",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"12",
",",
"-",
"10",
",",
"-",
"10",
",",
"-... | Backward equation for region 3a, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations fo... | [
"Backward",
"equation",
"for",
"region",
"3a",
"T",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2220-L2270 |
jjgomera/iapws | iapws/iapws97.py | _Backward3_T_Ph | def _Backward3_T_Ph(P, h):
"""Backward equation for region 3, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
"""
hf = _h_3ab(P)
if h <= hf:
T = _Backwar... | python | def _Backward3_T_Ph(P, h):
"""Backward equation for region 3, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K]
"""
hf = _h_3ab(P)
if h <= hf:
T = _Backwar... | [
"def",
"_Backward3_T_Ph",
"(",
"P",
",",
"h",
")",
":",
"hf",
"=",
"_h_3ab",
"(",
"P",
")",
"if",
"h",
"<=",
"hf",
":",
"T",
"=",
"_Backward3a_T_Ph",
"(",
"P",
",",
"h",
")",
"else",
":",
"T",
"=",
"_Backward3b_T_Ph",
"(",
"P",
",",
"h",
")",
... | Backward equation for region 3, T=f(P,h)
Parameters
----------
P : float
Pressure, [MPa]
h : float
Specific enthalpy, [kJ/kg]
Returns
-------
T : float
Temperature, [K] | [
"Backward",
"equation",
"for",
"region",
"3",
"T",
"=",
"f",
"(",
"P",
"h",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2326-L2346 |
jjgomera/iapws | iapws/iapws97.py | _Backward3_v_Ps | def _Backward3_v_Ps(P, s):
"""Backward equation for region 3, v=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
v : float
Specific volume, [m³/kg]
"""
if s <= sc:
return _Backward3a_v_Ps... | python | def _Backward3_v_Ps(P, s):
"""Backward equation for region 3, v=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
v : float
Specific volume, [m³/kg]
"""
if s <= sc:
return _Backward3a_v_Ps... | [
"def",
"_Backward3_v_Ps",
"(",
"P",
",",
"s",
")",
":",
"if",
"s",
"<=",
"sc",
":",
"return",
"_Backward3a_v_Ps",
"(",
"P",
",",
"s",
")",
"else",
":",
"return",
"_Backward3b_v_Ps",
"(",
"P",
",",
"s",
")"
] | Backward equation for region 3, v=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
v : float
Specific volume, [m³/kg] | [
"Backward",
"equation",
"for",
"region",
"3",
"v",
"=",
"f",
"(",
"P",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2454-L2472 |
jjgomera/iapws | iapws/iapws97.py | _Backward3a_T_Ps | def _Backward3a_T_Ps(P, s):
"""Backward equation for region 3a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementa... | python | def _Backward3a_T_Ps(P, s):
"""Backward equation for region 3a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementa... | [
"def",
"_Backward3a_T_Ps",
"(",
"P",
",",
"s",
")",
":",
"I",
"=",
"[",
"-",
"12",
",",
"-",
"12",
",",
"-",
"10",
",",
"-",
"10",
",",
"-",
"10",
",",
"-",
"10",
",",
"-",
"8",
",",
"-",
"8",
",",
"-",
"8",
",",
"-",
"8",
",",
"-",
... | Backward equation for region 3a, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
References
----------
IAPWS, Revised Supplementary Release on Backward Equations fo... | [
"Backward",
"equation",
"for",
"region",
"3a",
"T",
"=",
"f",
"(",
"P",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2475-L2525 |
jjgomera/iapws | iapws/iapws97.py | _Backward3_T_Ps | def _Backward3_T_Ps(P, s):
"""Backward equation for region 3, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
"""
sc = 4.41202148223476
if s <= sc:
T = _... | python | def _Backward3_T_Ps(P, s):
"""Backward equation for region 3, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K]
"""
sc = 4.41202148223476
if s <= sc:
T = _... | [
"def",
"_Backward3_T_Ps",
"(",
"P",
",",
"s",
")",
":",
"sc",
"=",
"4.41202148223476",
"if",
"s",
"<=",
"sc",
":",
"T",
"=",
"_Backward3a_T_Ps",
"(",
"P",
",",
"s",
")",
"else",
":",
"T",
"=",
"_Backward3b_T_Ps",
"(",
"P",
",",
"s",
")",
"return",
... | Backward equation for region 3, T=f(P,s)
Parameters
----------
P : float
Pressure, [MPa]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
T : float
Temperature, [K] | [
"Backward",
"equation",
"for",
"region",
"3",
"T",
"=",
"f",
"(",
"P",
"s",
")"
] | train | https://github.com/jjgomera/iapws/blob/1e5812aab38212fb8a63736f61cdcfa427d223b1/iapws/iapws97.py#L2580-L2600 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.