Hi Code Saturne develop team:
I am using a subroutine to impose the thermal source term for each cell in a channel flow. In the subroutine, I need to use the cell density and velocity (z direction component) to calculate the heat source term. When I try to compile the subroutine, there is an error comes from the cs_field API, the screen shot of the error is shown, and my heat source term subroutine is attached. Did anyone know what the problem is, thanks!
Regards!
Jundi
Fail to compile the thermal source term subroutine
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Fail to compile the thermal source term subroutine
- Attachments
-
- cs_heat_source_terms.f90
- (3.38 KiB) Downloaded 211 times
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Fail to compile the thermal source term subroutine
Hello,
Yes, cvar_vel is a 2-dimensional array (dim*cells), so you shoumd not declare it with the other scalar arrays on line 49, but as:
on a nearby line (note the double instead of single colons).
Regards,
Yvan
Yes, cvar_vel is a 2-dimensional array (dim*cells), so you shoumd not declare it with the other scalar arrays on line 49, but as:
Code: Select all
[double precision, dimension(:,:), pointer :: cvar_vel
Regards,
Yvan
Re: Fail to compile the thermal source term subroutine
Yvan:
OK, thanks! I have another question, if I need to access to the z direction velocity, should I use this:
call field_get_val_v(ivarfl(iw), cvar_vel)
zvelocity=cvar_vel(1,iel)
Regards!
Jundi
OK, thanks! I have another question, if I need to access to the z direction velocity, should I use this:
call field_get_val_v(ivarfl(iw), cvar_vel)
zvelocity=cvar_vel(1,iel)
Regards!
Jundi
-
- Posts: 4208
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Fail to compile the thermal source term subroutine
Hello,
No, that is the x direction; for the z direction, use:
zvelocity=cvar_vel(3,iel)
Best regards,
Yvan
No, that is the x direction; for the z direction, use:
zvelocity=cvar_vel(3,iel)
Best regards,
Yvan
Re: Fail to compile the thermal source term subroutine
OK, thanks a lot!