ashiq24 commited on
Commit
0e57b0f
·
1 Parent(s): 58e4929

final push

Browse files
Files changed (3) hide show
  1. README.md +42 -24
  2. data_vis.ipynb +0 -0
  3. fsi_reader.py +3 -3
README.md CHANGED
@@ -8,53 +8,71 @@ tags:
8
  - Fluid-Dynamics
9
  ---
10
 
11
- ## Dataset Description: Fluid-Solid Interaction Simulations
12
 
13
- For each time step \( t \), the simulation records the following variables:
 
 
14
 
15
  ### **Velocity**
16
- \[
17
  \mathbf{v}_t = \begin{bmatrix} v_{x,t} \\ v_{y,t} \end{bmatrix}
18
- \]
19
- where \( v_{x,t} \) and \( v_{y,t} \) are the velocity components in the \( x \) and \( y \) directions, respectively.
20
 
21
  ### **Pressure**
22
- \[
23
  P_t
24
- \]
25
- which represents the pressure field at time \( t \).
26
 
27
- ### **Displacement**
28
- \[
29
  \mathbf{d}_t = \begin{bmatrix} d_{x,t} \\ d_{y,t} \end{bmatrix}
30
- \]
31
- where \( d_{x,t} \) and \( d_{y,t} \) denote the displacement in the \( x \) and \( y \) directions, respectively.
32
 
33
  ---
34
 
35
  ## **Mesh Representation**
36
  The initial mesh is given by:
37
- \[
38
  \mathbf{M}_0 = \begin{bmatrix} x_1 & y_1 \\ x_2 & y_2 \\ \vdots & \vdots \\ x_N & y_N \end{bmatrix} \in \mathbb{R}^{N \times 2}
39
- \]
40
- where each row \( (x_i, y_i) \) represents a mesh point in 2D space.
41
 
42
- Since the mesh is time-dependent, the mesh at time \( t \) is updated based on displacement:
43
 
44
- \[
45
  \mathbf{M}_t = \mathbf{M}_0 + \mathbf{d}_t
46
- \]
47
 
48
  where
49
- \[
50
  \mathbf{d}_t = \begin{bmatrix} d_{x,t,1} & d_{y,t,1} \\ d_{x,t,2} & d_{y,t,2} \\ \vdots & \vdots \\ d_{x,t,N} & d_{y,t,N} \end{bmatrix} \in \mathbb{R}^{N \times 2}
51
- \]
52
- is the displacement field at time \( t \).
53
 
54
- Thus, the updated coordinates of the mesh points at time \( t \) are:
55
 
56
- \[
57
  (x_i^t, y_i^t) = (x_i^0 + d_{x,t,i}, y_i^0 + d_{y,t,i}) \quad \forall i = 1, \dots, N
58
- \]
59
 
60
  This formulation describes how the mesh deforms over time due to displacement.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  - Fluid-Dynamics
9
  ---
10
 
11
+ ## Dataset Description: Fluid-Solid Interaction Simulations (fsi-data)
12
 
13
+ Simulation of fluide dynamics (Navier-Stocks) and Elastic wave equation. Here wwe simulate the flow of water around an elastic rod.
14
+
15
+ For each time step $ t $, the simulation records the following variables:
16
 
17
  ### **Velocity**
18
+ $
19
  \mathbf{v}_t = \begin{bmatrix} v_{x,t} \\ v_{y,t} \end{bmatrix}
20
+ $
21
+ where $ v_{x,t} $ and $ v_{y,t} $ are the velocity components in the $ x $ and $ y $ directions, respectively.
22
 
23
  ### **Pressure**
24
+ $
25
  P_t
26
+ $
27
+ which represents the pressure field at time $ t $.
28
 
29
+ ### **Displacement (Elastic Wave Part)**
30
+ $
31
  \mathbf{d}_t = \begin{bmatrix} d_{x,t} \\ d_{y,t} \end{bmatrix}
32
+ $
33
+ where $ d_{x,t} $ and $ d_{y,t} $ denote the displacement in the $ x $ and $ y $ directions, respectively. This displacement represents the displacemen of the elastic object as well as the change on the mesh location.
34
 
35
  ---
36
 
37
  ## **Mesh Representation**
38
  The initial mesh is given by:
