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

Questions and remarks about Code_Saturne usage
Forum rules
daniele
Posts: 80
Joined: Wed Feb 01, 2017 11:42 am

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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