CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Solver for FSI strongly coupled (http://www.cfd-online.com/Forums/openfoam-programming-development/85087-solver-fsi-strongly-coupled.html)

charbel February 17, 2011 05:25

Solver for FSI strongly coupled
 
Hi,
I am new user of OpenFOAM (OF-1.6) and I want to study a flow past a flexible, elastic, tab fixed on a channel wall. The first simulations I made were for non-flexible tab using pisoFoam and everything worked fine. Now I want to study the FSI between the flow and the flexible tab.

My questions are below:
1) Can I use icoFsiFoam for my case?
2) Is icoFsiFoam adapted for weak or strong dynamical coupling?
3) I tried to compile icoFsiFoam on OF-1.6 but several erros have occurred. Do I need to have the older version OF-1.4 or there is some solution to compile icoFsiFoam on OF-1.6?
4) Can icoFsiFoam be used for turbulent flows?

Thank you very much.
Charbel.

charbel February 23, 2011 10:43

icoFsiFoam with OpenFOAM-1.6-ext
 
Hi,
Thanks Mathieu.

icoFsiFoam works with OpenFOAM-1.6-ext:
http://sourceforge.net/projects/openfoam-extend/develop

I have successfully compiled OpenFoam-1.6-ext and icoFsiFoam tutorial is working well.

Best regards,
Charbel.

charbel April 13, 2011 11:35

FSI solver based on pimpleDyMFoam
 
2 Attachment(s)
Hi,
enclosed please find a solver and a test case that I am trying to made for fluid/structure interaction basing on pimpleDyMFoam ...
I am not sure from the outer loop iterations I made (using Aitken or constant relaxation). Can any one give me some hints please!!
In fact when using the solver for the enclosed test case, the mesh blows after some time steps I do not know why!! The test case is the same as flappingConsole with some modifications.
Can you test try this solver for some other cases and tell me if it works?!!
Best regards,
Charbel.

timo_IHS April 28, 2011 04:46

Hello Charbel,

your approach looks really nice.
something is wrong with the connection between solid and fluid, even for weak coupling! you should concentrate on that! I would first test it with solver of icoFsiFoam...

Best regards!

charbel May 1, 2011 09:25

Hello Timo,

Thank you for your post.

For weak coupling I am using the same connection between Fluid & Solid as in icoFsiFoam. I do not understand where you see the error. Can you please precise?

Best regards,
Charbel.

timo_IHS May 2, 2011 11:28

When I start your solver with weakCoupling, the mesh blows.
With you it doesn't!?

timo_IHS May 3, 2011 05:26

Okay I found the problem (for weak coupling):
you have to initialize the UsolidPrev like this:

volVectorField UsolidPrev
(
IOobject
(
"UsolidPrev",
runTime.timeName(),
stressMesh,
IOobject::NO_READ
),
Usolid
);
UsolidPrev = Usolid.oldTime();

charbel May 3, 2011 08:14

Hello Timo,
Indeed I have not pay attention to this error, thank you a lot.
Please correct me if I am wrong: I can do the same thing if I modify the weakCoupling.H to:

{

# include "solveFluid.H"
# include "setPressure.H"
# include "solveSolid.H"
{
// Setting mesh motion
pointVectorField solidPointsDispl = cpi.interpolate(Usolid - Usolid.oldTime());

vectorField newPoints = stressMesh.points() + solidPointsDispl.internalField();

stressMesh.movePoints(newPoints);

interpolatorSolidFluid.movePoints();

vectorField fluidPatchPointsDispl =
interpolatorSolidFluid.pointInterpolate
(
solidPointsDispl.boundaryField()[solidPatchID].
patchInternalField()
);

motionUFluidPatch ==
tppi.pointToPointInterpolate
(
fluidPatchPointsDispl/runTime.deltaT().value()
);

mesh.update();

# include "volContinuity.H"

Info << "Motion magnitude: mean = "
<< average(mag(Usolid.boundaryField()[solidPatchID]))
<< " max = "
<< max(mag(Usolid.boundaryField()[solidPatchID])) << endl;
}

}

Best regards,
Charbel.

timo_IHS May 3, 2011 09:03

You're right, you can also use the original implementation.
But you can't replace
Usolid.oldTime()
by
volVectorField UsolidPrevious

you have to use the IOobject, which is related to "stressMesh".


BTW: what's your application for FSI?

charbel May 3, 2011 10:11

must I also apply this when I define
volVectorField UsolidPrevious = 0*Usolid; //which is used in setMotion.H
volVectorField DeltaU1 = 0*Usolid;
volVectorField DeltaU2 = 0*Usolid;
volVectorField rr1 = 0*Usolid;
for the strong coupling?
In fact I want to apply the FSI for mixing enhancement.

charbel May 6, 2011 10:40

I modified weakCoupling.H to:

Code:

{
# include "solveFluid.H"
# include "setPressure.H"
# include "solveSolid.H"
{
// Setting mesh motion
    pointVectorField solidPointsDispl = cpi.interpolate(Usolid - Usolid.oldTime());
    vectorField newPoints =
        stressMesh.points() + solidPointsDispl.internalField();
    stressMesh.movePoints(newPoints);
    interpolatorSolidFluid.movePoints();
    vectorField fluidPatchPointsDispl =
        interpolatorSolidFluid.pointInterpolate
        (
            solidPointsDispl.boundaryField()[solidPatchID].
            patchInternalField()
        );
    motionUFluidPatch ==
        tppi.pointToPointInterpolate
        (
            fluidPatchPointsDispl/runTime.deltaT().value()
        );

    mesh.update();
#  include "volContinuity.H"
    Info << "Motion magnitude: mean = "
        << average(mag(Usolid.boundaryField()[solidPatchID]))
        << " max = "
        << max(mag(Usolid.boundaryField()[solidPatchID])) << endl;
}
}

is it good now?
Best regards,
Charbel.

charbel July 7, 2011 07:54

1 Attachment(s)
Hi everyone,

You can find here a new solver that I am trying to make for fluid-structure interaction.
I am working on version 1.6-ext.

This solver included:
1/ pimpleDyMFoam in which we have ALE and turbulence models can be used
2/ outer fixed point adaptive relaxation by using Aitken's method for strong coupling
3/ solve transport equations for heat and mass transfer
4/ solid solver for large deformattion (2nd Piola-Krichhoff stress tensor...)
5/ computing traction in setPressure.H but it is not taken into account in tractionDisplacementFvPatchVectorField.C can you give some hint please

Can you try this solver on the attached testCase and give me remarks because I am sure there will be some mistakes especially for:
1/ Aitken's method
2/ solid solver and its part in tractionDisplacementFvPatchVectorField.C
3/ setting traction in tractionDisplacementFvPatchVectorField.C


Thank you in advance.
Charbel.

elvis July 7, 2011 11:02

Hello,

on the last OpenFoam workshop at Penn State FSI was one topic of the trainings.
http://www.openfoamworkshop.org/6th_...m/training.htm
http://www.openfoamworkshop.org/6th_...ven_slides.pdf http://www.openfoamworkshop.org/6th_...erTraining.tgz

*this might be best *http://www.openfoamworkshop.org/6th_...ell_slides.pdf http://www.openfoamworkshop.org/6th_...mpbell_fsi.tgz

Numerical simulation of sailing boats dynamics FSI and shape optimization RANS and LES of Turbulent Combustion based on Flamelet Generated Manifolds
Matteo Lombardi (École Polytechnique Fédérale de Lausanne)

more FSI stuff see other presentations
etc.

http://www.openfoamworkshop.org/6th_...rdi_slides.pdf

charbel July 11, 2011 05:57

Thank you Elvis, I ll see these presentations

charbel July 20, 2011 11:21

fluid structure interaction problem
 
