|
[Sponsors] |
[ANSYS Meshing] Error: "An allocaton was made with a negative.." |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 23, 2017, 07:33 |
Error: "An allocaton was made with a negative.."
|
#1 |
New Member
Alexander Spaett
Join Date: May 2017
Posts: 2
Rep Power: 0 |
Hello everyone,
I tried meshing 2 completely different setups and got the same error both times. At first I thought it was just me doing sth wrong in the meshscript and just couldnt figure it out. Since I just couldnt find any solution i moved on to a very simple setup. Turns out: the EXACT same error message occured again. I wanna highlight that the requested length AS WELL AS the linenum was the same for both setups! Message: An allocation was made with a negative length requested: -705425008 Filename:FEM_smooth.c Linenum:2399 Screenshot: Meshscript 1: Code:
! --------------------! ! ----- Header ------ ! ! ------------------- ! FINI ! exits all old scripts / CLEAR ! clears workspace / PREP7 ! starts command interface NACSINIT ! starts NACS interface ! ------------------------------------ ! ! ----- Definition of variables ------ ! ! ------------------------------------ ! elemMode = 'quadr' ! Quadratic elements = good ! Definition of our Transducer element [Flat at first] r_emfi = 20e-3 ! Radius of the EmFi [ = 20 mm] h_emfi = 5e-4 ! Height of the EmFI [ = 0.5 mm -> Datasheets on EMFIT Site] ! Definition of the Reflector r_reflector_i = 50e-3 ! Inner Radius of the Reflector [ = 50 mm] -> Determined in the corresponding Bachelor Thesis w_reflector = 2e-3 ! Thickness of the Reflector [ = 2 mm ] -> Assumption r_reflector_o = r_reflector_i + w_reflector ! Outer Radius of the Reflector ! Air region: h_air_1 = 5e-4 ! Height of the Air rectangle in the bottom [ = 0.5 mm] r_air_1 = 80e-3 ! Outer Radius of the Air_bottom area [ = 120 mm] h_air_2 = 100e-3 ! Height of the middle Air rectangle [ = 500 mm] [first iteration] r_air_2 = 100e-3 ! Outer radius of the middle Air rectangle [ = 200 mm] r_air_3 = r_reflector_i ! Air in the reflector [ = 50 mm] r_air_4_i = r_reflector_o ! Air sourrunding the reflector r_air_4_o = 100 e-3 h_air_4 = 100e-3 dx = 85e-6 ! Meshsize (calculation: dx = c / (20*f) = 343 / (20 * 200000) = 85e-6 m ) [here: may Frequency = 200 kHz] w_pml = 8*dx ! Width of the pml region [Used for better results at the outer boundaries of the region] tol = dx/5 ! ---------------------------------- ! ! ----- Create the geometries ------ ! ! ---------------------------------- ! ! RECTNG , x_min , x_max , y_min , y_max -> rectangle from x_min , y_min to x_max , y_max ! CYL4, X_Center, Y_Center, R_1, Theta_1, R_2, Theta_2 ! FIRST THE "Complicated" part of the air region [Cutting the whole into the rectangle] RECTNG, 0, r_air_2, h_air_1 + h_air_2, h_air_1 + h_air_2 + h_air_4 ! Air Region 4 [Circular has to be substraced from it] ASEL, s, area, , 1 ! Select Air Region 4 CM, temp1, area CYL4, 0, h_air_1 + h_air_2, 0, 90, r_reflector_o, 0 ! Air Region 4 [Ciruclar which has to be substracted from Rect.] ASEL, s, area , ,2 ! Select Air Region 4 [Circular Part] CM,temp2, area ALLSEL ! Select everything [otherwise ASBA - Area substract Area does not work properly] ASBA, temp1, temp2 ! Substracting the inner Part of the AIR AREA to be able to glue and mesh RECTNG, 0, r_emfi, 0, h_emfi ! EMFI RECTNG, r_emfi, r_air_1, 0, h_air_1 ! Air Region 1 RECTNG, 0, r_air_2, h_air_1, h_air_1 + h_air_2 ! Air Region 2 CYL4, 0, h_air_1 + h_air_2, 0, 90, r_air_3, 0 ! Air Region 3 [Circular] CYL4, 0, h_air_1 + h_air_2, r_reflector_i,90, r_reflector_o, 0 ! Reflector RECTNG, r_air_2, r_air_2 + w_PML, h_air_1, h_air_1 + h_air_2 + h_air_4 !PML REGION Right RECTNG, 0, r_air_2 + w_PML,h_air_1 + h_air_2 + h_air_4, h_air_1 + h_air_2 + h_air_4 + w_PML !PML REGION Top ! --------------------------------- ! ! ----- Connect the geometry ------ ! ! ----------------------------------! ASEL , all AGLUE , all ! --------------------------- ! ! ----- Setup the mesh ------ ! ! --------------------------- ! LSEL , all ! select all lines LESIZE , all , dx ! set the meshsize dx on all selected lines MSHKEY ,2 SETELEMS , 'quadr' , elemMode ASEL , all AMESH , all Code:
! --------------------! ! ----- Header ------ ! ! ------------------- ! FINI ! exits all old scripts / CLEAR ! clears workspace / PREP7 ! starts command interface NACSINIT ! starts NACS interface ! ------------------------------------ ! ! ----- Definition of variables ------ ! ! ------------------------------------ ! elemMode = 'quadr' ! Quadratic elements = good ! Definition of our Transducer element [Flat at first] r_emfi = 20e-3 ! Radius of the EmFi [ = 20 mm] h_emfi = 8e-5 ! Height of the EmFI [ = 0.5 mm -> Datasheets on EMFIT Site] ! Air region: h_air_1 = h_emfi ! Height of the Air rectangle in the bottom [ = Height of EMFI] r_air_1 = 80e-3 ! Outer Radius of the Air_bottom area [ = 80 mm] h_air_2 = 60e-3 ! Height of the middle Air rectangle [ = 60 mm] [first iteration] r_air_2 = 100e-3 ! Outer radius of the middle Air rectangle [ = 100 mm] h_air_3 = 20e-3 ! Height of the Air rectangle at the top [ = 20 mm] r_air_3 = r_air_2 ! Radious of the Air rectangle at the top [100 mm] ! Mesh dx = 80e-6 w_pml = 8*dx tol = dx/5 ! ---------------------------------- ! ! ----- Create the geometries ------ ! ! ---------------------------------- ! RECTNG, 0, r_emfi, 0, h_emfi RECTNG, r_emfi, r_air_1, 0, h_air_1 RECTNG, 0, r_air_2, h_air_1, h_air_1 + h_air_2 RECTNG, 0, r_air_2, h_air_1 + h_air_2, h_air_1 + h_air_2 + h_air_3 RECTNG, r_air_2, r_air_2 + w_PML, 0, h_air_1 + h_air_2 + h_air_3 RECTNG, 0, r_air_2 + w_PML, h_air_1 + h_air_2 + h_air_3, h_air_1 + h_air_2 + h_air_3+ w_PML ! --------------------------------- ! ! ----- Connect the geometry ------ ! ! ----------------------------------! ASEL , all AGLUE , all ! --------------------------- ! ! ----- Setup the mesh ------ ! ! --------------------------- ! LSEL , all ! select all lines LESIZE , all , dx ! set the meshsize dx on all selected lines MSHKEY ,2 SETELEMS , 'quadr' , elemMode ASEL , all AMESH , all It would be really great if someone of you could help me out with this. BR Alex |
|
May 23, 2017, 09:38 |
|
#2 |
New Member
Alexander Spaett
Join Date: May 2017
Posts: 2
Rep Power: 0 |
Possible solution:
> I resized the Air region since it was unnecesarilly large anyways [atleast for simulation 2]. Doing this seems to have fixed the problem. > The Error Message still seems kinda strange to me. I'm not sure if this is actually a real solution or just made the regions go away where the problem accured. Edit: Error Occured again at the same line [2399] after resizing it again |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible bug in blockMesh | benru | OpenFOAM Bugs | 16 | August 17, 2013 20:54 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
negative element volume (CFX-10.0) | CFDworker | CFX | 8 | September 27, 2011 19:16 |
negative volume encountered | Maga | CFX | 2 | October 7, 2009 18:31 |