How to split the advection and diffusion term

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
smartboy
Posts: 6
Joined: Wed Mar 31, 2021 1:14 pm
Location: Ocean University of China

How to split the advection and diffusion term

#1 Unread post by smartboy »

Hi,
I'm a beginner at ROMS modeling. I have a question about the model. I want to know how to close the diffusion term for tracer.
In ROMS, the tracer equation is like follows:
tracer.png
In my application, I only need the advection and local term in the tracer equation. In other words, I just need the left-hand side for the tracer equation. I don't want to any term on the right-hand side.
I have tried many times in myself before. If the right-hand side in the tracer equation above equals zero, the tracer should be conserved, while there is always some dissipation after I edit the code. I don't know how to close it, while I need to close it.
Could anyone tell me how to edit the code in ROMS? Which file should I edit? The right-hand side term is in which file?

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: How to split the advection and diffusion term

#2 Unread post by kate »

In modeling, there is always implicit diffusion from your advection operator. You can reduce this by going to a fourth-order advection scheme. I use the third-order one with its implicit diffusion, then turn off explicit diffusion by turning off the cppdefs for it.

Vertical diffusion is trickier. People usually use LMD_MIXING or GLS_MIXING, but you can turn them both off. If you have ANA_VMIX, you can hard-code it to be zero in ana_vmix.h. I don't know if that would run, though. You'd have to try it.

User avatar
smartboy
Posts: 6
Joined: Wed Mar 31, 2021 1:14 pm
Location: Ocean University of China

Re: How to split the advection and diffusion term

#3 Unread post by smartboy »

Yeah, while I just want to close the right-hand side for some tracers in my application. For example, I don't want to close any term for the tracer temperature and salinity. I want to set the right-hand side to zero for dye_01 or biological tracer, for example.
What I want to do is add a new cppdef option for example NO_RHS_TRACER for ROMS, and then close the right-hand side to zero for one specific tracer, not all tracer. Is it possible?
I know maybe this work is very hard. I want to try it and I want to know which file contains the tracer equation.
I have known that the tracer equation is in step3d_t.F and pre_step3d.F in the Nonlinear directory. While it also has some dissipation after I close the diffusion and vertical advection for the tracer in the above two files. I want to know these two terms
tracer.png
tracer.png (71.72 KiB) Viewed 13346 times
are in which file? Maybe setting the viscosity to zero in ana_vmix.h doesn't work because there is also viscosity for the momentum equation. Can I just close them for a specific tracer in the tracer equation?

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: How to split the advection and diffusion term

#4 Unread post by kate »

The vertical diffusivity is in Akt, which is dimensioned by three spatial dimensions and the NT (number of tracers) dimension. You can set some to zero. There will still be implicit changes which I don't think you can do anything about other than try different advection schemes.

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

Re: How to split the advection and diffusion term

#5 Unread post by wilkin »

You need to be a bit thoughtful here about what will happen if you disable all vertical mixing.

If you have no vertical viscosity, then if you also want surface stress or bottom drag then the way in which those mix into the interior is going to be significantly modified. Surface and bottom stresses enter as boundary conditions to the vertical turbulent fluxes. But you could activate #define BODYFORCE to get around this.

It sounds like you might be asking if you can disable vertical mixing of a passive tracer only, but leave mixing on the active tracers (temp and salt). This is tricky.

It may seem, as you say, that you can #define ANA_VMIX and then in Functionals/ana_vmix.h customize the settings for your application.

So you could retain a finite value for Akv, which would enable stresses to still drive the circulation (though with much less realism than a turbulence closure scheme) and also set Akt(i,j,k,itrc) as you wish for the respective values of itrc. itrc=1 (temp), itrc=2 (salt) and itrc=3... (your passive tracers). You could have finite values for temp and salt, and zero for passive tracers.

But, there is a catch.

In step3d_t.F there is the code that timesteps the vertical diffusion term for tracers.

Code: Select all

!-----------------------------------------------------------------------
!  Time-step vertical diffusion term.
!-----------------------------------------------------------------------
It loops through all tracers in turn using their respective values Akt for each tracer. But notice how it is coded ...

Code: Select all

      DO itrc=1,NT(ng)
          ltrc=MIN(NAT,itrc)
          ...
          ...
              DO i=Istr,Iend
                FC(i,k)=cff1*Hz(i,j,k  )-                               &
     &                  dt(ng)*Akt(i,j,k-1,ltrc)*oHz(i,j,k  )
                CF(i,k)=cff1*Hz(i,j,k+1)-                               &
     &                  dt(ng)*Akt(i,j,k+1,ltrc)*oHz(i,j,k+1)
              END DO
          
The second line is ...

Code: Select all

 ltrc=MIN(NAT,itrc)
NAT is the number of active tracers (=2 if you have temp and salt). So all the passive tracers (itrc>2) use the mixing coefficient for salt (NAT = 2). The Akt you set in ana_vmix.h would be ignored.

But your opportunity to disable mixing on passive tracers only (itrc>2) is right here. You can change the range of the opening DO loop to

Code: Select all

       DO itrc=1,NAT
so that for itrc = 3, 4.... nothing happens.

This is a hack, but if no vertical mixing on passive tracers but all the original mixing physics on the active tracers is what you want, this might work.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply