effortts calculation (F=PxS)

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
stage75

effortts calculation (F=PxS)

Post 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
stage75

Re: effortts calculation (F=PxS)

Post by stage75 »

No idea !! :?:
JamesMcNaughton
Posts: 72
Joined: Mon Mar 19, 2012 1:21 pm

Re: effortts calculation (F=PxS)

Post 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...
stage75

Re: effortts calculation (F=PxS)

Post 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
stage75

Re: effortts calculation (F=PxS)

Post 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
JamesMcNaughton
Posts: 72
Joined: Mon Mar 19, 2012 1:21 pm

Re: effortts calculation (F=PxS)

Post 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).
stage75

Re: effortts calculation (F=PxS)

Post 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!
JamesMcNaughton
Posts: 72
Joined: Mon Mar 19, 2012 1:21 pm

Re: effortts calculation (F=PxS)

Post 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
stage75

Re: effortts calculation (F=PxS)

Post 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. ;) :?
Yvan Fournier
Posts: 4105
Joined: Mon Feb 20, 2012 3:25 pm

Re: effortts calculation (F=PxS)

Post 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
Post Reply