Clear Filters
Clear Filters

Error using generateMesh function of the pde toolbox

6 views (last 30 days)
Hello everyone,
I am trying to generate a mesh to analyze an airplane wing using the PDE toolbox.
The attached geometry was modeled in SolidWorks and saved as a .step file.
When using the generateMesh function with the tapperedNaca2412.STEP, the following error is shown:
"Meshing failed for Hmax of 0.304627 and Hmin of 0.0881443. Try adjusting Hmax and Hmin."
clear
close
clf
% geometry
geo = unzip('wing.zip')
geo = 1x2 cell array
{'straightNaca2412.STEP'} {'tapperedNaca2412.STEP'}
g = importGeometry(geo{2});
g = rotate(g,90,[0 0 0],[1 0 0]);
% model
wing = createpde("structural","static-solid");
wing.Geometry = g;
pdegplot(wing,"FaceAlpha",0.3,"FaceLabels","on")
% properties
E = 2.1e11; % modulo de elasticidade (Pa)
rho = 7800; % densidade do material (kg/m3)
nu = 0.3; % coeficiente de Poisson
structuralProperties(wing,"YoungsModulus",E,"MassDensity",rho,"PoissonsRatio",nu);
% load
P = 3000;
% boundary conditions
structuralBC(wing,"Face",4,"Constraint","fixed");
% structuralBoundaryLoad(wing,"Face",1,"Pressure",P);
structuralBoundaryLoad(wing,"Face",[1 3],"Pressure",P);
% mesh
generateMesh(wing);
Meshing failed for Hmax of 0.304627 and Hmin of 0.0881443. Try adjusting Hmax and Hmin.
pdeplot3D(wing)
% solution
R = solve(wing);
pdeplot3D(wing,"ColorMapData",R.VonMisesStress,"Deformation",R.Displacement)
max(abs(R.VonMisesStress))

Accepted Answer

Ganesh
Ganesh on 4 Jun 2024
From my understanding, you are passing the default values of Hmax and Hmin, but you are encountering an error when you try to use the function "generateMesh()".
When you use the "generateMesh()" function without specifying the parameters "Hmax" and "Hmin", MATLAB chooses an optimum Meshing Parameter. In this case the meshing parameter chosen is not sufficient to generate the mesh. Hence, the meshing fails due to the limitations of the mesh generator for the parameter chosen. The ability, or inability, to generate mesh varies from geometry to geometry on intrinsic properties. Your work around can be to tweak the "Hmin" and "Hmax" values to generate the mesh.
From trial and error, I have seen that setting "Hmax" to a value greater than 1.5 and "Hmin" to a value lower than 0.01 does the trick in your case.
It is important to understand these parameters in order to be able to overcome this issue in the future and to ensure that the results are accurate. For the same, you may find the document below on "generateMesh()":
Hope it helps!
  1 Comment
Geovane Gomes
Geovane Gomes on 4 Jun 2024
Edited: Geovane Gomes on 4 Jun 2024
Thanks!
It helps a lot.
Is there any trick to finding an interval in which I can generate the mesh?
I am having the same problem with other geometries.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!