Page 1 of 4

effortts calculation (F=PxS)

Posted: Mon Sep 03, 2012 12:02 pm
by stage75
Hi,

I want to calculate and display (in post processing) the forces applied to a BC. The number of my BC is 201, so I modified the USPROJ.F90 subroutine like this :

Code: Select all

! compute the efforts applied on a face number 201
!    ----------------------------------------------------
!===============================================================================

! ----------------------------------------------

iutile = 0

if (iutile.eq.0) return

! ----------------------------------------------

! If efforts have been calculated correctly:

if (ineedf.eq.1) then

  do ii = 1, ndim
    xfor(ii) = 0.d0
  enddo

  call getfbr('201', nlelt, lstelt)
  !==========

  do ilelt = 1, nlelt

    ifac = lstelt(ilelt)

    do ii = 1, ndim

xfor(ii) = xfor(ii) + iforbr(ii, ifac)
    enddo

  enddo
  if (irangp.ge.0) then
    call parrsm(ndim,xfor)
  endif
endif
return
end subroutine
Is this right or not? Thanks

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 9:16 am
by stage75
No idea !! :?:

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 9:19 am
by JamesMcNaughton
The forces are displayed in the post-processing by default (efforts).

If you want to print them to a file or something then you can use usproj as you suggest though delete the lines:

Code: Select all

iutile = 0

if (iutile.eq.0) return
Or change the value of iutile...

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 9:47 am
by stage75
HI James Thank's for your response,

When I Write this line

Code: Select all

xfor(ii) = xfor(ii) + iforbr(ii, ifac)
in USPROJ.F90 I get this error :

Code: Select all

mm@cict.fr :SRC.1$ code_saturne compile
gfortran -I/serveur/logiciels/saturne/cs-2.0/include -x f95-cpp-input -Wall -Wno-unused  -D_CS_LANG_FR -D_CS_FC_HAVE_FLUSH  -O -c /home/mmeziane/Documents/STUDY/CASE1/SRC.1/usproj.f90
/home/mmeziane/Documents/STUDY/CASE1/SRC.1/usproj.f90:341.31:

[b]   xfor(ii) = xfor(ii) + iforbr(ii, ifac)
                               1
Error: PROCEDURE attribute conflicts with COMMON attribute in 'iforbr' at (1)[/b]
gfortran -I/serveurVega/logiciels/saturne/cs-2.0/include -x f95-cpp-input -Wall -Wno-unused  -D_CS_LANG_FR -D_CS_FC_HAVE_FLUSH  -O -c /home/mmeziane/Documents/STUDY/CASE1/SRC.1/ussatc.f90
gfortran -I/serveurVega/logiciels/saturne/cs-2.0/include -x f95-cpp-input -Wall -Wno-unused  -D_CS_LANG_FR -D_CS_FC_HAVE_FLUSH  -O -c /home/mmeziane/Documents/STUDY/CASE1/SRC.1/usini1.f90
gfortran -I/serveurVega/logiciels/saturne/cs-2.0/include -x f95-cpp-input -Wall -Wno-unused  -D_CS_LANG_FR -D_CS_FC_HAVE_FLUSH  -O -c /home/mmeziane/Documents/STUDY/CASE1/SRC.1/usclim.f90

Is this right if I right just iforbr and not iforbr (ii, ifac),

Code: Select all

xfor(ii) = xfor(ii) + iforbr

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 10:00 am
by stage75
In post processing I don't have the "efforts" !

I have juste in FIELDS :

-CFL
-FOURNIER NUMBER
-PRESSURE
-REL PRESSURE
-REL VELOCITY
-TOTAL PRESSURE
-TURB DISSIP
-TURB KINETIC ENEGY
-TURB VISCOSITY
-VELOCITY

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 11:12 am
by JamesMcNaughton
You're using saturne 2.0 so you should use the usproj of that version.. check your previous post here http://code-saturne.org/forum/viewtopic ... 6077#p6077 (use the line you commented out).

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 1:07 pm
by stage75
I use this line ?

Code: Select all

(xfor(ii) = xfor(ii) + iforbr
)

I didn't have the "efforts" on the post processing menu!

Re: effortts calculation (F=PxS)

Posted: Tue Sep 04, 2012 3:06 pm
by JamesMcNaughton
Change this line:

Code: Select all

xfor(ii) = xfor(ii) + forbr(ii, ifac)
To:

Code: Select all

xfor(ii) = xfor(ii) + ra(iforbr + (ifac-1)*ndim + ii-1)
That should work as per the v2.0.1 example of usproj..

Cheers

Re: effortts calculation (F=PxS)

Posted: Wed Sep 05, 2012 8:45 am
by stage75
Thanks James,

Maybe I was not clear, what I want is to calculate the force on a wall that will allow me to calculate the Moment, ie at the end I get a single value. ;) :?

Re: effortts calculation (F=PxS)

Posted: Wed Sep 05, 2012 1:13 pm
by Yvan Fournier
Hello,

Following Jame's post, you should be able to loop on boundary faces to integrate the contribution of the force to the moment you are trying to compute.

Regards,

Yvan