-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navier Stokes Dynamic surface Boundary Conditions #1565
Comments
What happens when you decrease your domain size and/or increase the amount of training points? |
Thanks for your reply. data = dde.data.TimePDE(
geomtime,
pde,
[left_bc_psi,right_bc_psi,left_bc_eta,right_bc_eta,
bottom_bc_psi_x, bottom_bc_psi_z,
surface_bc1, surface_bc2, surface_bc3,
ic_psi, ic_eta],
num_domain=800,
num_boundary=400,
num_initial=400,
num_test=400
) model.compile("L-BFGS-B")
losshistory, train_state = model.train(iterations=1000) Then num_points_x = 400
num_points_t = 5
x = np.linspace(0, L, num_points_x) # L is the domain length in x
t = np.linspace(0, T, num_points_t) # T is the total time
X, T = np.meshgrid(x, t)
XT_flat = np.vstack((X.flatten(), T.flatten())).T
z_value = H
Z_flat = np.full((XT_flat.shape[0],), z_value)
test_data = np.column_stack((XT_flat, Z_flat))
U_pred = model.predict(test_data) the results are psi_pred = U_pred[:, 0] # First predicted value for each point
eta_pred = U_pred[:, 1] and plotted below. Clearly the result is not what I expected and physics predicts [@engsbk, ] |
Dear @svkarash
|
Dear @jdellag |
Dear Reza [@AJAXJR24] |
Heres an example using the Laplace equation on a disk. Say I wanted to have Anchor points evenly distributed around the disk, I could have a function that generates anchors like: # Function to generate anchor points. Anchors can be used to improve the performance of the model by ensuring that
# certain important points in the domain are always included in the training set.
def generate_points(n):
"""
Generate anchor points in polar coordinates.
Parameters:
- n (int): Number of points to generate for both radius (r) and angle (theta).
Returns:
- np.array: Array of [r, theta] pairs.
"""
# Define radius values ranging from 0 to 1
r_values = np.linspace(0, 1.0, n)
# Define angle values ranging from 0 to 2pi
theta_values = np.linspace(0, 2*np.pi, n)
points = []
# Generate cartesian product of r_values and theta_values to get all combinations of [r, theta]
for r in r_values:
for theta in theta_values:
points.append([r, theta])
return np.array(points)
# Set the number of anchor points to be generated
n = 50
anchors = generate_points(n) Then use these points when you define your dataset like so: data = dde.data.PDE(
geom,
pde,
bc,
num_domain = 9500,
num_boundary = 1500,
anchors = anchors
) As far as limitations go, I can take care of most of my simulations using 1/10 of an A100 (i.e. under 8GB of memory using all 64bit floats for the ~12500 datapoints used above). While I have an allocation through ACCESS, if I look on RunPod I see that you can use a RTX A4000 for .34/hour. |
Dear @jdellag, |
Dear @svkarash , I already tried to solve almost the same problem. Based on the help of @forxltk , may be you should define the free surface geometry first and then apply the BC on it. something like this:
|
Hi @Nimava, I've implemented this for setting up initial conditions. Nevertheless, I'm inclined to think that this approach may not be suitable for Deepxde, as it seems necessary to define everything from the outset. This includes not only adjusting boundary conditions but also modifying the partial differential equations (PDEs). thanks in advance |
@Nimava, |
Dear @svkarash, |
thanks |
Dear @Nimava and experts Please let me know how can I solve the issues data = dde.data.TimePDE(
geomtime,
pde,
[left_bc_psi,right_bc_psi,left_bc_eta,right_bc_eta,
bottom_bc_psi_x, bottom_bc_psi_z,
surface_bc1, surface_bc2, surface_bc3,
ic_psi, ic_eta],
num_domain=5090,
num_boundary=2048,
num_initial=2048,
num_test=5090
)
layers = [3, [50] * 2, [50] * 2, 2]
net = dde.nn.PFNN(layers, "tanh", "Glorot uniform") |
May be these changing can improve the code: 1- You used Drichlet BC for all points of left and right walls but based on my experience in CFD, may be it is better that the uppest points of them (I mean the points that connect to free surface) should be without BC. In this condition, the free surface BCs are applied to these points. 2- I generally used Neumann Bc for these type of problems. You can check it too.
3- What is your initial wave amplitude? It should be very small to have linear waves. |
Dear Dr. @lululxvi
I am dealing with a fluid dynamics problem involving a water tank, surface waves, and a set of partial differential equations (PDEs) along with boundary conditions. I am interested in using DeepXDE to solve this system, but I encountered issues with definition of boundary conditions and initial conditions.
Domain, Boundaries, and Initial Conditions$u$ and $w$ ) and surface elevation ($\zeta$ ).
I defined a water tank with a horizontal axis (x) and a vertical axis (z).
The surface wave is represented by a Gaussian function.
Left, right, and bottom boundaries are solid, with specific conditions for velocity components (
Issue$t=0$ to reflect the initial conditions and, at an arbitrary time, for $\zeta$ to approach zero at the left and right boundaries.
I got incorrect results, and my expectations are not met. Specifically, I expect the plot at
Equations
in the bulk ($0\le z \le H$ )
at the bottom$z=0$ , and
on the surface$z=H$ .$\psi=\psi(x,z,t)$ while $\zeta=\zeta(x,t)$
Note that
Code
and the network is defined as below
I'm currently facing challenges with my code, and I'm unsure which part might be causing the incorrect results. I've implemented the domain, boundaries, and initial conditions in DeepXDE, but the outcomes don't align with my expectations.
I'm seeking help to identify and rectify any errors in the code. If possible, guidance on how to modify the code would be greatly appreciated.
Expected Results$\zeta$ is plotted below
What I expect to see for
Thanks in advance
[@AJAXJR24, @Ryszard2, @katayooneshkofti]
The text was updated successfully, but these errors were encountered: