polytex.misc
Module contents
- polytex.misc.cai_berdichevsky(vf, rf, packing='Quad', tensorial=False)[source]
Calculate the fiber tow permeability for a given fiber packing pattern according to cai’s model.
\[\begin{split}K_L = & 0.211 r^2\left(\left(V_a-0.605\right)\left(\frac{0.907 V_f}{V_a}\right)^{(-0.181)} *\left(\frac{1-0.907 V_f}{V_a}\right)^{(2.66)}\right. \\ & \left.+0.292\left(0.907-V_a\right)\left(V_f\right)^{(-1.57)}\left(1-V_f\right)^{(1.55)}\right) \\ K_T = & 0.229 r^2\left(\frac{1.814}{V_a}-1\right)\left(\frac{\left(1-\sqrt{\frac{V_f}{V_a}}\right)}{\sqrt{\frac{V_f}{V_a}}}\right)^{2.5}\end{split}\]- Parameters
- vffloat or array_like
Fiber volume fraction.
- rffloat or array_like
Fiber radius (m). If vf and rf are arrays, they must have the same shape.
- packingstring
Fiber packing pattern. Valid options are “Quad” and “Hex”.
- tensorialbool
If True, return the permeability tensor (a list with 9 elements). Otherwise, return the permeability components that parallel and perpendicular to the fiber tow as a list of 3 floats. The default is False.
- Returns
- karray-like
Fiber tow permeability. If tensorial is True, return a list with 9 elements. Otherwise, return a list of 3 floats (k11, k22, k33), corresponding to the permeability components that parallel and perpendicular to the fiber tow. The units are m^2. Note that the principal permeability components k22 and k33 are equal.
References
Cai, Z. and A. Berdichevsky, An improved self‐consistent method for estimating the permeability of a fiber assembly. Polymer composites, 1993. 14(4): p. 314-323
Examples
>>> rf = 6.5e-6 >>> k = cai_berdichevsky(vf=0.3, rf=rf, packing='Hex') >>> k / rf**2 array([[0.04415829, 0.10741589, 0.10741589]]) >>> k = cai_berdichevsky(vf=0.7, rf=rf, packing='Hex') >>> k / rf**2 array([[0.00604229, 0.00162723, 0.00162723]]) >>> k = cai_berdichevsky(vf=0.3, rf=rf, packing='Hex', tensorial=True) >>> k / rf**2 array([[0.04415829, 0. , 0. , 0. , 0.10741589, 0. , 0. , 0. , 0.10741589]])
- polytex.misc.compress_file(zipfilename, dirname)[source]
Compresses all files and subdirectories in the specified directory.
- Parameters
- zipfilenamestr
The name of the zip file, including the path.
- dirnamestr
The name of the directory to be compressed, including the path.
- Returns
- int
1 if the compression is successful, otherwise 0.
Examples
>>> compress_file("test.zip", "./test")
- polytex.misc.drummond_tahir(vf, rf, packing='Quad', tensorial=False)[source]
Calculate the fiber tow permeability for a given fiber packing pattern according to Drummond and Tahir’s model.
\[\begin{split}K_l & = \frac{r^2}{4V_f}\left(-lnV_f-1.476+2V_f-0.5V_f^2\right) \\ K_{tQuad} & =\frac{r^2}{8V_f}\left(-lnV_f-1.476+\frac{2V_f-0.796V_f}{1+0.489V_f-1.605{V_f}^2}\right) \\ K_{tHex} & =\frac{r^2}{8V_f}\left(-lnV_f-1.497+2V_f-\frac{V_f^2}{2}-0.739V_f^4+\frac{2.534V_f^5}{1+1.2758V_f}\right)\end{split}\]- Parameters
- vffloat or array_like
Fiber volume fraction.
- rffloat or array_like
Fiber radius (m). If vf and rf are arrays, they must have the same shape.
- packingstring
Fiber packing pattern. Valid options are “Quad” and “Hex”.
- tensorialbool
If True, return the permeability tensor (a list with 9 elements). Otherwise, return the permeability components that parallel and perpendicular to the fiber tow as a list of 3 floats. The default is False.
- Returns
- karray-like
Fiber tow permeability. If tensorial is True, return a list with 9 elements. Otherwise, return a list of 3 floats (k11, k22, k33), corresponding to the permeability components that parallel and perpendicular to the fiber tow. The units are m^2. Note that the principal permeability components k22 and k33 are equal.
References
Drummond J E, Tahir M I. Laminar viscous flow through regular arrays of parallel solid cylinders[J]. International Journal of Multiphase Flow, 1984, 10(5): 515-540..
Examples
>>> rf = 6.5e-6 >>> k = drummond_tahir(vf=0.3, rf=rf, packing='Hex') >>> k / rf**2 array([[0.23581067, 0.10851671, 0.10851671]]) >>> k = drummond_tahir(vf=0.7, rf=rf, packing='Hex') >>> k / rf**2 array([[0.01274105, 0.01110984, 0.01110984]]) >>> k = drummond_tahir(vf=0.3, rf=rf, packing='Hex', tensorial=True) >>> k / rf**2 array([[0.23581067, 0. , 0. , 0. , 0.10851671, 0. , 0. , 0. , 0.10851671]])
- polytex.misc.gebart(vf, rf, packing='Quad', tensorial=False)[source]
Calculate the fiber tow permeability for a given fiber packing pattern according to Gebart’s model.
\[\begin{split}k_l & = \frac{8 r_f^2}{c} \frac{(1 - V_f)^3}{V_f^2} \\ k_t & = c_1 r_f^2 \sqrt{\left(\sqrt{\frac{V_{f_{max}}}{V_f}} - 1\right)^5}\end{split}\]- Parameters
- vffloat or array_like
Fiber volume fraction.
- rffloat or array_like
Fiber radius (m). If vf and rf are arrays, they must have the same shape.
- packingstring
Fiber packing pattern. Valid options are “Quad” and “Hex”.
- tensorialbool
If True, return the permeability tensor (a list with 9 elements). Otherwise, return the permeability components that parallel and perpendicular to the fiber tow as a list of 3 floats. The default is False.
- Returns
- karray-like
Fiber tow permeability. If tensorial is True, return a list with 9 elements. Otherwise, return a list of 3 floats (k11, k22, k33), corresponding to the permeability components that parallel and perpendicular to the fiber tow. The units are m^2. Note that the principal permeability components k22 and k33 are equal.
References
Gebart BR. Permeability of Unidirectional Reinforcements for RTM. Journal of Composite Materials. 1992;26(8):1100-33.
Examples
>>> print(gebart(vf=0.5, rf=1.7e-5, packing="Quad", tensorial=False)) [2.02807018e-11 3.73472833e-12 3.73472833e-12] >>> print(gebart(vf=0.5, rf=1.7e-5, packing="Quad", tensorial=True)) [2.02807018e-11 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.73472833e-12 0.00000000e+00 0.00000000e+00 0.00000000e+00 3.73472833e-12] >>> print(gebart(vf=0.5, rf=1.7e-5, packing="Hex", tensorial=False)) [2.18113208e-11 4.72786599e-12 4.72786599e-12] >>> print(gebart(vf=0.5, rf=1.7e-5, packing="Hex", tensorial=True)) [2.18113208e-11 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.72786599e-12 0.00000000e+00 0.00000000e+00 0.00000000e+00 4.72786599e-12]
- polytex.misc.perm_rotation(permeability, orientation, inverse=False, disable_tqdm=True)[source]
Rotate the permeability tensor according to the yarn orientation in the world coordinate system.
- Parameters
- permeability: ndarray
The principal permeability tensor of the yarn in the local coordinate system of the yarn. Shape: (n, 9)
- orientation: ndarray
The orientation of the yarn in the world coordinate system. Shape: (n, 3)
- inverse: bool
If True, the inverse of permeability tensor is returned.
- Returns
- perm_rot: ndarray
The rotated permeability tensor. Shape: (n, 9)
- Dndarray
The inverse of the rotated permeability tensor. Shape: (n, 9)
- polytex.misc.porosity_tow(rho_lin, area_xs, rho_fiber=2550, fvf=False)[source]
Calculate local porosity of a tow based on its cross-sectional area and linear density.
- Parameters
- rho_lin: float
Linear density of the tow. Unit: Tex (g/1000m)
- area_xs: array-like
Cross-sectional area of the tow. Unit: m^2. Shape: (n cross-sections, 1).
- rho_fiber: float
Volume density of the fiber. Unit: kg/m^3. Default: 2550 (glass fiber).
- fvf: bool
Whether to return fiber volume fraction. Default: False. If True, return fiber volume fraction instead of porosity.
- Returns
- porosity: array-like
Local porosity of the tow. Shape: (n cross-sections, 1). Unit: 1. The fiber volume fraction is returned if fvf is True.
Examples
>>> rho_lin = 275 # 275 Tex >>> area_xs = np.array([0.16, 0.22, 0.15])/1e6 # mm^2 to m^2 >>> rho_fiber = 2550 # kg/m^3 >>> porosity = porosity_tow(rho_lin, area_xs, rho_fiber, fvf=True) >>> print(porosity) [0.67401961 0.49019608 0.71895425]