Skip to content

Commit 6913fc4

Browse files
jmarrecibell
authored andcommitted
Format macros, they keep getting picked incrementally by clang format + Strip trailing whitespaces
``` find . -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx|py)$' | xargs -I@ sed -i 's/[ \t]*$//' "@" ```
1 parent a7a3c84 commit 6913fc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+486
-415
lines changed

Web/scripts/CPWeb/SphinxTools.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
:widths: 40, 60
2424
:delim: ;
2525
:file: {fluid:s}-info.csv
26-
26+
2727
REFPROP Validation Data
2828
=======================
2929
3030
.. note::
3131
3232
This figure compares the results generated from CoolProp and those generated from REFPROP. They are all results obtained in the form :math:`Y(T,\\rho)`, where :math:`Y` is the parameter of interest and which for all EOS is a direct evaluation of the EOS
33-
34-
You can download the script that generated the following figure here: :download:`(link to script)<REFPROPplots/{fluid:s}.py>`, right-click the link and then save as... or the equivalent in your browser. You can also download this figure :download:`as a PDF<REFPROPplots/{fluid:s}.pdf>`.
33+
34+
You can download the script that generated the following figure here: :download:`(link to script)<REFPROPplots/{fluid:s}.py>`, right-click the link and then save as... or the equivalent in your browser. You can also download this figure :download:`as a PDF<REFPROPplots/{fluid:s}.pdf>`.
3535
3636
.. image:: REFPROPplots/{fluid:s}.png
3737
@@ -44,7 +44,7 @@
4444
4545
.. note::
4646
47-
You can download the script that generated the following figure here: :download:`(link to script)<Consistencyplots/{fluid:s}.py>`, right-click the link and then save as... or the equivalent in your browser. You can also download this figure :download:`as a PDF<Consistencyplots/{fluid:s}.pdf>`.
47+
You can download the script that generated the following figure here: :download:`(link to script)<Consistencyplots/{fluid:s}.py>`, right-click the link and then save as... or the equivalent in your browser. You can also download this figure :download:`as a PDF<Consistencyplots/{fluid:s}.pdf>`.
4848
4949
.. image:: Consistencyplots/{fluid:s}.png
5050
@@ -218,7 +218,7 @@ def write(self, path):
218218
ITG.write(path)
219219

220220
del_old = CP.get_config_string(CP.LIST_STRING_DELIMITER)
221-
221+
222222
CP.set_config_string(CP.LIST_STRING_DELIMITER, '|')
223223
try:
224224
aliases = ', '.join(['``' + a.strip() + '``' for a in CoolProp.CoolProp.get_fluid_param_string(self.fluid, 'aliases').strip().split('|') if a])

dev/Tickets/1820.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
T = HAPropsSI('T','P',101325,'H',h,'R',1.0); print(T)
66
T = HAPropsSI('T','H',h,'R',1.0,'P',101325); print(T)
77

8-
# Verification script
8+
# Verification script
99
import CoolProp.CoolProp as CP
1010
import numpy as np
1111
import itertools

dev/environmental_data_from_DTU/build_DTU_JSON.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
HEPTANE heptane n-Heptane 540.13 * * * - - - 2.58 0.5 0.5 0.592 - - - - - - - - -
5959
HEXANE hexane n-Hexane 507.82 * 3.1 * - - - 2.57 0.5 0.4 0.495 4.94E-01 - - - - - - - - -
6060
HYDROGEN Hydrogen 33.145 R-702 - - - - - - N/A - - - 4.94E-01 - - - - - - - - -
61-
IBUTENE 2-methyl-1-propene/methylpropene/isobutene/isobutylene Isobutene 418.09 * * * - - - N/A 0.6 0.6 6.27E-01 - - - - - - 6.67E+04
61+
IBUTENE 2-methyl-1-propene/methylpropene/isobutene/isobutylene Isobutene 418.09 * * * - - - N/A 0.6 0.6 6.27E-01 - - - - - - 6.67E+04
6262
IHEXANE 2-methylpentane (methylpentane) Isohexane 497.7 * * * - - - N/A - - - - - - - - - - - -
6363
IPENTANE 2-methylbutane Isopentane 460.35 * * * - - - 1.8 0.3 0.3 4.05E-01 - - - - - - - - -
6464
ISOBUTAN 2-methylpropane IsoButane 407.817 * * * - - - 1.74 0.4 0.3 3.07E-01 - - - - - - - - -
@@ -246,7 +246,7 @@
246246
:'1','1','1','NA','2',
247247
:'1','NA','1','NA','2',
248248
:'NA','1','1','1','1',
249-
:'3','0','2','0','0',
249+
:'3','0','2','0','0',
250250
:'1','1','NA','NA','NA','1',
251251
:'1','1','1','2','1','1',
252252
:'1','1','1','1'"""
@@ -269,7 +269,7 @@
269269
:'1','1','1','NA','1',
270270
:'0','NA','0','NA','0',
271271
:'NA','1','2','2','0',
272-
:'0','4','3','0','0',
272+
:'0','4','3','0','0',
273273
:'1','1','NA','NA','NA','1',
274274
:'1','0','0','1','1','4',
275275
:'1','1','1','0' """
@@ -292,7 +292,7 @@
292292
:'0','0','0','NA','1',
293293
:'0','NA','1','NA','1',
294294
:'NA','0','0','0','0',
295-
:'0','1','0','0','3',
295+
:'0','1','0','0','3',
296296
:'0','0','NA','NA','NA','0',
297297
:'0','0','0','0','0','1',
298298
:'0','0','0','2'"""

dev/incompressible_liquids/CPIncomp/WriterObjects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def default(self, obj):
393393
# Let the base class default method raise the TypeError
394394
return json.JSONEncoder.default(self, obj)
395395
dump = json.dumps(jobj, indent=2, sort_keys=True, cls=RoundingEncoder)
396-
396+
397397

398398
# print dump
399399
hashes = self.load_hashes()

dev/scripts/ECS_fitter.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ def arrayize(*args):
6262

6363
def HFO():
6464
# Data from Zhao et al. dx.doi.org/10.1021/je5001457 | J. Chem. Eng. Data 2014, 59, 1366-1371
65-
data_R1234yf = """293.15 1109.9 32.8 12.04 0.1442 6.82
66-
303.09 1073.5 43.6 12.53 0.1319 5.71
67-
313.20 1033.6 57.8 13.16 0.1223 4.60
68-
323.19 990.2 76.0 13.88 0.1126 3.55
69-
333.14 941.4 99.7 14.82 0.1016 2.55
70-
343.11 883.5 132.2 16.12 0.0899 1.64
71-
353.08 809.6 179.9 18.17 0.0820 0.81
72-
358.05 761.5 214.8 19.78 0.0770 0.46
73-
363.05 695.7 267.7 22.44 0.0700 0.15
65+
data_R1234yf = """293.15 1109.9 32.8 12.04 0.1442 6.82
66+
303.09 1073.5 43.6 12.53 0.1319 5.71
67+
313.20 1033.6 57.8 13.16 0.1223 4.60
68+
323.19 990.2 76.0 13.88 0.1126 3.55
69+
333.14 941.4 99.7 14.82 0.1016 2.55
70+
343.11 883.5 132.2 16.12 0.0899 1.64
71+
353.08 809.6 179.9 18.17 0.0820 0.81
72+
358.05 761.5 214.8 19.78 0.0770 0.46
73+
363.05 695.7 267.7 22.44 0.0700 0.15
7474
365.05 657.4 301.0 24.26 0.0624 0.05"""
7575

