Welcome, Guest
Username: Password: Remember me

TOPIC: Calculate velocity derivative

Calculate velocity derivative 13 years 11 months ago #1033

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Hello.

I want to compute derivative of the velocity component u with respect to x (eg. du/dx). I found that BIEF function vector can do that and its result is du/dx*L (L-mesh element size). Is there a way to eliminate mesh size and compute only du/dx?

Thanks.
Budo
The administrator has disabled public write access.

Re:Calculate velocity derivative 13 years 11 months ago #1034

  • jmhervouet
  • jmhervouet's Avatar
Hello Budo,

Yes, this is very classical. You have to divide by the integral of the test function, which is the result of subroutine vector with formula 'MASBAS '. You must be careful in parallel, integrals of test functions must be assembled (CALL PARCOM...) before division, and after division the derivative must be assembled (another CALL PARCOM...) to get nodal values. This is for nodal values to be used in a formula. If the derivative is a term in a variational formulation, the result of VECTOR can generally be readily used because the element size is required. If necessary I can tell you tomorrow where to find an example (stress tensor in k-epsilon model, where du/dx is computed).

With best regards,

Jean-Michel
The administrator has disabled public write access.

Re:Calculate velocity derivative 13 years 11 months ago #1035

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Thank you Jean-Michel.

I want to add additional source terms that include du/dx and dv/dy in tracer equation. Since integrated source term are already multiplied by the integral of test function, I should exclude it from the computation of derivatives. I'm I right?

If you could point me to the file where the derivatives are computed in k-epsilon model, I would appreciate it a lot.

Best regards,
Budo
The administrator has disabled public write access.

Re:Calculate velocity derivative 13 years 11 months ago #1036

  • jmhervouet
  • jmhervouet's Avatar
Hello Budo,

Well I can't find a clear example because actually I always find a trick to avoid the division. So let's invent it :

your nodal DU/DX will be in T2 :

! only first U in the list of arguments used here
CALL VECTOR(T2,'=','GRADF X',IELMU,
& 1.D0,U,U,U,U,U,U,MESH,MSK,MASKEL)
IF(NCSIZE.GT.1) CALL PARCOM(T2,2,MESH)
! here U not used in the arguments and I suppress the masking by harcoding a .FALSE.
CALL VECTOR(T1,'=','MASBAS ',IELMU,
& 1.D0,U,U,U,U,U,U,MESH,.FALSE.,MASKEL)
IF(NCSIZE.GT.1) CALL PARCOM(T1,2,MESH)
! if no element masking no risk of division by zero...
CALL OS('X=Y/Z ',X=T2,Y=T2,Z=T1)

But if your equation is :

df/dt... = DU/DX only the first CALL VECTOR would be sufficient, because the variational formulation implies the multiplication by the element size.

And that's it!

With best regards and merry Christmas,

Jean-Michel
The administrator has disabled public write access.

Re:Calculate velocity derivative 13 years 11 months ago #1037

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Jean-Michel, thank you very much.

Maybe the masking would be needed in the case of tidal flats. In that case, I'll have to include MSK insted of .FLASE. in MASBAS step. Am I right?

My equation is df/dt... = Src/H that is hardcoded in TELEMAC. I want to use all the facilities available and it is easier for me to utilize the function that prescribes Src and during integration this term is multiplied by the integral of the test function. I know this is not optimal from the computational time point of view, but correctness is more important to me than the speed.

Best regards. I wish you a Merry Christmas and a Happy New Year.
Budo
The administrator has disabled public write access.

Re:Calculate velocity derivative 13 years 11 months ago #1038

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Disregard my first point in previous message. I forgot that the problem is dividing by zero element size in the case of masking :)
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.