cfdpre 0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cfdpre-0.1/PKG-INFO ADDED
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: cfdpre
3
+ Version: 0.1
4
+ Summary: CFD PreProcessing Library
5
+ Author: Pushkar Sheth
6
+ Author-email: siglyserdev@gmail.com
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: numpy
9
+ Requires-Dist: CoolProp
10
+
11
+ # CFD-Pre
12
+ CFD PreProcessing Library.
13
+
14
+ Provides the following functionality:
15
+ 1. Calculate Boundary Layer Mesh dimensions.
16
+
17
+
18
+
19
+
20
+ ## Project Log
21
+ January 2025:
22
+ 1. Created Library
23
+
24
+
25
+ ## Project Road Map:
26
+
27
+ 1. Documentation for existing functionality.
28
+ 2. Include example data within library.
cfdpre-0.1/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # CFD-Pre
2
+ CFD PreProcessing Library.
3
+
4
+ Provides the following functionality:
5
+ 1. Calculate Boundary Layer Mesh dimensions.
6
+
7
+
8
+
9
+
10
+ ## Project Log
11
+ January 2025:
12
+ 1. Created Library
13
+
14
+
15
+ ## Project Road Map:
16
+
17
+ 1. Documentation for existing functionality.
18
+ 2. Include example data within library.
@@ -0,0 +1,3 @@
1
+ # __init__.py
2
+
3
+ from .main import yhgrcalc
@@ -0,0 +1,99 @@
1
+ # main.py
2
+
3
+
4
+ import numpy as np
5
+ import CoolProp.CoolProp as CP
6
+
7
+
8
+
9
+ def calculate_f(r, N, delta99, yH):
10
+
11
+ """Calculates the function f(r) for root finding."""
12
+
13
+ return r**N - r * (delta99 / yH) + (delta99 / yH - 1)
14
+
15
+
16
+
17
+ def calculate_df_dr(r, N, delta99, yH):
18
+
19
+ """Calculates the derivative of f(r) with respect to r."""
20
+
21
+ return N * r**(N-1) - (delta99 / yH)
22
+
23
+
24
+
25
+ def newton_raphson(N, delta99, yH, initial_guess=5, tolerance=1e-12, max_iterations=1000):
26
+
27
+ """Finds the growth ratio using the Newton-Raphson method."""
28
+
29
+ r = initial_guess
30
+
31
+ for _ in range(max_iterations):
32
+
33
+ f_r = calculate_f(r, N, delta99, yH)
34
+
35
+ df_dr = calculate_df_dr(r, N, delta99, yH)
36
+
37
+ r_new = r - f_r / df_dr
38
+
39
+
40
+ if np.abs(r_new - r) < tolerance:
41
+
42
+ return r_new
43
+
44
+ r = r_new
45
+
46
+ return r
47
+
48
+
49
+
50
+
51
+ def yhgrcalc(fluid, temperature_c, pressure_bar, massflow_kgpersec, hydraulicdia_mm, target_yplus, num_layers):
52
+
53
+ pressure_pa = pressure_bar * 1e5
54
+ hydraulicdia_m = hydraulicdia_mm/1000
55
+ temperature_k = temperature_c + 273.15
56
+
57
+ dynvisc_pas = CP.PropsSI('V', 'T', temperature_k, 'P', pressure_pa, fluid)
58
+ dynvisc_nsm2 = dynvisc_pas
59
+
60
+ thermal_conductivity_wpermk = CP.PropsSI('L', 'T', temperature_k, 'P', pressure_pa, fluid)
61
+ specific_heat_cp_jperkgk = CP.PropsSI('C', 'T', temperature_k, 'P', pressure_pa, fluid)
62
+ density_kgperm3 = CP.PropsSI('D', 'T', temperature_k, 'P', pressure_pa, fluid)
63
+ kinevisc_m2s = dynvisc_nsm2 / density_kgperm3
64
+ volflowrate_m3persec = massflow_kgpersec / density_kgperm3
65
+ flowvelocity_mpersec = volflowrate_m3persec / ((np.pi/4) * np.power(hydraulicdia_m, 2))
66
+ reynolds = flowvelocity_mpersec * hydraulicdia_m / kinevisc_m2s
67
+ prandtl = specific_heat_cp_jperkgk * dynvisc_nsm2 / thermal_conductivity_wpermk
68
+ cf = np.power(((2 * np.log10(reynolds)- 0.65)), (-2.3)) # skin friction coefficient
69
+ tau_wall = 0.5 * density_kgperm3 * np.square(flowvelocity_mpersec) * cf # wall shear stress
70
+ u_tau = np.sqrt(tau_wall/density_kgperm3) #friction velocity
71
+ yp_m = (target_yplus * dynvisc_nsm2) /(u_tau * density_kgperm3)
72
+ yh_m = yp_m * 2
73
+
74
+
75
+
76
+
77
+ if reynolds < 5e5:
78
+
79
+ delta99 = 4.91 * hydraulicdia_m / np.sqrt(reynolds)
80
+
81
+ else:
82
+
83
+ delta99 = 0.38 * hydraulicdia_m * reynolds**(-1/5)
84
+
85
+
86
+ growth_ratio = newton_raphson(num_layers, delta99, yh_m)
87
+ final_layer_thickness_m = yh_m * growth_ratio**(num_layers - 1)
88
+ propdict = [density_kgperm3, specific_heat_cp_jperkgk, thermal_conductivity_wpermk, dynvisc_nsm2]
89
+
90
+ return yh_m, growth_ratio, final_layer_thickness_m, reynolds, propdict
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: cfdpre
3
+ Version: 0.1
4
+ Summary: CFD PreProcessing Library
5
+ Author: Pushkar Sheth
6
+ Author-email: siglyserdev@gmail.com
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: numpy
9
+ Requires-Dist: CoolProp
10
+
11
+ # CFD-Pre
12
+ CFD PreProcessing Library.
13
+
14
+ Provides the following functionality:
15
+ 1. Calculate Boundary Layer Mesh dimensions.
16
+
17
+
18
+
19
+
20
+ ## Project Log
21
+ January 2025:
22
+ 1. Created Library
23
+
24
+
25
+ ## Project Road Map:
26
+
27
+ 1. Documentation for existing functionality.
28
+ 2. Include example data within library.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ cfdpre/__init__.py
4
+ cfdpre/main.py
5
+ cfdpre.egg-info/PKG-INFO
6
+ cfdpre.egg-info/SOURCES.txt
7
+ cfdpre.egg-info/dependency_links.txt
8
+ cfdpre.egg-info/requires.txt
9
+ cfdpre.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ numpy
2
+ CoolProp
@@ -0,0 +1 @@
1
+ cfdpre
cfdpre-0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
cfdpre-0.1/setup.py ADDED
@@ -0,0 +1,25 @@
1
+ # setup.py
2
+
3
+ from setuptools import setup, find_packages
4
+
5
+ with open("README.md", "r") as f:
6
+ description = f.read()
7
+
8
+
9
+ setup(
10
+ name='cfdpre',
11
+ version='0.1',
12
+ description='CFD PreProcessing Library',
13
+ author='Pushkar Sheth',
14
+ author_email='siglyserdev@gmail.com',
15
+ packages=find_packages(),
16
+ install_requires=[
17
+ 'numpy',
18
+ 'CoolProp'
19
+
20
+
21
+ ],
22
+
23
+ long_description=description,
24
+ long_description_content_type="text/markdown",
25
+ )