boundary conditions in PDE

9 ビュー (過去 30 日間)
Jorge Garcia Garcia
Jorge Garcia Garcia 2023 年 6 月 30 日
回答済み: Vandit 2023 年 8 月 24 日
I have a time dependant PDE system:
syms pres
syms u1(x,y,t) u2(x,y,t)
pdeeq = [-laplacian(u1,[x y])+u2; D*laplacian(u2,[x y])+ mass*diff(u1,t,t)-pres];
symcoeffs = pdeCoefficients(pdeeq,[u1,u2],'Symbolic',true);
I then isolate the edges on the perimeter of the plate and I try to enforce Dirichlet boundary conditions to variable u1 in these edges:
I have tried like this:
for j = 1:numel(perimeter)
i=i+1;
edge = perimeter(j);
applyBoundaryCondition(modelTwoDomain,"dirichlet","edge",edge,"h",[1 0;0 0],"r",[1 0]);
end
and like this:
for j = 1:numel(perimeter)
i=i+1;
edge = perimeter(j);
applyBoundaryCondition(model,"dirichlet","Edge",edge,"u",1,"EquationIndex",1);
end
Then I solve the system for a time vector. If it is a Dirichlet, the solution in the edges of the perimeter should be 1 regardless the time instance? When I go to check
uintrp = interpolateSolution(res,0,0.02,1,2);
uintrp=1.4942e-07
What am I doing wrong? I am missing something?
I would really appreciate any light as I have been stuck here in this point months now.
Thanks very much

回答 (1 件)

Vandit
Vandit 2023 年 8 月 24 日
Hi,
Based on the code snippet you provided, it appears that you are correctly applying Dirichlet boundary conditions to the edges of the perimeter using the 'applyBoundaryCondition' function. However, the issue you are facing might be related to the interpretation of the results or the way you are evaluating the solution.
You can try the following steps to correctly evaluate the solution at the edges of the perimeter :
  1. To evaluate the solution at the edges of the perimeter, you can directly access the solution values at those locations. For example, if the edges of the perimeter are stored in an array called 'perimeter', you can extract the solution values at those edges using indexing. For instance, if 'u1' is the first variable in the PDE system, you can access the solution values for 'u1' at the edges as 'res.NodalSolution.u1(edgeIndices)', where 'edgeIndices' represents the indices of the edges in the solution.
  2. Check the values obtained from step 2 to verify if they are indeed 1 for the specified Dirichlet boundary conditions. You can print or examine the values directly to confirm.
To further investigate the issue and understand the behavior of the solution, you can try the following steps:
  1. Print and inspect the boundary conditions applied using 'applyBoundaryCondition' to ensure they are correctly specified.
  2. Check the time instance for which you are evaluating 'uintrp' using 'interpolateSolution'. Make sure it corresponds to the desired time point.
  3. Increase the number of time points in the time vector to observe the solution behavior over a longer period.
  4. Consider visualizing the solution at different time instances to better understand how it evolves over time.
If the issue persists or you need more specific assistance, providing additional details about the PDE, the boundary conditions, and the specific behavior you expect would be helpful in further troubleshooting.
To know more about time dependent PDE systems, you may refer to the below link:
Hope this helps.
Thankyou

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by