How to add Antenna block?
feelingxxxxxxx opened this issue · 4 comments
Hey @feelingxxxxxxx,
I'm not sure why we have documentation on an antenna block, because there is no such feature in the main code. Another developer before my time must have been working on this, but I don't see any branches or pull requests with this capability.
Sorry I couldn't be more helpful. I'll leave this issue up in case the original developer still has the code.
Stuart
@Status-Mirror Thank you very much! So, can we set the current, and if so, how to do it?
The main version of the code does not currently support this feature.
If you feel like a confident FORTRAN user, you can try hard-coding this behaviour. In src/housekeeping/current_smooth.F90
you'll find a subroutine called current_finish
. If you add some lines between: CALL current_bcs
and CALL field_bc(jx,jng)
, then you'll be able to add an additional current correction.
For example:
CALL current_bcs
jx = jx + 10.0_num
jy = jy + 10.0_num
jz = jz + 10.0_num
CALL field_bc(jx,jng)
The above code snippet would artificially increase the current density in all directions in all simulation cells. To target specific cells, you'll need to identify the MPI rank holding the cell. For example, to find the rank holding a cell at
CALL current_bcs
IF (5.0e-6_num > y_min_local .AND. 5.0e-6_num <= y_max_local) THEN
IF (10.0e-6_num > x_min_local .AND. 10.0e-6_num <= x_max_local) THEN
! We only reach here if the current rank holds the position (10,5) micron
! On this rank, jx(1,1) refers to the cell with central position:
! In x: x_grid_min_local
! In y: y_grid_min_local
! And jx(ix,iy) cell has central position (x_grid_min_local + (ix - 1)*dx, y_grid_min_local + (iy - 1)*dy)
END IF
END IF
CALL field_bc(jx,jng)
I imagine the original antenna scripts (wherever they are) would have done something similar to this.
Hope this helps,
Stuart
Hi @Status-Mirror,
Apologies for the late reply here. Thanks a lot!
Best wishes!