CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Help: "dbm_dealloc_arr" error in CFD ACE (http://www.cfd-online.com/Forums/main/89429-help-dbm_dealloc_arr-error-cfd-ace.html)

xonix June 12, 2011 23:37

Help: "dbm_dealloc_arr" error in CFD ACE
 
Hi, guys:

I am doing the particle transport simulation using spray model in CFD-ACE. I wrote a user subroutine to add a moment source term, which is dependent on the local vorticity around particle. However, it shows the following error info when I link the compiled the dll file

" # Critical Warning / Errors from CFD-ACE-SOLVER


Error : A programming error has been encountered.
Some more diagnostics information:
Subroutine/Function Name : dbm_dealloc_arr
Subroutine/Function Name : dbm_dealloc_arr
This error occured during deallocation of existing array
Module Index : 0
Data type : REAL
Integer DBM array index : 79
Existing dbm pointer is not associated with any memory.
Probably memory is not allocated for this dbm pointer.
Please transfer this DTF file to ESI CFD customer support
for diagnosis and correction.
e-mail : support.hsv@esi-group-na.com

Error Exit from CFD-ACE-SOLVER "


Here is my subroutine:
************************************************** *********************
SUBROUTINE spr_usr_mom(sp_index, ipcl)
!DEC$ ATTRIBUTES DLLEXPORT :: spr_usr_mom
!******* DO NOT REMOVE ABOVE LINE FOR MS WINDOWS OS ************
!************************************************* **********************
!
! Purpose : Calculate or set the user-specified source term for the x-,
! y-, or z-momentum equation for a spray droplet parcel. The
! corresponding equation being solved is the spray droplet
! kinematic equation, and more specifically, the LHS of the
! corresponding equation being solved is the term du/dt for
! the spray droplet, where u denotes the droplet velocity.
! Therefore, the user-defined source term must be given in
! this subroutine in terms of the additional acceleration
! applied to the spray droplet (or, equivalently, in terms of
! the additional force applied to the spray droplet divided
! by the mass of the droplet).
!
! Arguments :
! Inputs :
! sp_index - Integer, species index
! ipcl - Integer, Parcel index of droplet
! Outputs :
!
! The subroutine could be used to set source terms to the droplet
! phase momentum equations. In accordance with the form in which the
! source term must be given in this subroutine, the units of the
! source term must be m/s^2.
!
! User can get the properties of gas (cp, visc, cond, rdiff, mfinf,
! prdt, schm, lews, mach, mol_wt) using get_cur_gas_properties()
! User can get the gas state variables (u, v, w, den, pres, tem) using
! get_cur_gas_state()
! User can get drop properties (den, cp, hvap, psat, mfsurf) using
! get_cur_drop_properties()
! User can get drop state variables (tem, dia, ndrp, x, y, z, u, v, w)
! using get_cur_drop_state
! User can get drop ndparameters (drag coef, reynolds, nusl, sherwood,
! spal) get_cur_drop_ndparams()
!
! Set the momentum source using
! set_cur_drop_mom_source(source_x, source_y, source_z, error)
!----------------------------------------------------------------------

! Include required global variables declared in cfdrc_user module.
USE cfdrc_user
USE cfdrc_user_access

IMPLICIT NONE

INTEGER(int_p), INTENT(IN) :: sp_index, ipcl
! Declare required local variables here.
! USER VARIABLE DECLARATION BEGIN

INTEGER(int_p) :: ts_no, ts_no_traj, iter, cell_id
INTEGER(int_p) :: vx_index, vy_index, vz_index, i
REAL(real_p) :: time, source_x, source_y, source_z
REAL(real_p) :: x, y, z, u, v, w, up, vp, wp, tem, dia, nden
REAL(real_p) :: slipvx, slipvy, slipvz
REAL(real_p), DIMENSION(:), ALLOCATABLE :: vx_dx, vx_dy, vx_dz, vy_dx, &
vy_dy, vy_dz, vz_dx, vz_dy, vz_dz
REAL(real_p), DIMENSION(:), ALLOCATABLE :: vortx, vorty, vortz

CHARACTER(len=string_length) :: var_name_1,var_name_2,var_name_3

LOGICAL :: error

! USER VARIABLE DECLARATION END

!-----------------------------------------------------------------------
! Start writing code here.
! USER CODE BEGIN

! :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::
! PURPOSE OF THIS EXAMPLE:
! To get the coordinates of parcels (i.e. droplet)
! :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::


IF (first_time) THEN
OPEN(unit=101, file='OUTPUT.TXT', status='REPLACE')

! initialize
ts_no_old = -1
ipcl_old = -1

first_time = .FALSE.
ENDIF

! Set source to zero since it is not the purpose of this example to change momentum
source_x = 0.0
source_y = 0.0
source_z = 0.0
CALL set_cur_drop_mom_source(source_x, source_y, source_z, error)


! Note: the call structure of spr_usr_mom is such that the coordinates of
! a parcel for a given transient time-step, N, will be only available at the
! first spray sub-time-step of the next transient time-step, N+1.

! In the case where Spray-Fluid Coupling is activated, the first spray
! sub-time-step at any time-step occurs at the Spray Calculations Starting
! Iteration (as specified in the GUI under SC/Spray).

! If Spray-Fluid Coupling is not activated, the first spray
! sub-time-step at any time-step occurs at the last iteration (either Max. Iter
! or iteration at convergence).


! Get current time and current iteration
CALL get_time(time, ts_no, error)
CALL get_iteration(iter, error)


! Check that we are at the beginning of a new transient time-step
IF (ts_no /= ts_no_old) THEN

WRITE(101,1000)
WRITE(101,1001) 'Time Step', ts_no
WRITE(101,1002) 'Parcel ID', 'X (m)', 'Y (m)', 'Z (m)', &
'up', 'vp','wp', 'u', 'v', 'w', 'slipvx', &
'slipvy', 'slipvz', 'vortx', 'vorty', 'vortz', 'Iter'


! Reset for new transient time step

ts_no_old = ts_no -1

ipcl_old = -1
ts_no_old = ts_no
first_iter = iter
ENDIF


IF (ipcl /= ipcl_old .AND. iter == first_iter) THEN

var_name_1 = 'U'

call get_var_index(var_name_1, vx_index, error)

var_name_2 = 'V'

call get_var_index(var_name_2, vy_index, error)

var_name_3 = 'W'

call get_var_index(var_name_3, vz_index, error)

CALL get_cur_drop_state(cell_id, x, y, z, up, vp, wp, tem, dia, nden, error)

call get_value_one_cell(vx_index, cell_id, u, error)

call get_value_one_cell(vy_index, cell_id, v, error)

call get_value_one_cell(vz_index, cell_id, w, error)

slipvx = u - up

slipvy = v - vp

slipvz = w - wp


call get_cells(ncells, error)

ALLOCATE(vx_dx(ncells))

ALLOCATE(vx_dy(ncells))

ALLOCATE(vx_dz(ncells))

ALLOCATE(vy_dx(ncells))

ALLOCATE(vy_dy(ncells))

ALLOCATE(vy_dz(ncells))

ALLOCATE(vz_dx(ncells))

ALLOCATE(vz_dy(ncells))

ALLOCATE(vz_dz(ncells))

ALLOCATE(vortx(ncells))

ALLOCATE(vorty(ncells))

ALLOCATE(vortz(ncells))

call get_gradient(vx_index, vx_dx, vx_dy, vx_dz, ncells, error)

call get_gradient(vy_index, vy_dx, vy_dy, vy_dz, ncells, error)

call get_gradient(vz_index, vz_dx, vz_dy, vz_dz, ncells, error)


Do i = 1, ncells

vortx(i) = vz_dy(i) - vy_dz(i)

vorty(i) = vx_dz(i) - vz_dx(i)

vortz(i) = vy_dx(i) - vx_dy(i)

End Do





WRITE(101,1003) ipcl, x, y, z, up, vp, wp, u, v, w, slipvx, slipvy, slipvz, &
vortx(10), vorty(10), vortz(10), iter

ipcl_old = ipcl


ENDIF


Iíll appreciate if anyone can help me or give me some suggestion.

majid_esi January 17, 2012 04:02

your subroutine needs to be checked for errors. write to support.cfd@esi-group.com for more help

Rahul_W January 18, 2012 13:13

hi
have you com pail your subroutin code on esi cfd portal?


All times are GMT -4. The time now is 10:13.