Ariless
Student
- Oct 2, 2024
- 1
Hello,
I’m working on a simulation in ANSYS APDL where I model a beam with a crack using the boolean subtraction method (creating two blocks and subtracting one to represent the crack). The issue is that when I vary the size of the crack (length, width, and depth), the resulting modal frequencies remain the same across simulations.
I’ve checked my APDL script, and everything seems to run correctly without errors. However, the crack size variation does not appear to affect the results, as I would expect different frequencies for different crack sizes. Has anyone encountered a similar issue or can suggest what might be going wrong?
Here's the script :
function testi(E, rho, fissure_length, fissure_width, fissure_depth)
work_dir = 'C:\temp\ansys_workdir'; % Répertoire de travail
if ~exist(work_dir, 'dir')
mkdir(work_dir);
end
% Dimensions de la poutre
beam_length = 0.350; % Longueur de la poutre
beam_width = 0.15; % Largeur de la poutre
beam_height = 0.012; % Hauteur de la poutre
% Début de la définition de la géométrie
apdl_script = sprintf([...
'/PREP7\n'...
'! Création de la géométrie de la poutre avec une fissure intégrée\n'...
'! Création du volume principal (poutre)\n'...
'BLOCK, 0, %g, 0, %g, 0, %g\n'... % Bloc principal
'! Création de la fissure (vide)\n'...
'BLOCK, 0, %g, 0.04, %g, 0, %g\n'... % Fissure (cavité)
'VDEL, 2,,\n'... % Supprimer la partie correspondant à la fissure
'\n'...
'! Définition des propriétés du matériau en unités MKS\n'...
'MP, EX, 1, %g\n'...
'MP, PRXY, 1, 0.3\n'...
'MP, DENS, 1, %g\n'...
'\n'...
'! Définition du type d''élément\n'...
'ET, 1, SOLID186\n'...
'\n'...
'! Assignation du matériau à la géométrie\n'...
'EMODIF, ALL, MAT, 1\n'...
'\n'...
'! Propriétés nulles pour la fissure\n'...
'MP, EX, 2, 0\n'... % Propriétés nulles pour le vide (fissure)
'MP, PRXY, 2, 0\n'...
'MP, DENS, 2, 0\n'...
'\n'...
'! Maillage de la géométrie en utilisant une taille d''élément raisonnable en mètres\n'...
'ESIZE, 0.015\n'...
'VMESH, ALL\n'...
'\n'...
'/SOLU\n'...
'ANTYPE, MODAL\n'...
'MODOPT, LANB, 15\n'...
'MXPAND, 15, , , ON\n'...
'SOLVE\n'...
'/POST1\n'...
'SET, LIST\n'...
sprintf('/OUTPUT, %s\\frequencies, txt\n', work_dir)...
'*DO, I, 1, 15\n'...
' SET, MODE, I\n'...
' *GET, freq, MODE, I, FREQ\n'...
' *VWRITE, I, freq\n'...
' (F6.0, E15.6)\n'...
'*ENDDO\n'...
'/OUTPUT\n'...
'FINISH\n'], ...
beam_length, beam_width, beam_height, ... % Dimensions de la poutre
fissure_length, fissure_width, fissure_depth, ... % Fissure intégrée
E, rho);
% Sauvegarder le script APDL
apdl_file = fullfile(work_dir, 'modal.mac');
fid = fopen(apdl_file, 'wt');
fprintf(fid, '%s', apdl_script);
fclose(fid);
% Exécution de la commande ANSYS
ansys_executable = '"C:\Program Files\ANSYS Inc\v231\ansys\bin\winx64\mapdl.exe"';
ansys_command = sprintf('%s -b -i %s -o %s\\output.log', ansys_executable, apdl_file, work_dir);
status = system(ansys_command);
if status ~= 0
error('Error running ANSYS. Check output.log for details.');
else
disp('La simulation ANSYS est terminée.');
end
end
Thank you
I’m working on a simulation in ANSYS APDL where I model a beam with a crack using the boolean subtraction method (creating two blocks and subtracting one to represent the crack). The issue is that when I vary the size of the crack (length, width, and depth), the resulting modal frequencies remain the same across simulations.
I’ve checked my APDL script, and everything seems to run correctly without errors. However, the crack size variation does not appear to affect the results, as I would expect different frequencies for different crack sizes. Has anyone encountered a similar issue or can suggest what might be going wrong?
Here's the script :
function testi(E, rho, fissure_length, fissure_width, fissure_depth)
work_dir = 'C:\temp\ansys_workdir'; % Répertoire de travail
if ~exist(work_dir, 'dir')
mkdir(work_dir);
end
% Dimensions de la poutre
beam_length = 0.350; % Longueur de la poutre
beam_width = 0.15; % Largeur de la poutre
beam_height = 0.012; % Hauteur de la poutre
% Début de la définition de la géométrie
apdl_script = sprintf([...
'/PREP7\n'...
'! Création de la géométrie de la poutre avec une fissure intégrée\n'...
'! Création du volume principal (poutre)\n'...
'BLOCK, 0, %g, 0, %g, 0, %g\n'... % Bloc principal
'! Création de la fissure (vide)\n'...
'BLOCK, 0, %g, 0.04, %g, 0, %g\n'... % Fissure (cavité)
'VDEL, 2,,\n'... % Supprimer la partie correspondant à la fissure
'\n'...
'! Définition des propriétés du matériau en unités MKS\n'...
'MP, EX, 1, %g\n'...
'MP, PRXY, 1, 0.3\n'...
'MP, DENS, 1, %g\n'...
'\n'...
'! Définition du type d''élément\n'...
'ET, 1, SOLID186\n'...
'\n'...
'! Assignation du matériau à la géométrie\n'...
'EMODIF, ALL, MAT, 1\n'...
'\n'...
'! Propriétés nulles pour la fissure\n'...
'MP, EX, 2, 0\n'... % Propriétés nulles pour le vide (fissure)
'MP, PRXY, 2, 0\n'...
'MP, DENS, 2, 0\n'...
'\n'...
'! Maillage de la géométrie en utilisant une taille d''élément raisonnable en mètres\n'...
'ESIZE, 0.015\n'...
'VMESH, ALL\n'...
'\n'...
'/SOLU\n'...
'ANTYPE, MODAL\n'...
'MODOPT, LANB, 15\n'...
'MXPAND, 15, , , ON\n'...
'SOLVE\n'...
'/POST1\n'...
'SET, LIST\n'...
sprintf('/OUTPUT, %s\\frequencies, txt\n', work_dir)...
'*DO, I, 1, 15\n'...
' SET, MODE, I\n'...
' *GET, freq, MODE, I, FREQ\n'...
' *VWRITE, I, freq\n'...
' (F6.0, E15.6)\n'...
'*ENDDO\n'...
'/OUTPUT\n'...
'FINISH\n'], ...
beam_length, beam_width, beam_height, ... % Dimensions de la poutre
fissure_length, fissure_width, fissure_depth, ... % Fissure intégrée
E, rho);
% Sauvegarder le script APDL
apdl_file = fullfile(work_dir, 'modal.mac');
fid = fopen(apdl_file, 'wt');
fprintf(fid, '%s', apdl_script);
fclose(fid);
% Exécution de la commande ANSYS
ansys_executable = '"C:\Program Files\ANSYS Inc\v231\ansys\bin\winx64\mapdl.exe"';
ansys_command = sprintf('%s -b -i %s -o %s\\output.log', ansys_executable, apdl_file, work_dir);
status = system(ansys_command);
if status ~= 0
error('Error running ANSYS. Check output.log for details.');
else
disp('La simulation ANSYS est terminée.');
end
end
Thank you