I have small deformation values relative to weak coupling.
It seems that the problem comes from the first predicted interface displacement (see Kuttler and Wall 2008 page 64 section 3.1 before equation (22)).
Can you please give me a hint on how can I make it. Actually I am doing as follows (first 4 lines) but it is not working:
Code:

//******************************** Initialize for new time step ******************************//
# include "solveFluid.H"
# include "setPressure.H"
# include "solveSolid.H"
# include "setMotionOldTime.H"
//here solidPointsDispl = cpi.interpolate(Usolid - Usolid.oldTime())
//*******************************************************************************************//
int myLoopCount = 0;
do
{
  if (myLoopCount == 0)
  {
//********************* Computing Aitken's relaxation parameter for k = 0 ******************//
    minGammaAitken = min(GammaAitken.boundaryField()[solidPatchID]);
    minGammaAitken = std::sqrt(sqr(minGammaAitken));
    maxGammaAitken = max(GammaAitken.boundaryField()[solidPatchID]);
    maxGammaAitken = std::sqrt(sqr(maxGammaAitken));
    if (minGammaAitken > 1)
      {
        minGammaAitken = 0;
      }
    if (maxGammaAitken > 1)
      {
        maxGammaAitken = 0.9;
      }
    avgGammaAitken = (minGammaAitken + maxGammaAitken)/2;
    GammaAitken = min(avgGammaAitken, initialRelaxation) + 0*GammaAitken;
    avgGammaAitken = average(GammaAitken.boundaryField()[solidPatchID]);
    Info<< "*** myLoopCount = " << myLoopCount << " \n" << endl;
    Info<< "*** Aitken relaxation parameter (k=0) = "
        << avgGammaAitken << " \n" << endl;
//*******************************************************************************************//
//******************************* Solving Fluid -> Solving Solid ****************************//
//#    include "setMotion.H"
#    include "solveFluid.H"
#    include "setPressure.H"
    UsolidPrevious = 1*Usolid;
#    include "solveSolid.H"
//*******************************************************************************************//
//*************************** Computing Aitken's residuales for k = 0 ***********************//
    rr2.boundaryField()[solidPatchID] = Usolid.boundaryField()[solidPatchID] - UsolidPrevious.boundaryField()[solidPatchID];
    rr2Size = rr2.boundaryField()[solidPatchID].size();
    outerError = std::sqrt(max(magSqr(rr2.boundaryField()[solidPatchID])/rr2Size));
    Info<< "*** Aitken loop error (k=0) = " << outerError << " \n" << endl;
    outerError = 1;
//*******************************************************************************************//
//********************************** Relaxe Aitken for k = 0 ********************************//
    Usolid.boundaryField()[solidPatchID] = UsolidPrevious.boundaryField()[solidPatchID]
                                            + GammaAitken.boundaryField()[solidPatchID]*rr2.boundaryField()[solidPatchID];
//*******************************************************************************************//
  }
  else
  {
  if (myLoopCount > 1)
    {
//********************* Computing Aitken's relaxation parameter for k > 0 ******************//
    GammaAitken.boundaryField()[solidPatchID] =
              (-1*GammaAitken.boundaryField()[solidPatchID]*
                (
                (rr2.boundaryField()[solidPatchID] - rr1.boundaryField()[solidPatchID])
                &rr1.boundaryField()[solidPatchID]
                )
              )
              /magSqr(rr2.boundaryField()[solidPatchID] - rr1.boundaryField()[solidPatchID]);
    minGammaAitken = min(GammaAitken.boundaryField()[solidPatchID]);
    minGammaAitken = std::sqrt(sqr(minGammaAitken));
    maxGammaAitken = max(GammaAitken.boundaryField()[solidPatchID]);
    maxGammaAitken = std::sqrt(sqr(maxGammaAitken));
    if (minGammaAitken > 1)
      {
        minGammaAitken = 0;
      }
    if (maxGammaAitken > 1)
      {
        maxGammaAitken = 0.9;
      }
    avgGammaAitken = (minGammaAitken + maxGammaAitken)/2;
    GammaAitken = avgGammaAitken + 0*GammaAitken;
    Info<< "*** myLoopCount = " << myLoopCount << " \n" << endl;
    Info<< "*** Aitken relaxation parameter = "
        << avgGammaAitken << " \n" << endl;
//*******************************************************************************************//
//********************************** Relaxe Aitken for k > 0 ********************************//
    Usolid.boundaryField()[solidPatchID] = UsolidPrevious.boundaryField()[solidPatchID]
                                            + GammaAitken.boundaryField()[solidPatchID]*rr2.boundaryField()[solidPatchID];
//*******************************************************************************************//
    }
//********************** Solving Mesh -> Solving Fluid -> Solving Solid *********************//
#    include "setMotion.H"
//here solidPointsDispl = cpi.interpolate(Usolid - UsolidPrevious)
#    include "solveFluid.H"
#    include "setPressure.H"
    UsolidPrevious = 1*Usolid;
#    include "solveSolid.H"
//*******************************************************************************************//
//*************************** Computing Aitken's residuales for k > 0 ***********************//
    rr1.boundaryField()[solidPatchID] = rr2.boundaryField()[solidPatchID];
    rr2.boundaryField()[solidPatchID] = Usolid.boundaryField()[solidPatchID] - UsolidPrevious.boundaryField()[solidPatchID];
    rr2Size = rr2.boundaryField()[solidPatchID].size();
    outerError = std::sqrt(max(magSqr(rr2.boundaryField()[solidPatchID])/rr2Size));
    Info<< "*** Aitken loop error = " << outerError << "  \n" << endl;
    if (myLoopCount == 1)
      {
        outerError = 1;
      }
//*******************************************************************************************//
  }
  ++myLoopCount;
} while ((outerError > outerLoopConvergence) && (myLoopCount < nLoops));