7676
# Data from Zhao et al. dx.doi.org/10.1021/je5001457 | J. Chem. Eng. Data 2014, 59, 1366-1371
77-
data_R1234zeE = """295.23 1172.5 24.1 12.11 0.1776 8.88
78-
303.19 1146.1 30.6 12.46 0.1607 7.91
79-
313.21 1111.1 40.8 12.93 0.1429 6.66
80-
323.19 1073.6 53.6 13.46 0.1319 5.48
81-
333.00 1033.3 69.8 14.06 0.1193 4.36
82-
343.05 986.7 91.3 14.82 0.1132 3.30
83-
353.00 924.0 119.7 15.80 0.1051 2.26
84-
363.12 866.8 160.4 17.28 0.0924 1.35
77+
data_R1234zeE = """295.23 1172.5 24.1 12.11 0.1776 8.88
78+
303.19 1146.1 30.6 12.46 0.1607 7.91
79+
313.21 1111.1 40.8 12.93 0.1429 6.66
80+
323.19 1073.6 53.6 13.46 0.1319 5.48
81+
333.00 1033.3 69.8 14.06 0.1193 4.36
82+
343.05 986.7 91.3 14.82 0.1132 3.30
83+
353.00 924.0 119.7 15.80 0.1051 2.26
84+
363.12 866.8 160.4 17.28 0.0924 1.35
8585
373.14 776.9 225.2 19.89 0.0817 0.54"""
8686

8787
for fluid, data, e_k, sigma_nm in zip(['R1234yf', 'R1234ze(E)'], [data_R1234yf, data_R1234zeE], [281.14, 292.11], [0.5328, 0.5017]):
@@ -126,14 +126,14 @@ def HFO():
126126
def pentanes():
127127
# from doi 10.1021/je0202174 | J. Chem. Eng. Data 2003, 48, 1418-1421
128128
# T (K), rhoL (kg/m^3), rhoV (kg/m^3), eta (mPa-s)
129-
data_cyclopentane = """253.15 258.15 263.15 268.15 273.15 278.15 283.15 288.15 293.15 298.15 303.15 308.15 313.15 318.15 323.15 328.15 333.15 338.15 343.15 348.15 353.15
129+
data_cyclopentane = """253.15 258.15 263.15 268.15 273.15 278.15 283.15 288.15 293.15 298.15 303.15 308.15 313.15 318.15 323.15 328.15 333.15 338.15 343.15 348.15 353.15
130130
784.64 779.53 774.59 769.77 765.12 760.20 755.32 750.27 745.02 738.63 731.97 725.15 718.32 711.59 705.11 699.08 693.40 688.44 684.25 680.96 678.71
131131
0.0881 0.1127 0.1443 0.1848 0.2368 0.3036 0.3894 0.4999 0.6421 0.8255 1.062 1.368 1.764 2.279 2.950 3.827 4.980 6.509 8.554 11.33 15.20
132132
0.7268 0.6786 0.6347 0.5930 0.5567 0.5224 0.4922 0.4646 0.4382 0.4148 0.3923 0.3714 0.3521 0.3350 0.3190 0.3048 0.2912 0.2793 0.2690 0.2590 0.2502"""
133133

