Maybe something wrong with OPT card and wvlnsh.f

Dear @ceruttif and other experts,
I have read your another answer about wvlnsh.f. You have said “Once you have activated optical photon transport by OPT-PROP and OPT-PROP and an absorption event takes place, the wvlnsh.f routine is automatically called with no need for a dedicated card.

  1. Just see the picture, I want to only “POLYSTR” have the function of wavelength shift, but both “ZnS” and “PLOYSTR” related to OPT-PROD. How should I change to achieve my goal?
  2. Please see my file, the output of USRBIN with 1D projection is down to almost zero about 1cm, it seems abnormal, I guess it caused by OPT-** and wvlnsh.f, could you help me?
    图片

    sep2.flair (3.7 KB)
    wvlnsh.f (2.6 KB)

Dear @xiongbp,

Regarding your first question, you can use the information available in the input variables of the wvlnsh routine. There, the material ID and region ID are provided by the input variables MMAT and MREG respectively. In your case, it would suffice to set a control statement whereby NWVSHP=0 for materials or regions wavelength shifting. Note that the input variables are integers. To obtain the corresponding names, call the routine GEOR2N for regions or, for materials, read the variable MATNAM(i) from flkmat.inc which stores the material names using the material number as index.

As for your second question, I can identify several reasons for the low number of optical photons in the fiber. First, you should probably define the outer layer layLiF of your fiber as a metal which reflects the photons and traps them in the fiber:

image

Otherwise I notice the absorption coefficient of the ZnS scintillator is very high (20). Optical photons are therefore very likely to be absorbed there rather than propagating in the fiber.

Dear @blefebvre ,
Thank you for your reply.
For the first question, I am not familiar with use routine, my wvlnsh.f is showed below, could you help to see if it correct and change if not?


2. Because the attenuation of ZnS(Ag) is 500um, so I set it to 20, I have add a new card “OPT-CARD” with “metal” and consult you if any question.

Dear @xiongbp,

Below is an example of a wvlnsh routine which would produce wavelength shifting only in the layFiber region. Try this snippet instead of what you have in your source file.

      DIMENSION WVSHPH (MXWSPH), DWVSHP (MXWSPH)
      CHARACTER(len=8) :: NAMREG, REGLAY
      SAVE REGLAY
      DATA REGLAY / 'layFiber' /
      DOUBLE PRECISION PRO, XI
      SAVE PRO
      DATA PRO / 0.7D+00 /
      INTEGER IERR

      CALL GEOR2N(MREG, NAMREG, IERR)
      IF ( NAMREG == REGLAY ) THEN
         XI = FLRNDM(1.D+00)

         IF (XI .LT. PRO) THEN
            NWVSHP   = 1.
            WVSHPH(1)=-0.000051
            DWVSHP(1)=0.0000002
         ELSE
            NWVSHP = 0
         END IF
      ELSE
         NWVSHP = 0
      END IF

Dear @blefebvre ,
Thank you very much and it helped me a lot.