precice / openfoam-adapter

OpenFOAM-preCICE adapter
https://precice.org/adapter-openfoam-overview.html
GNU General Public License v3.0
135 stars 80 forks source link

Precice interfoam controlDict example #323

Closed ec2608 closed 6 months ago

ec2608 commented 6 months ago

I am currently working on merging interfoam with a code written in c that calculates the response of a rigid body. this is generally similar to the quickstart tutorials except that the body is a rectangular prism floater, half of it in water the other half in air. As such I am using interfoam. I understand that there are previous examples where precise was successfully used with interfoam, but I am not sure at this stage what should appear in controldict of openfoam. here is what I currently have: functions { forces { type forces; libs ( "libforces.so" ); patches (floatingObject); rho rho; log true; rhoInf 10; CofR (0 0 0); }

preCICE_Adapter
{
    type preciceAdapterFunctionObject;
    libs ("libpreciceAdapterFunctionObject.so");
}

}

I have seen people suggesting to use rho or rhoInf in the corresponding field. Haven't seen much difference with either when I guess I should.

This is what i currently have in my precice-Dict: FSI { rho rho [1 -3 0 0 0 0 0] 1; }

I have also tried maoxm's open-foam version of the adapter which didn't seem to make a change. I should also say that unlike other reported issues my problem was not with the forces in precisc disagreeing with the forces reported in openfoam, but instead with the forces reported in the text files of openfoam already being much larger than they should be as soon as the floating body moves. I know much more info is needed but i thought I would start a thread as I have been circling between different solutions for what may already be a known solution.

MakisH commented 6 months ago

Hi @ec2608,

this looks like a question on how to use the adapter for a specific use case. Until we verify there is a bug that needs to be addressed in this repository, let's continue the discussion in the preCICE forum. More users might be able to help there.