134134
# from doi 10.1021/je0202174 | J. Chem. Eng. Data 2003, 48, 1418-1421
135135
# T (K), rhoL (kg/m^3), rhoV (kg/m^3), eta (mPa-s)
136-
data_isopentane = """253.15 258.15 263.15 268.15 273.15 278.15 283.15 288.15 293.15 298.15 303.15 308.15 313.15 318.15 323.15 328.15 333.15 338.15 343.15 348.15 353.15
136+
data_isopentane = """253.15 258.15 263.15 268.15 273.15 278.15 283.15 288.15 293.15 298.15 303.15 308.15 313.15 318.15 323.15 328.15 333.15 338.15 343.15 348.15 353.15
137137
658.32 653.55 648.73 643.87 639.01 634.15 629.35 624.63 620.05 615.69 610.87 605.63 600.05 594.23 588.24 582.18 576.13 570.18 564.41 558.92 553.79
138138
0.4655 0.5889 0.7372 0.9137 1.122 1.366 1.650 1.979 2.356 2.788 3.278 3.833 4.459 5.162 5.949 6.827 7.803 8.886 10.09 11.41 12.87
139139
0.3893 0.3661 0.3439 0.3201 0.3023 0.2859 0.2703 0.2547 0.2399 0.2289 0.2144 0.2023 0.1910 0.1813 0.1724 0.1611 0.1543 0.1480 0.1411 0.1332 0.1287"""

dev/scripts/fit_shape_factor.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -161,35 +161,35 @@ def write_output(c, d, theta_MAE, phi_MAE):
161161
template = textwrap.dedent(
162162
"""
163163
double {name:s}Class::viscosity_Trho(double T, double rho)
164-
{{
164+
{{
165165
/*
166166
Fitting of shape factor curves to R134a data. This method is employed because solving
167167
for the shape factors is computationally very expensive and not very nice
168168
convergence behavior is experienced. Thus we can use the ECS method,
169169
but with about the execution time of a conventional viscosity correlation.
170-
171-
This function code was automatically generated by the fit_shape_factor.py
170+
171+
This function code was automatically generated by the fit_shape_factor.py
172172
script in the dev/ folder on {timestamp:s}
173-
173+
174174
Mean absolute errors of shape factor prediction:
175175
theta = {theta_MAE:g} %
176176
phi = {phi_MAE:g} %
177177
*/
178-
179-
double e_k, sigma, tau, delta, A1, A2, A3, A4, theta, Tc, Tc0, T0, rho0;
178+
179+
double e_k, sigma, tau, delta, A1, A2, A3, A4, theta, Tc, Tc0, T0, rho0;
180180
double DELTA, PSI_theta, psi, f, h, F_eta, M, M0, delta_omega, rho0bar;
181181
double B1, B2, B3, B4, PSI_phi, Zc, Zc0, rhoc0, rhoc, log_tau, phi, rhobar;
182-
182+
183183
double c[] = {{{cdata:s}}};
184184
double d[] = {{{ddata:s}}};
185-
185+
186186
tau = reduce.T/T;
187187
delta = rho/reduce.rho;
188-
188+
189189
R134aClass R134a = R134aClass();
190190
R134a.post_load();
191191
delta_omega = params.accentricfactor-R134a.params.accentricfactor;
192-
192+
193193
Zc = reduce.p/(reduce.rho*R()*reduce.T);
194194
Zc0 = R134a.reduce.p/(R134a.reduce.rho*R134a.R()*R134a.reduce.T);
195195
Tc = reduce.T;
@@ -198,21 +198,21 @@ def write_output(c, d, theta_MAE, phi_MAE):
198198
rhoc0 = R134a.reduce.rho;
199199
M = params.molemass;
200200
M0 = R134a.params.molemass;
201-
201+
202202
rhobar = rho/M;
203-
203+
204204
if (rho > {rhomin:g})
205205
{{
206206
DELTA = pow(delta-1,2)+pow(tau-1,2);
207207
log_tau = log(tau);
208-
208+
209209
A1 = c[0]-c[1]*log_tau;
210210
A2 = c[2]-c[3]*log_tau;
211211
A3 = c[4]-c[5]*log_tau;
212212
A4 = c[6]-c[7]*pow(log_tau,2);
213213
PSI_theta = c[8]*delta*exp(-c[9]*pow(DELTA,2));
214214
theta = 1+(delta_omega)*(A1+A2*exp(-pow(delta,2))+A3*exp(-pow(delta,c[10]))+A4*exp(-pow(delta,c[11]))+PSI_theta);
215-
215+
216216
B1 = d[0]-d[1]*log_tau;
217217
B2 = d[2]-d[3]*log_tau;
218218
B3 = d[4]-d[5]*log_tau;
@@ -229,13 +229,13 @@ def write_output(c, d, theta_MAE, phi_MAE):
229229
h = M/M0*rhoc0/rhoc*phi;
230230
rho0bar = rhobar*h;
231231
rho0 = M0*rho0bar;
232-
232+
233233
psi = ECS_psi_viscosity(delta);
234234
f = T/T0;
235235
F_eta = sqrt(f)*pow(h,-2.0/3.0)*sqrt(M/M0);
236236
ECSParams(&e_k,&sigma);
237237
return viscosity_dilute(T,e_k,sigma) + R134a.viscosity_background(T0,rho0*psi)*F_eta;
238-
}}
238+
}}
239239
"""
240240
)
241241

dev/scripts/inject_states.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def inject_acentric(fluid, i, json_data):
117117
def inject_states(fluid):
118118
fluid_path = '../fluids/' + fluid + '.json'
119119

120-
# AS =
120+
# AS =
121121

122122
# Open the fluid JSON file
123123
with open(fluid_path, 'r') as fp:
@@ -137,7 +137,7 @@ def inject_states(fluid):
137137
fp.write(json.dumps(json_data, **json_options))
138138

139139
if __name__ == '__main__':
140-
141-
140+
141+
142142
for fld in ['MD2M','MD3M','MD4M','R1243zf','R1234ze(Z)','Neon','HydrogenChloride','HeavyWater']:
143143
inject_states(fld)

dev/scripts/set_reference_state.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_offset_NBP(name):
2020
import json
2121
a1, a2 = get_offset_NBP(name)
2222
print(json.dumps({
23-
"a1": a1,
24-
"a2": a2,
23+
"a1": a1,
24+
"a2": a2,
2525
"type": "IdealGasHelmholtzLead"
2626
}, indent=2))

include/Ancillaries.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ class SurfaceTensionCorrelation
5858
}
5959
};
6060
/**
61-
*
62-
* This is generalized class that can be used to manage an ancillary curve,
61+
*
62+
* This is generalized class that can be used to manage an ancillary curve,
6363
* here they are ancillary curves for saturation pressure, density, enthalpy, entropy.
64-
*
64+
*
6565
* The form of the ancillary equation can take one of a number of forms:
66-
*
66+
*
6767
* a) So-called "exponential" form (type = TYPE_EXPONENTIAL) that has a form like
68-
*
69-
* \f[ y = y_c\exp\left(\frac{T_c}{T}\sum(n_i \theta^{t_i})\right) \f]
70-
* or
68+
*
69+
* \f[ y = y_c\exp\left(\frac{T_c}{T}\sum(n_i \theta^{t_i})\right) \f]
70+
* or
7171
* \f[ y = y_c\exp\left(\sum(n_i \theta^{t_i})\right) \f]
72-
*
72+
*
7373
* b) A non-exponential form (type = TYPE_NOT_EXPONENTIAL) that has a form of
7474
*
7575
* \f[ y = y_c\left(1+\sum_i(n_i\theta^t_i)\right) \f]
7676
* with
7777
* \f[ \theta = \left(1-\frac{T}{T_c}\right) \f]
7878
* which is conveniently equal to zero at the critical point
79-
*
79+
*
8080
* c) Rational polynomial form (type = TYPE_RATIONAL_POLYNOMIAL) that has a form of
8181
* \f[ y = \frac{\sum_iA_iT^i}{\sum_iB_iT^i}\f]
8282
* where i is an integer, and the coefficients are in increasing order in both numerator and denominator
@@ -190,7 +190,7 @@ struct MeltingLinePiecewisePolynomialInTrData
190190
std::vector<MeltingLinePiecewisePolynomialInTrSegment> parts;
191191
};
192192

193-
/**
193+
/**
194194
\brief The evaluator class for a melting curve formed of segments in the form
195195
196196
\f[
@@ -242,7 +242,7 @@ class MeltingLineVariables
242242

243243
MeltingLineVariables() : Tmin(_HUGE), Tmax(_HUGE), pmin(_HUGE), pmax(_HUGE), T_m(_HUGE), type(MELTING_LINE_NOT_SET){};
244244

245-
/**
245+
/**
246246
* \brief Evaluate the melting line
247247
* @param OF The output variable
248248
* @param GIVEN The given variable

include/CPnumerics.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ std::vector<T> logspace(T xmin, T xmax, std::size_t n) {
212212

213213
/**
214214
* @brief Use bisection to find the inputs that bisect the value you want, the trick
215-
* here is that this function is allowed to have "holes" where parts of the the array are
215+
* here is that this function is allowed to have "holes" where parts of the the array are
216216
* also filled with invalid numbers for which ValidNumber(x) is false
217217
* @param vec The vector to be bisected
218218
* @param val The value to be found
@@ -291,7 +291,7 @@ void bisect_vector(const std::vector<T>& vec, T val, std::size_t& i) {
291291

292292
/**
293293
* @brief Use bisection to find the inputs that bisect the value you want, the trick
294-
* here is that this function is allowed to have "holes" where parts of the the array are
294+
* here is that this function is allowed to have "holes" where parts of the the array are
295295
* also filled with invalid numbers for which ValidNumber(x) is false
296296
* @param matrix The vector to be bisected
297297
* @param j The index of the matric in the off-grain dimension
@@ -553,9 +553,9 @@ T is_in_closed_range(T x1, T x2, T x) {
553553
};
554554

555555
/** \brief Solve a cubic with coefficients in decreasing order
556-
*
556+
*
557557
* 0 = ax^3 + b*x^2 + c*x + d
558-
*
558+
*
559559
* @param a The x^3 coefficient
560560
* @param b The x^2 coefficient
561561
* @param c The x^1 coefficient
@@ -649,10 +649,10 @@ void sort3(T& a, T& b, T& c) {
649649
* Due to the periodicity of angles, you need to handle the case where the
650650
* angles wrap around - suppose theta_d is 6.28 and you are at an angles of 0.1 rad,
651651
* the difference should be around 0.1, not -6.27
652-
*
652+
*
653653
* This brilliant method is from http://blog.lexique-du-net.com/index.php?post/Calculate-the-real-difference-between-two-angles-keeping-the-sign
654654
* and the comment of user tk
655-
*
655+
*
656656
* Originally implemented in PDSim
657657
*/
658658
template <class T>

include/Configuration.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* See http://stackoverflow.com/questions/147267/easy-way-to-use-variables-of-enum-types-as-string-in-c#202511
1313
* This will be used to generate an enum like:
1414
* enum configuration_keys {NORMALIZE_GAS_CONSTANTS, CRITICAL_SPLINES_ENABLED};
15-
*
15+
*
1616
* The values in this list are given by:
1717
* enum, string representation of enum, default value, description
18-
*
18+
*
1919
* The type of the default value specifies the only type that will be accepted for this parameter
2020
*/
2121
#define CONFIGURATION_KEYS_ENUM \

0 commit comments

Comments
 (0)