what is efforts in code saturne

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
César Vecchio

Re: what is efforts in code saturne

Post by César Vecchio »

Thank you Yvan, your information was valuable. I found the error, it ended up being something quite childish from my part. I was thinking all the time in the classic formula for 2D airfoils where instead of using the surface for adimensionalization, we use the chord. However, I forgot that despite I'm trying to solve a 2D case, I must model it as a 3D case, and therefore I do have to take into account the airfoil surface and not only its chord, even if the depth is minimal and with only one element. The depth of my mesh was not 1 but a tenth of the chord, a value chosen so to be sure the nonplanar velocity components would be zero (besides symmetry condition for the lateral walls), but that small depth was not taken into account in my coefficient formula.

As my original chord is 0.1524m, the depth becomes 0.01524m and we can find my error factor dividing by this depth: 0.01524^(-1)=65.617... yes, the scaling factor I was lacking of :). So, here below I write the corrected formula:

DO II=1,NDIM
      XCOF(II) = xfor(II)  /  ((1.0d0/2.0d0) * RO0(1) * UREF(1)**2 * ALMAX(1)**2/10.0d0)
ENDDO


In my case I set the reference length ALMAX(IPHAS) to be my chord length, that's the reason of its inclussion in the formula.

I wasn't having that problem with the pressures for the simple reason the pressure is already divided by the surface, the whole surface and not just the chord.

Thanks to all of you and my apologies for making the thread unnecessarily long, I should have payed more attention.
Brennan Sharp

Re: what is efforts in code saturne

Post by Brennan Sharp »

Hello,
Does the efforts example in the usproj.f90  reference file return total force for the nominated group of faces, or does it return the individual forces on each face in the group?  The code looks as though it calculates total, yet when I view Efforts in the MED file, using Salome, I see efforts as a varying quantity across all of the surfaces (depending on the visualisation method).
What I'm hoping for is to get a single number that is the total force at the inlet boundary.
 
Regards,
 
Brennan
James McNaughton

Re: what is efforts in code saturne

Post by James McNaughton »

In the example the sum xfor(ii) is the total in the ii'th direction. So yes you are correct you will return the total force over a group. The "efforts" at individual face are what are summed in that loop so that ra(iforbr + (ifac-1)*ndim + ii-1) gives the force on that particular face (in the ii'th direction). In the postprocessor the outputted value is per face as in Yvan's post above and not the xfor calculated in usproj.
Hope that helps,
James
Brennan Sharp

Re: what is efforts in code saturne

Post by Brennan Sharp »

Thanks James, that helped and now I know what to expect to see and realise I need to write out xfor, which presents a different problem.

The table below shows how calculated effort in Z-direction at nominated boundary somehow depends on parallel computing.

Cores Effort(3) (Computer node utilisation)
-------- -------------

2.37mN (1/2, 0/4, 0/4) (single core run on local machine, not migrated to cluster)
1.18mN (0/2, 2/4, 0/4)
1.04mN (0/2, 3/4, 0/4)
0.592mN (0/2, 4/4, 0/4)
0.592mN (0/2, 4/4, 1/4)
0.592mN (0/2, 4/4, 2/4)
0.592mN (0/2, 4/4, 3/4)
0.592mN (0/2, 4/4, 4/4)


For the cases of 1 - 4 cores, the results appear to be 2.37mN/Ncores), although this simple relationship could be in part due to the evenly divided partitioning of the boundary for this case. Although I can understand that running parallel could affect the calculation like this, it's not what I expected.

Searching other topics in this forum the problem (or very similar) has been encountered before and solved, so I'll try to decipher those discussions and apply them to my problem, but if anyone can post a parallel-working efforts calculation in usproj.f90 for this application, I'd be grateful.

Regards,

Brennan


My mistake. I wrote xfor out too soon - i.e. before the "call parrsm(...)" . I'm happy.
Bruno Furieri

Re: what is efforts in code saturne

Post by Bruno Furieri »

Hello,

anybody knows how to calculate wall shear stress in Code_Saturne? I've tested the following routine but it gives the same values as "Efforts"!

elseif(ipart.eq.3) then

  ! Initialize variable name
  do ii = 1, 32
    namevr (ii:ii) = ' '
  enddo

  ! Variable name
  namevr = 'WSS Wall B'

!       Dimension de la variable (3 = vecteur, 1=scalaire)
    idimt = 3
  
! Compute variable values on boundary faces.

!       Calcul des valeurs de la variable sur les faces de bord

    do iloc = 1, nfbrps
      ifac = lstfbr(iloc)
      surfbn = ra(isrfbn-1+ifac)

 sface = SQRT(SURFBO(1,IFAC)**2+SURFBO(2,IFAC)**2+SURFBO(3,IFAC)**2)

      trafbr(1 + (iloc-1)*idimt ) =                               &
             (ra(iforbr+(ifac-1)*idimt  )/sface)
      trafbr(2 + (iloc-1)*idimt ) =                               &
             (ra(iforbr+(ifac-1)*idimt+1)/sface)
      trafbr(3 + (iloc-1)*idimt ) =                               &
             (ra(iforbr+(ifac-1)*idimt+2)/sface)
    enddo

!           Valeurs entrelacées, définies sur tableau de travail
      ientla = 1
      ivarpr = 0

  ! Output values
  call psteva(ipart, namevr, idimt, ientla, ivarpr,         &
  !==========
              ntcabs, ttcabs, tracel, trafac, trafbr)

 
As I've seen in this forum, "Efforts" are in Newton?!?
 
Thank you all for your attention.
 
Bruno FURIERI
Post Reply