Best regards.

charbel July 22, 2011 08:50

traction displacement
 
Hello,
I want to compute the traction field so it can be transferred, with the pressure, from fluid mesh to solid in the setPressure.H.
So I make as follows:

Code:

In createFields.H

    volSymmTensorField sigmaFluid
    (
        IOobject
        (
            "sigmaFluid",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        2*nu*dev(symm(fvc::grad(U)))
    );

In setPressure.H

    sigmaFluid = 2*nu*dev(symm(fvc::grad(U)));
   
    vectorField faceNormal = (stressMesh.Sf().boundaryField()[solidPatchID])
                            /(stressMesh.magSf().boundaryField()[solidPatchID]);

    symmTensorField solidPatchTraction =
        interpolatorFluidSolid.faceInterpolate
        (
          (sigmaFluid.boundaryField()[fluidPatchID])
        );

    solidPatchTraction *= rhoFluid.value();

    tForce.traction() = solidPatchTraction & faceNormal;

However, it seems that the traction is not taken into account in the tractionDisplacementFvPatchVectorField.C
What most I modify in tractionDisplacementFvPatchVectorField.C .H so traction can be transferred to solid patch?


Regards.

gascortado July 22, 2011 23:31

Hi, I'm trying to test your solver. I untar the files and I placed the files in a folder. However, when I run Allrun in that folder, the command is not recognized. Do I have to place the files in a specifically maned folder? How do I run the case? Please let me know. THanks

charbel July 24, 2011 11:29

Hi Santiago,
Did you first compile the solver without problems?
Once you compile it you go in the testCase directory and then ./Allrun

gascortado July 24, 2011 20:33

I execute "wmake libso" in "testVorflexFoam" and I get the following error:

testVorflexFoam.C:41: fatal error: tetFemMatrices.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/testVorflexFoam.o] Error 1

This also happened to me while trying to compile "icoFsiFoam". I tried with both OF-1.5-dev and OF-1.6-ext with the same results. Any idea of what I need to do now?

charbel July 25, 2011 04:13

To compile solvers or utilities you moste execute wmake. The same for icoFsiFoam. In fact, you use wmake libso when you want to compile a library.

Regards.


All times are GMT -4. The time now is 12:29.