Closed MakisH closed 5 years ago
I just now pushed a new branch, FSI on which we can collaborate to create the FSI module. If you don't have collaborative access to this repository, please comment here on what you would like to implement and then create a pull request. It is strongly suggested that you keep each feature on a separate branch on your side, so that you can always easily merge changes from the original branch. This is also a great opportunity to develop this as a community project.
Please make sure that all your pull requests are building successfully and try to document everything.
Especially: write comments! What does this method do? Whis equation is represented in a computation? Are there any known limitations? Is there any feature missing that we should add in the future? Always mark these with TODO:
. If you are not sure about something, write it! We can then look on it together. :-)
Useful resources:
My first commit in this branch was only to add a skeleton for the FSI/FSI.H
and FSI/FSI.C
files. I will add as much as I can today and during next week and I will comment here on which tasks are left. I will probably need help in the validation part and in some FSI-specific aspects.
I added all the needed (dummy) classes and the missing support for vector data types. I am now looking for ways to implement the forces/displacements coupling data users. If you have any thoughts/ideas, they are welcome!
Forces: There is a Forces functionObject since at least OpenFOAM 3. Maybe we could rely on this?
Displacements: ?
Hey Makis,
Concerning the Forces:
The Code of the OpenFOAM file forces is a good indication for how to get this information. Basically, the forces consist of a viscous part resulting in a shear force and a pressure part resulting in a normal force. The viscous stress tensor for the shear forces can be obtained by using -rho *nu*dev(twoSymm(fvc::grad(U)))
. The pressure is already calculated for every cell due to the simulation. Then, you can access information about the cell area and normal vector with the surfaceVectorField::GeometricBoundaryField
object.
I would recommend to create a volVectorField
, where you store the Data of the Forces (Pressure, depending on your solid solver). Then, you can handle this data like e.g. the velocity field and pick out the information you need.
Concerning the displacements:
How you handle this depends strongly on your mesh motion solver. You can use on of the laplacian solvers for instance. They solve a laplace equation for every movement. The boundary conditions need to be set in an additional file (normally only in the 0 time directory). But you can overwrite the files with the displacements for every timestep by using a const_cast
of the respective field. When you use a velocity based solver, you need to divide the displacement in addition by the timestep size. Then, you can even use the more sophisticated FE based mesh motion solver.
Best Regards
Hi Makis,
For my thesis in Fluid-structure interaction on flexible wings I want to couple openFoam with Calculix. I would like to contribute to the FSI part of the openfoam-adapter for that purpose.
As David mentioned a function object indeed exists for the computation of the forces. Here the tangential and normal component of the force are computed and integrated over the relevant patch. I think we can reuse parts of this code to compute the tangential and normal component on each of the boundary cells in a similar way the heat flux is computed in the CHT part to create a vector of the forces.
I would like to collaborate by adding the force and displacement functionalities to the adapter. Furthermore, I want to validate the coupling using the FSI benchmark case for a cylinder with a flap. This could maybe serve as a tutorial when the coupling is complete.
Dear David, dear Derek,
thank you both very much for your help and motivation. At the moment I am at a conference and I have limited access to my computer, but I will come back to you on Monday.
I think what David suggests should greatly help complete the puzzle.
Best regards, Makis
Hey Makis,
Awesome, that this project is pushed now! I am writing my thesis about FSI in composites processing simulation (mold filling), so I need to model a (compressible) two-phase flow with FSI. We already have some customized solvers for our process modeling, thats why I would like to stick witch OpenFOAM. I would also like to contribute to this project. I will first pull the latest FSI branch and have a look what you have already done so far.
One question I already came across was also related to the displacements. The laplace mesh motion solvers are based on "pointFields" (pointDisplacement or pointMotion). So when we dont want to do the coupling on two different meshes (surface centers for forces and points for displacement) I think we have to interpolate somewhere and then only use the point mesh or preferably the surfaces for mapping. I think there are already functions for pointToSurface mapping and vice versa but I will have a look at that.
Of course I could then also contribute some tutorial case.
Cheers, Julian
In order to support mechanical fluid-structure interaction, we need a module similar to the one for conjugate heat transfer. The adapter also needs a few additions that can also be tested in this type of problem.
Roughly, the following sub-tasks are required:
preciceAdapter::Interface::addCouplingDataWriter
andpreciceAdapter::Interface::addCouplingDataReader
in the Interface.C.FSI.H
andFSI.C
, similarly to the CHT.H and CHT.C. They should declare and define the methodsconfigure(const YAML::Node adapterConfig)
,addWriters(std::string dataName, Interface * interface)
, andaddReaders(std::string dataName, Interface * interface)
. These methods must be called in the Adapter.C in two places (see comments withNOTE
). A distinction among different solver types may need to be defined (most probably different than the one for CHT). Everything should be in theFSI
namespace.CouplingDataUser
class and to define thewrite(double * buffer)
andread(double * buffer)
methods. They should be in the namespaceFSI
.preciceAdapter::Adapter::configFileRead()
.preciceAdapter::Adapter::setupCheckpointing
,preciceAdapter::Adapter::readCheckpoint
, andpreciceAdapter::Adapter::writeCheckpoint()
methods and create the respectivepreciceAdapter::Adapter::addCheckpointField(...)
.movePoints()
.Probably not needed:
updateMesh(const mapPolyMesh& mpm)
andmovePoints(const polyMesh& mesh)
in the preciceAdapterFunctionObject.H and preciceAdapterFunctionObject.C. What do they need to do inside the adapter? We probably need to update the interface nodes locations at the preCICE interface.After a first version is ready:
CHTenabled_
tofalse
by default and update the tutorials and documentation.See also the wiki page How to extend the adapter.