ALE simulations: local fluid force on specific rigid body positions

Questions and remarks about Code_Saturne usage
Forum rules
Please read the forum usage recommendations before posting.
daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

ALE simulations: local fluid force on specific rigid body positions

Post by daniele » Mon Oct 14, 2019 2:02 pm

Hello,

When performing ALE simulations with the internal coupling for rigid body/mesh displacement computation, fluid forces are monitored during the simulation. I guess the default printed value represents the integral of the fluid forces along the i-direction on the rigid body.
Is there a way of monitoring the local fluid forces on specific user-defined points of the rigid body? For a tube moving in the Z and X directions, can I obtain N local forces values along the Y direction?

Thank you very much in advance.

Best regards,

Daniele

Luciano Garelli
Posts: 234
Joined: Fri Dec 04, 2015 1:42 pm

Re: ALE simulations: local fluid force on specific rigid body positions

Post by Luciano Garelli » Tue Oct 15, 2019 6:20 pm

Hello,

I really don't understand very well the question....but the forces computed are normal and tangencial to specific faces and also you can get the X,Y,Z with respect to the global reference.

If the object is moving in the Z and X direction I don't understand why do you get forces in the Y direction.

Regards,
Luciano

daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

Re: ALE simulations: local fluid force on specific rigid body positions

Post by daniele » Wed Oct 16, 2019 8:44 am

Hello,

Thank you for your help. I don't want to get the force on the Y direction, but to create N points along Y (of the rigid body), where to monitor X and Z forces...

Hope my question is clearer now...

Thank you very much.
Regards,

Daniele

Luciano Garelli
Posts: 234
Joined: Fri Dec 04, 2015 1:42 pm

Re: ALE simulations: local fluid force on specific rigid body positions

Post by Luciano Garelli » Wed Oct 16, 2019 9:25 am

Hello,

But these "points" should be associated to some surface or area in order to compute forces, or chose the boundary face in the rigid body which contain or is placed the point.

After you have selected the face or surface(faces) you can computed the forces using the cs_user_extra_operations, which is call every time step.

Regards,
Luciano.

daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

Re: ALE simulations: local fluid force on specific rigid body positions

Post by daniele » Mon Nov 18, 2019 2:34 pm

Hello,

I am still trying to get the forces on selected faces, but I have some issues.
I simply write the following, inside the cs_user_extra_operations.f90:

Code: Select all

call getfbr('STRUCT_WALL and y<0.5', nlelt, lstelt)
    do ilelt = 1, nlelt
       ifac = lstelt(ilelt)
       fx_1=fx_1+forstr(1,ifac)
    enddo
This seems to work fine. The problem arises when I try to print "fx_1" inside a new user file:

Code: Select all

97      format(3g17.9)
impout = impusr(100)
if (irangp.le.0) then
    open(impout,file='force_1_x.dat',position="append")
    write(impout,97) ttcabs, fx_1
    close(impout)
  endif
When I add these lines, I get a SIGSEGV during the first iteration...

Do you have any idea of the problem?

Thank you very much.

Best regards,

Daniele

Yvan Fournier
Posts: 2872
Joined: Mon Feb 20, 2012 3:25 pm

Re: ALE simulations: local fluid force on specific rigid body positions

Post by Yvan Fournier » Mon Nov 18, 2019 7:44 pm

Hello,

Your prinf format specifies 3 values but you print only 2, which is the probable cause of the crash.

Try with 2g17.9

Regards,

Yvan

daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

Re: ALE simulations: local fluid force on specific rigid body positions

Post by daniele » Thu Nov 21, 2019 10:35 am

Dear Yvan,

Thank you for your help. Unfortunately, even changing the format I get the same error.
I attach the cs_user_extra_operations.f90 I use, just in case it could help more.

Thanks a lot.

Best regards,

Daniele
Attachments
cs_user_extra_operations.f90
(4.18 KiB) Downloaded 11 times

Luciano Garelli
Posts: 234
Joined: Fri Dec 04, 2015 1:42 pm

Re: ALE simulations: local fluid force on specific rigid body positions

Post by Luciano Garelli » Thu Nov 21, 2019 1:03 pm

Hello,

Maybe the error is that the file does not exist and can not be appended the data. Try adding
open(impout,file='force_1_x.dat', status="unknown", position="append")

When I write some data to a file, in the first iteration I create the file, write some header with info about the data to be written and I close it.
Then I append the data to this file.

Regards,
Luciano

daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

Re: ALE simulations: local fluid force on specific rigid body positions

Post by daniele » Fri Nov 22, 2019 1:35 pm

Dear Luciano,

Thank you for your suggestion. Adding the option does not prevent the problem to occur :(
I attached also the listing showing some details of the error.

Best regards,

Daniele
Attachments
listing.txt
(29.8 KiB) Downloaded 9 times

Luciano Garelli
Posts: 234
Joined: Fri Dec 04, 2015 1:42 pm

Re: ALE simulations: local fluid force on specific rigid body positions

Post by Luciano Garelli » Fri Nov 22, 2019 1:55 pm

Hello,

I think that the problem is not the write line.

The forstr array has dimension(3,nstrmx), I think if you want to compute the fluid forces acting on the structure you have to use the iforbr field id.

Take a look at the files cs_user_fluid_structure_interaction.f90 and cs_user_extra_operations-global_efforts.f90

Regards,

Luciano

Post Reply