I am trying to implement a model that requires that I have access to the shear rate in each cell in laminar low. I can see how this can be found if I were using turbulence modeling, but I cannot find it for the viscous case. Are the stresses stored in an array or will I have to calculate them manually?
I'm sure this question has been answered before, but many hours of searching have not given me a result. I am also still becoming familiar with the user subroutines, the naming scheme has a steep learning curve. Thank's for your help!
Shear stress in user subroutine.
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 118
- Joined: Mon Feb 20, 2012 2:07 pm
Re: Shear stress in user subroutine.
Hello,
You have to (re)compute it manually. You can use cs_user_extra_operation.f90 to do this.
You must use gradient function to compute velocity gradient (the gradient function name is dependant of ur Code_Saturne version).
Which version are you using ?
Regards,
You have to (re)compute it manually. You can use cs_user_extra_operation.f90 to do this.
You must use gradient function to compute velocity gradient (the gradient function name is dependant of ur Code_Saturne version).
Which version are you using ?
Regards,
Re: Shear stress in user subroutine.
I am using the most recent release 3.3. Thanks for your help!
-
- Posts: 118
- Joined: Mon Feb 20, 2012 2:07 pm
Re: Shear stress in user subroutine.
Ok.
So you can use something like this to compute velocity gradient:
So you can use something like this to compute velocity gradient:
Code: Select all
!===========================================
! Decl
integer inc , iprev
double precision, allocatable, dimension(:,:,:) :: gradv
!============================================
! Code
allocate(gradv(3,3,ncelet))
inc = 1
iprev = 1
call field_gradient_vector(ivarfl(iu), iprev, imrgra, inc, &
gradv)
Re: Shear stress in user subroutine.
Thanks for your help! This subroutine is very convenient, but I do have one question. Does it return the gradient in simulation units or in a normalized format? I ask because for two different velocity fields the magnitude of the gradient tensor is always quite close to one with a much different mean velocity.
Thanks!
Eric
Thanks!
Eric