Borrar filtros
Borrar filtros

Laplace equation with mixed boundary condition

4 visualizaciones (últimos 30 días)
Mohammad P
Mohammad P el 9 de Jun. de 2021
Respondida: Nipun el 16 de Mayo de 2024
I am solving the Laplace equation with a mixed boundary condition on a rectangular area (Lx,Ly) and using this function "applyBoundaryCondition" for implementing the Neumann boundary condition.
applyBoundaryCondition(model_bulk1,'neumann','Edge',2,'g',@g1,'q',0);
I have the analytical solution and I know that the solution should only depend on Lx/Ly not values of Lx,Ly itself.
But the solution depends on the specific value of Lx, Ly
Any idea of why this happens?

Respuestas (1)

Nipun
Nipun el 16 de Mayo de 2024
Hi Mohammad,
I understand that you are trying to solve the Laplace equation with a mixed boundary condition on a rectangular area defined by dimensions (L_x) and (L_y). You are using the applyBoundaryCondition function for implementing the Neumann boundary condition on your model. Despite expecting the solution to depend only on the ratio (L_x/L_y), you find that it varies with the specific values of (L_x) and (L_y). This issue could stem from several factors related to the setup of your numerical model or the implementation of boundary conditions.
To address this issue, ensure the following:
  • Your mesh is sufficiently refined and uniform to accurately capture the solution's features across different domain sizes.
  • The function @g1 used in the Neumann boundary condition is correctly scaled to reflect changes in (L_x) and (L_y).
  • Solver settings are optimized for the problem scale and complexity.
Here is a concise approach to refine your mesh and check the implementation of your boundary condition in MATLAB:
% Assuming 'model_bulk1' is your PDE model
% Refine the mesh
generateMesh(model_bulk1, 'Hmax', min(Lx, Ly)/20); % Adjust 'Hmax' as needed
% Apply Neumann boundary condition with correct scaling in '@g1'
applyBoundaryCondition(model_bulk1, 'neumann', 'Edge', 2, 'g', @g1, 'q', 0);
% Ensure @g1 function is correctly scaled for Lx and Ly
function flux = g1(region, state)
% Example implementation, adjust according to your problem
flux = someScalingFunction(region.x, region.y); % Adjust this function
end
% Solve the PDE
result = solvepde(model_bulk1);
% Post-processing and visualization (as needed)
Ensure that someScalingFunction in the g1 function is appropriately defined to reflect the dependency on (L_x/Ly) rather than their absolute values. Additionally, review solver settings to ensure they are suitable for the scale of your problem, adjusting tolerance and iteration limits as necessary.
Hope this helps.
Regards,
Nipun

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by