
function qdot = rhsf(q)

global ngrd ldom cv Rgas M Tcnd mu nvar Lperiodic rho v u e P T qflx tau xgrd dx beta;

   setPrimitiveVarsFromQ;

   qflx = -Tcnd*der1(T,dx,Lperiodic);
   %tau  = -4/3*mu*der1(v,dx,Lperiodic);
   tau  = -mu*der1(v,dx,Lperiodic);

   qdot = zeros(ngrd,nvar);

   %------------- continuity equation

   qdot(:,1) = -der1( q(:,2), dx, Lperiodic );

   %------------- momentum equation

   qdot(:,2) = -der1( q(:,2).*v + beta*P + tau, dx, Lperiodic );

   %------------- energy equation

   qdot(:,3) = -der1( (q(:,3) + P + tau).*v + qflx, dx, Lperiodic );


end