39
+ $
40
  \mathbf{M}_0 = \begin{bmatrix} x_1 & y_1 \\ x_2 & y_2 \\ \vdots & \vdots \\ x_N & y_N \end{bmatrix} \in \mathbb{R}^{N \times 2}
41
+ $
42
+ where each row $ (x_i, y_i) $ represents a mesh point in 2D space.
43
 
44
+ Since the mesh is time-dependent, the mesh at time $ t $ is updated based on displacement:
45
 
46
+ $
47
  \mathbf{M}_t = \mathbf{M}_0 + \mathbf{d}_t
48
+ $
49
 
50
  where
51
+ $
52
  \mathbf{d}_t = \begin{bmatrix} d_{x,t,1} & d_{y,t,1} \\ d_{x,t,2} & d_{y,t,2} \\ \vdots & \vdots \\ d_{x,t,N} & d_{y,t,N} \end{bmatrix} \in \mathbb{R}^{N \times 2}
53
+ $
54
+ is the displacement field at time $ t $.
55
 
56
+ Thus, the updated coordinates of the mesh points at time $ t $ are:
57
 
58
+ $
59
  (x_i^t, y_i^t) = (x_i^0 + d_{x,t,i}, y_i^0 + d_{y,t,i}) \quad \forall i = 1, \dots, N
60
+ $
61
 
62
  This formulation describes how the mesh deforms over time due to displacement.
63
+
64
+ ## Dataset Description: Computational Fluid Dynamics (cfd-data)
65
+
66
+ This dataset has the same structure as above but here we simulate the movemnet of the water around an rigid object. So we are only simulating Navier-stocks equation.
67
+
68
+ The displacement field will be all zero as there is no movement of the rigid body.
69
+
70
+
71
+ ## Loading Dataset
72
+
73
+ ```python
74
+ data = FsiDataReader('./fsi-data/', mu=['1.0'], in_lets_x1=['0.0'])
75
+ mesh = data.input_mesh
76
+ print(mesh.shape)
77
+ data_loader = data.get_loader(batch_size=1, shuffle=False)
78
+ ```
data_vis.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
fsi_reader.py CHANGED
@@ -38,7 +38,7 @@ class FsiDataReader():
38
  self.location = location
39
  self._x1 = ['-4.0', '-2.0', '0.0', '2.0', '4.0', '6.0']
40
  self._x2 = ['-4.0', '-2.0', '0', '2.0', '4.0', '6.0']
41
- self._mu = ['0.1', '0.01', '0.5', '5', '1.0', '10.0']
42
  # keeping vx, xy, P, dx,dy
43
  self.varable_idices = [0, 1, 3, 4, 5]
44
 
@@ -132,7 +132,7 @@ class FsiDataReader():
132
  raise ValueError(
133
  f"Value of is must be one of {self._ivals3} and {self._ivals12} ")
134
  path = os.path.join(
135
- self.params.super_res_data_location,
136
  'mu='+str(mu),
137
  'x1='+str(x1),
138
  'x2='+str(x2),
@@ -162,7 +162,7 @@ class FsiDataReader():
162
  for x1 in self._x1:
163
  for x2 in self._x2:
164
  try:
165
- if mu == 0.5:
166
  mu_data = self.get_data_txt(mu, x1, x2)
167
  else:
168
  mu_data = self.get_data(mu, x1, x2)
 
38
  self.location = location
39
  self._x1 = ['-4.0', '-2.0', '0.0', '2.0', '4.0', '6.0']
40
  self._x2 = ['-4.0', '-2.0', '0', '2.0', '4.0', '6.0']
41
+ self._mu = ['0.5', '5', '1.0', '10.0']
42
  # keeping vx, xy, P, dx,dy
43
  self.varable_idices = [0, 1, 3, 4, 5]
44
 
 
132
  raise ValueError(
133
  f"Value of is must be one of {self._ivals3} and {self._ivals12} ")
134
  path = os.path.join(
135
+ self.location,
136
  'mu='+str(mu),
137
  'x1='+str(x1),
138
  'x2='+str(x2),
 
162
  for x1 in self._x1:
163
  for x2 in self._x2:
164
  try:
165
+ if mu == '0.5':
166
  mu_data = self.get_data_txt(mu, x1, x2)
167
  else:
168
  mu_data = self.get_data(mu, x1, x2)