Virtual dye sources problem

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
baewell
Posts: 3
Joined: Tue Jan 04, 2022 9:57 pm
Location: Xiamen university

Virtual dye sources problem

#1 Unread post by baewell »

Hi all,

I would like to add a continuous virtual dye source in my case like river files with NO horizontal momentum transport. Therefore, I utilized a river file to introduce a dye source at a specified location in my setup, while kept river mass transport = 0, and other settings are as follows:

Code: Select all

! Logical switches (TRUE/FALSE) to activate horizontal momentum transport
! point Sources/Sinks (like river runoff transport) and mass point
! Sources/Sinks (like volume vertical influx), [1:Ngrids].

      LuvSrc == T                          ! horizontal momentum transport
       LwSrc == F                          ! volume vertical influx

! Logical switches (TRUE/FALSE) to activate tracers point Sources/Sinks
! (like river runoff) and to specify which tracer variables to consider:
! [1:NAT+NPT,Ngrids].  See glossary below for details.

  LtracerSrc == F F T                       ! temperature, salinity, inert
but in the final output, the dye concentration remains consistently at 0. It seems that my approach to adding the dye source has not been successful.

I suspect the issue may be with these lines of code in step3d_uv.F. When I commented out these lines, the model blow up.

Code: Select all

      IF (LuvSrc(ng)) THEN
        DO is=1,Nsrc(ng)
          i=SOURCES(ng)%Isrc(is)
          j=SOURCES(ng)%Jsrc(is)
          IF (((IstrR.le.i).and.(i.le.IendR)).and.                      &
     &        ((JstrR.le.j).and.(j.le.JendR))) THEN
            IF (INT(SOURCES(ng)%Dsrc(is)).eq.0) THEN
              DO k=1,N(ng)
                cff1=1.0_r8/(on_u(i,j)*                                 &
     &                       0.5_r8*(z_w(i-1,j,k)-z_w(i-1,j,k-1)+       &
     &                               z_w(i  ,j,k)-z_w(i  ,j,k-1)))
                u(i,j,k,nnew)=SOURCES(ng)%Qsrc(is,k)*cff1
              END DO
            ELSE
              DO k=1,N(ng)
                cff1=1.0_r8/(om_v(i,j)*                                 &
     &                       0.5_r8*(z_w(i,j-1,k)-z_w(i,j-1,k-1)+       &
     &                               z_w(i,j  ,k)-z_w(i,j  ,k-1)))
                v(i,j,k,nnew)=SOURCES(ng)%Qsrc(is,k)*cff1
              END DO
            END IF
          END IF
        END DO
      END IF

So, please help me with your insights. Any suggestions would be greatly appreciated!

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Virtual dye sources problem

#2 Unread post by wilkin »

You want the LwSrc option. This introduces tracer mass without momentum by augmenting the tracer flux divergence at the cell center. It does not impact u,v.

For both LuvSrc and LwSrc sources the rate at which tracer is added (in kg/s) is the volume flux (river_transport, m^3/s) multiplied by the concentration (kg/m^3). If you set "mass flux", by which I assume you mean river_transport, to zero you correctly get no net tracer flux (kg/s)
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

baewell
Posts: 3
Joined: Tue Jan 04, 2022 9:57 pm
Location: Xiamen university

Re: Virtual dye sources problem

#3 Unread post by baewell »

wilkin wrote: Thu Jan 18, 2024 12:43 am You want the LwSrc option. This introduces tracer mass without momentum by augmenting the tracer flux divergence at the cell center. It does not impact u,v.

For both LuvSrc and LwSrc sources the rate at which tracer is added (in kg/s) is the volume flux (river_transport, m^3/s) multiplied by the concentration (kg/m^3). If you set "mass flux", by which I assume you mean river_transport, to zero you correctly get no net tracer flux (kg/s)
Hi, Wilkin,
many thanks for your quick and helpful reply! I will try your suggestions!

Post Reply