CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM CC Toolkits for Fluid-Structure Interaction (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/)
-   -   [solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/126706-support-thread-solid-mechanics-solvers-added-openfoam-extend.html)

Daniel_Khazaei October 3, 2013 16:49

Quote:

Originally Posted by bigphil (Post 454911)
Hi Daniel,


If you search for "Aitken acceleration" on google, you will finds lots of explanations, but essentially the acceleration factor does not have to be limited to be less than 1 or even positive.
As regards application of the Aitken's method to under-relaxation in FSI procedure, sometimes people may limit it but I am not sure of the reasoning (maybe they feel uncomfortable with relaxation factor >1 and/or <0)


You should be able to find descriptions of movingWallVelocity on the forum or at least in the code.
As far as I know, it is a boundary condition for the fluid velocity field for a wall that is moving.
This should not be used as a solid boundary condition.


I don't think you have set the correct boundary condition types for FSI in U and DU.
As regards what boundary condition to use for the patch shown, this depends on what physical condition you want to enforce. Typically you don't use zeroGradient as a solid boundary as it does not really correspond to a physical condition (it's kind of like zero strain).

Philip


thanks Dr. Cardiff

As for the last comment, yes you are right. Now I am clamping those patches with fixed displacement in every direction.

I will work on FSI patch boundary condition. Actually the solver does not allow any other boundary conditions exept fixedDisplacement types and solidTreaction.

-----------------

edit: I have talked to the author of that paper, they have used prescribed pressure and traction for FSI interface and No load for outer wall.

How can I apply No load boundary condition in OpenFOAM?


regrads

VincentChai October 4, 2013 05:41

Hi Philip,

Thanks for your answer. At this moment, i cannot able to plot the tip deflection from the solver. May I have the code for generate the file as "historySolid.dat"? Very sorry for keep troubling you and thanks a lot for your help.

:)

Regards,
Vincent

VincentChai October 9, 2013 02:38

Hi Philip,

sorry for troubling you with questions again. :(
I tried to plot with smaller time step, but it still gave the same error message as:

ERROR: In /home/vin-82/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/ParaView-3.12.0/VTK/Filtering/vtkTable.cxx, line 353
vtkTable (0x9676cb0): Column "Probe Coordinates (Magnitude)" must have 1 rows, but has 2.

Please help me on plotting the tip deflection :)
Thanks.

Regards,
Vincent

AsDF October 29, 2013 08:01

Hello,

while trying to run the icoFsiElasticNonLinULSolidFoam solver in parallel as described in the info file of the tutorial I experience the exact same error as the error Daniel mentioned earlier.
After that I recompiled the solver with the moveSolidMeshLeastSquares.H file from Philip but the simulation keeps stopping at 0.065s.
As I'm new to OpenFoam I don't know how to fix this problem and would really appreciate some help.


Code:

Time = 0.065, iteration: 2
Current fsi under-relaxation factor: 0.01
Maximal accumulated displacement of interface points: 0.0084761
Courant Number mean: 0.0443861 max: 0.522711 velocity magnitude: 1.31938
DILUPBiCG:  Solving for Ux, Initial residual = 4.75368e-05, Final residual = 3.94291e-07, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.000110373, Final residual = 8.77263e-07, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.000543828, Final residual = 8.25319e-07, No Iterations 30
GAMG:  Solving for p, Initial residual = 0.000102911, Final residual = 9.47413e-07, No Iterations 10
time step continuity errors : sum local = 3.23041e-10, global = -4.55244e-11, cumulative = 5.6536e-10
GAMG:  Solving for p, Initial residual = 0.000131358, Final residual = 7.9384e-07, No Iterations 24
GAMG:  Solving for p, Initial residual = 1.99396e-05, Final residual = 7.79756e-07, No Iterations 6
time step continuity errors : sum local = 2.65822e-10, global = 2.4541e-11, cumulative = 5.89901e-10
Setting traction on solid patch
Total traction force = (0.00431445 -7.4879e-06 3.43629e-22)
Solving for DU, Initial residual = 0.00589588, Final residual = 9.88846e-07, No outer iterations 41
Current fsi residual norm: 0.981515

Time = 0.065, iteration: 3
Current fsi under-relaxation factor (Aitken): 0.362946
Maximal accumulated displacement of interface points: 0.00876687
[0]
[0]
[0] --> FOAM FATAL ERROR:
[0] face 41 area does not match neighbour by 0.0103705% -- possible face ordering problem.
patch: procBoundary0to1 my area:0.000239443 neighbour area: 0.000239418 matching tolerance: 0.0001
Mesh face: 42167 vertices: 4((0.574801 0.214706 0.025334) (0.574854 0.20998 0.025334) (0.574854 0.20998 -0.025334) (0.574801 0.214706 -0.025334))
Rerun with processor debug flag set for more information.
[0]
[0]    From function processorPolyPatch::calcGeometry()
[0]    in file [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] face 41 area does not match neighbour by 0.0103705% -- possible face ordering problem.
patch: procBoundary1to0 my area:0.000239418 neighbour area: 0.000239443 matching tolerance: 0.0001
Mesh face: 42054 vertices: 4((0.574801 0.214706 0.025334) (0.574801 0.214706 -0.025334) (0.574854 0.209981 -0.025334) (0.574854 0.209981 0.025334))
Rerun with processor debug flag set for more information.
[1]
[1]    From function processorPolyPatch::calcGeometry()
[1]    in file meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C at line 216.
[1]
FOAM parallel run exiting
[1]
meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C at line 216.
[0]
FOAM parallel run exiting
[0]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------

Best regards

Michael

davidsblom December 11, 2013 07:49

Hi Philip,

I'm currently validating the FSI solver, and as a first step I am trying to run the CSM3 test from the cylinder flap benchmark. So only a structure solver is used. I was wondering which settings to use, because with my current setup, the displacement of the flap is much larger than expected. I have used the elasticGravitySolidFoam solver.

What is the best approach for this problem? And I was wondering which divSigmaExpMethod to use. I'm currently using the standard approach, but I'm not aware of the differences between the different settings settings/surface/decompose/laplacian.

Best regards,
David

bigphil December 11, 2013 07:53

Quote:

Originally Posted by davidsblom (Post 465908)
Hi Philip,

I'm currently validating the FSI solver, and as a first step I am trying to run the CSM3 test from the cylinder flap benchmark. So only a structure solver is used. I was wondering which settings to use, because with my current setup, the displacement of the flap is much larger than expected. I have used the elasticGravitySolidFoam solver.

What is the best approach for this problem? And I was wondering which divSigmaExpMethod to use. I'm currently using the standard approach, but I'm not aware of the differences between the different settings settings/surface/decompose/laplacian.

Best regards,
David

Hi David,

All divSigmaExp methods should produce very similar results; in theory "decompose" is the most accurate and I have found that "surface" is a bit more robust on bad meshes.

As regards gravity, the elasticGravitySolidFoam is a small strain solver so it's not appropriate for such large rotations as in the benchmark.
Essentially you should take elasticNonLinULSolidFoam and add the body force increment in the first time step (i.e. small modification to the solver).

Best regards,
Philip

EDIT:

Add something like this after DUEqn is created and before DUEqn.solve() is called:
Code:

          if (runTime.timeIndex() == 1)
            {
                // Add gravity increment on first time step
                DUEqn -=
                    rho*dimensionedVector("gravity", dimLength/(dimTime/dimTime), vector(0,-9.81,0));
            }


davidsblom December 11, 2013 08:29

Quote:

Originally Posted by bigphil (Post 465910)
Hi David,

All divSigmaExp methods should produce very similar results; in theory "decompose" is the most accurate and I have found that "surface" is a bit more robust on bad meshes.

As regards gravity, the elasticGravitySolidFoam is a small strain solver so it's not appropriate for such large rotations as in the benchmark.
Essentially you should take elasticNonLinULSolidFoam and add the body force increment in the first time step (i.e. small modification to the solver).

Best regards,
Philip

EDIT:

Add something like this after DUEqn is created and before DUEqn.solve() is called:
Code:

          if (runTime.timeIndex() == 1)
            {
                // Add gravity increment on first time step
                DUEqn -=
                    rho*dimensionedVector("gravity", dimLength/(dimTime/dimTime), vector(0,-9.81,0));
            }


Hi Philip,

Thanks for your quick response. This fix seems to have solved the problem. At first I also tried to add the gravity force at each time step before trying the elasticGravitySolidFoam solver. What is the reason that the gravity forces is only applied during the first time step? It seems counterintuitive.
Thanks alot.

Another question. Currently, a slightly different solid solver is used in the icoFsiElasticNonLinULSolidFoam fluid-structure interaction solver. Are there a lot of differences between the two solid solvers? I'm considering of replacing the structure solver of icoFsiElasticNonLinULSolidFoam with the elasticNonLinULSolidFoam solver.
Thanks alot!

Best regards,
David

bigphil December 11, 2013 08:36

Quote:

Originally Posted by davidsblom (Post 465919)
Thanks for your quick response. This fix seems to have solved the problem. At first I also tried to add the gravity force at each time step before trying the elasticGravitySolidFoam solver. What is the reason that the gravity forces is only applied during the first time step? It seems counterintuitive.
Thanks alot.

The momentum equation in the elasticNonLinULSolidFoam/FSI solvers are cast in their incremental form i.e. the increment of momentum is conserved for each time-step, the primary variable is then the increment of displacement DU.
Therefore the gravity body force need only be added in the first increment and then you are only solving for changes in momentum/forces (gravity force stays constant).
Hope this makes sense.

Quote:

Originally Posted by davidsblom (Post 465919)
Another question. Currently, a slightly different solid solver is used in the icoFsiElasticNonLinULSolidFoam fluid-structure interaction solver. Are there a lot of differences between the two solid solvers? I'm considering of replacing the structure solver of icoFsiElasticNonLinULSolidFoam with the elasticNonLinULSolidFoam solver.
Thanks alot!

The FSI solid solver uses the same approach so they are essentially the same, maybe just a few minor differences.

Philip

davidsblom December 11, 2013 09:22

1 Attachment(s)
Quote:

Originally Posted by bigphil (Post 465920)
The momentum equation in the elasticNonLinULSolidFoam/FSI solvers are cast in their incremental form i.e. the increment of momentum is conserved for each time-step, the primary variable is then the increment of displacement DU.
Therefore the gravity body force need only be added in the first increment and then you are only solving for changes in momentum/forces (gravity force stays constant).
Hope this makes sense.


The FSI solid solver uses the same approach so they are essentially the same, maybe just a few minor differences.

Philip

Hi Philip,

I've calculated the first 4 seconds of the CSM3 cylinder flap benchmark, and it seems that the displacement of the flap is growing over time. I've attached a plot of the displacement over time. Any idea what is causing the "growing/diverging"?
I have similar problems with the fluid structure interaction case where the displacement grows over time. Possibly because the mesh is deformed at every time step?
I've tried to use the elasticNonLinTLSolidFoam solver, but this solver crashes directly at the first time step.
Thanks alot for your help.

Attachment 27293

bigphil December 11, 2013 09:30

Quote:

Originally Posted by davidsblom (Post 465931)
Hi Philip,

I've calculated the first 4 seconds of the CSM3 cylinder flap benchmark, and it seems that the displacement of the flap is growing over time. I've attached a plot of the displacement over time. Any idea what is causing the "growing/diverging"?
I have similar problems with the fluid structure interaction case where the displacement grows over time. Possibly because the mesh is deformed at every time step?
I've tried to use the elasticNonLinTLSolidFoam solver, but this solver crashes directly at the first time step.
Thanks alot for your help.

It looks like the amplitude of the displacement oscillation is getting smaller (not growing), is that what you meant?

It would make sense if the oscillation was getting smaller: this would be due to the use of Euler time discretisation which is first order accurate in time.
Two possible remedies:
  • smaller time steps
  • more accurate time discretisation, such as backward d2dt2 scheme.

Philip

davidsblom December 12, 2013 08:27

Quote:

Originally Posted by bigphil (Post 465932)
It looks like the amplitude of the displacement oscillation is getting smaller (not growing), is that what you meant?

It would make sense if the oscillation was getting smaller: this would be due to the use of Euler time discretisation which is first order accurate in time.
Two possible remedies:
  • smaller time steps
  • more accurate time discretisation, such as backward d2dt2 scheme.

Philip

Thanks. I was thinking that it was caused by the time integration scheme. Unfortunately, backward differencing d2dt scheme is not implemented in OpenFOAM.

I'm currently looking into the structure solver used by the fluid-structure interaction solver, and I've created a seperate solver with just the structure code. Can I add the same code snippet to this solver in order to simulate the same CSM3 problem?
Thanks in advance.

bigphil December 12, 2013 09:46

Hi David,

The backward d2dt2 scheme is implemented in the forthcoming next release of OpenFOAM Extend (the nextRelease git branch can be downloaded).
The code is found at:
OpenFOAM-1.6-ext/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme

Alternatively a smaller time-step should help.

Quote:

I'm currently looking into the structure solver used by the fluid-structure interaction solver, and I've created a seperate solver with just the structure code. Can I add the same code snippet to this solver in order to simulate the same CSM3 problem?
Yes that should work, assuming you create all the relevant fields.

Philip

ben1793 December 14, 2013 06:09

I have solved my previous problem but have a new one. I used the github for the official OpenFOAM 2.2x (I am using OpenFOAM-2.2.2). I tried to run the plate hole tutorial by using the blockMesh command then the elastricSolidFoam command, I then get the following error:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.2                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.2-9240f8b967db
Exec  : elasticSolidFoam
Date  : Dec 15 2013
Time  : 12:37:57
Host  : "sk-VirtualBox"
PID    : 4790
Case  : /home/sk/OpenFOAM/sk-2.2.2/run/solidMechanics/tutorials/elasticSolidFoam/plateHole
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field U

Patch hole    Traction boundary field: U


--> FOAM FATAL IO ERROR:
Unknown grad scheme extendedLeastSquares

Valid grad schemes are :

9
(
Gauss
cellLimited
cellMDLimited
edgeCellsLeastSquares
faceLimited
faceMDLimited
fourth
leastSquares
pointCellsLeastSquares
)


file: /home/sk/OpenFOAM/sk-2.2.2/run/solidMechanics/tutorials/elasticSolidFoam/plateHole/system/fvSchemes.gradSchemes.grad(U) at line 26.

    From function gradScheme<Type>::New(const fvMesh& mesh, Istream& schemeData)
    in file /opt/openfoam222/src/finiteVolume/lnInclude/gradScheme.C at line 72.

FOAM exiting

It cant seem to find the extendedLeastSquares grad scheme, is this something that needs to be changed or have I installed this feature incorrectly?

Thank you.

Daniel_Khazaei December 21, 2013 17:12

Hello Dr. Cardiff

I have a question about running a turbulence case with FSI solver. I have successfully changed the fluid solver according to pisoFoam solver. Now the FSI solver is able to model a turbulence flow.

However I have a little problem in running the tutorial case in turbulence regime. At the first time step the pressure equation leads to very wrong values for pressure distribution in the fluid domain. Also I have tested the fluid part of your case separately with pisoFoam solver and I can see the same problem there. So I think that the turbulence FSI solver is working fine (at-least working like pisoFoam solver).

This problem leads to the divergence of solid solver in FSI solver.

I have done a few tests with pisoFoam solver and it seems that the pressure distribution becomes reasonable after a few time steps ( 4 or more ). Also the steady state solution of the case is in well agreement with fluent.

So I am guessing that the solver just needs a few time step to get rid of that wrong prediction. This is not going to produce any problem in fluid domain simulation, but FSI simulation will definitely diverges because of this. So I have changed the strongly coupled algorithm as follow:

Code:

        do
        {
            outerCorr++;

#          include "setInterfaceDisplacement.H"

#          include "moveFluidMesh.H"

#          include "solveFluid.H"

            if (runTime.timeIndex() >= 4)
            {
                #include "setInterfaceForce.H"
            }

#          include "solveSolid.H"

#          include "calcFsiResidual.H"
        }

This will skip setting the pressure on solid side for a few time steps (4). By adding the above modification I am now able to run the tutorial case in turbulence regime.

Is there any side effects (skipping a few time steps) that I need to know?


regards

codder January 15, 2014 20:48

@ Daniel_Khazaei

Quote:

Originally Posted by Daniel_Khazaei (Post 467301)
Hello Dr. Cardiff

I have a question about running a turbulence case with FSI solver. I have successfully changed the fluid solver according to pisoFoam solver. Now the FSI solver is able to model a turbulence flow.

Could you expand on this a bit, if possible? For instance, does that mean you were able to apply a fixedDisplacement boundary condition using a weak coupling on the FSI solver.

I'm looking into the feasibility (???) of using a dynamic mesh with this new class of solid domain solvers. Please excuse my ignorance I have attempted to put this question in the correct terms.

davidsblom January 28, 2014 05:59

Quote:

Originally Posted by bigphil (Post 466134)
Hi David,

The backward d2dt2 scheme is implemented in the forthcoming next release of OpenFOAM Extend (the nextRelease git branch can be downloaded).
The code is found at:
OpenFOAM-1.6-ext/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme

Alternatively a smaller time-step should help.


Yes that should work, assuming you create all the relevant fields.

Philip

Hi Philip,

I'm currently testing foam extend 3.0. When running the CSM test of the cylinder flap benchmark with the elasticNonLinULSolidFoam solver, the correct solution is found. However, both the first order and second order time integration scheme give the same results. The order of the backward differencing scheme seems to be one.
Any idea what is causing this?

Also, I've tested the structure solver which is used by the fluid-structure interaction solver and looked at the two time integration schemes. The first order scheme gives the same results as the elasticNonLinULSolidFoam solver. But the second order backward differencing scheme does not give the correct result. Zero-th order behaviour is shown for the total displacement U, whereas the first order scheme shows the correct order.
Any ideas?

Many thanks.

Best,
David

bigphil January 28, 2014 06:15

Quote:

Originally Posted by davidsblom (Post 472115)
Hi Philip,

I'm currently testing foam extend 3.0. When running the CSM test of the cylinder flap benchmark with the elasticNonLinULSolidFoam solver, the correct solution is found. However, both the first order and second order time integration scheme give the same results. The order of the backward differencing scheme seems to be one.
Any idea what is causing this?

Also, I've tested the structure solver which is used by the fluid-structure interaction solver and looked at the two time integration schemes. The first order scheme gives the same results as the elasticNonLinULSolidFoam solver. But the second order backward differencing scheme does not give the correct result. Zero-th order behaviour is shown for the total displacement U, whereas the first order scheme shows the correct order.
Any ideas?

Many thanks.

Best,
David

Hi David,

Hmnn, I haven't played with the backwardD2Dt2 scheme much but it should work: it was developed and implemented by Željko Tukovic as outlined in
this paper. See Fig 5 and Fig 6 comparing Euler and backward schemes; the backward scheme certainly reduces the dissipation, although I don't thing that second order accuracy was actually shown. Did you examine the 2nd Order slope of the error plot?
Did you notice that the backward scheme is more accurate (irregardless of order)?

As regards the structural solver within icoFsiElasticNonLinULSolidFoam, it should be the same but it is fine to comment out all the time scheme stuff and just use the built-in backward/Euler schemes like elasticNonLinULSolidFoam.

Best regards,
Philip

davidsblom January 28, 2014 08:03

Quote:

Originally Posted by bigphil (Post 472122)
Hi David,

Hmnn, I haven't played with the backwardD2Dt2 scheme much but it should work: it was developed and implemented by Željko Tukovic as outlined in
this paper. See Fig 5 and Fig 6 comparing Euler and backward schemes; the backward scheme certainly reduces the dissipation, although I don't thing that second order accuracy was actually shown. Did you examine the 2nd Order slope of the error plot?
Did you notice that the backward scheme is more accurate (irregardless of order)?

As regards the structural solver within icoFsiElasticNonLinULSolidFoam, it should be the same but it is fine to comment out all the time scheme stuff and just use the built-in backward/Euler schemes like elasticNonLinULSolidFoam.

Best regards,
Philip

Hi,

Thanks for your quick response. Since the first order and second order scheme are giving me the exact same response, I looked at the source.

This is the code in backwardD2dt2Scheme.C:

template<class Type>
tmp<fvMatrix<Type> >
backwardD2dt2Scheme<Type>::fvmD2dt2
(
const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
rho.dimensions()*vf.dimensions()*dimVol
/dimTime/dimTime
)
);

fvMatrix<Type>& fvm = tfvm();

scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();

scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);

scalar rDeltaT2 = 4.0/sqr(deltaT + deltaT0);

if (mesh().moving())
{
notImplemented
(
type()
+ "::fvcD2dt2"
+ "("
+ "const dimensionedScalar& rho, "
+ "GeometricField<Type, fvPatchField, volMesh>& vf"
+ ")"
);
}
else
{
fvm.diag() = (coefft*rDeltaT2)*mesh().V()*rho.value();

fvm.source() = rDeltaT2*mesh().V()*rho.value()*
(
(coefft + coefft00)*vf.oldTime().internalField()
- coefft00*vf.oldTime().oldTime().internalField()
);
}

return tfvm;
}

This is the code in EulerD2dt2Scheme.C:

template<class Type>
tmp<fvMatrix<Type> >
EulerD2dt2Scheme<Type>::fvmD2dt2
(
const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
rho.dimensions()*vf.dimensions()*dimVol
/dimTime/dimTime
)
);

fvMatrix<Type>& fvm = tfvm();

scalar deltaT = mesh().time().deltaT().value();
scalar deltaT0 = mesh().time().deltaT0().value();

scalar coefft = (deltaT + deltaT0)/(2*deltaT);
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);

scalar rDeltaT2 = 4.0/sqr(deltaT + deltaT0);

if (mesh().moving())
{
scalar halfRdeltaT2 = 0.5*rDeltaT2;

scalarField VV0 = mesh().V() + mesh().V0();

scalarField V0V00 = mesh().V0() + mesh().V00();

fvm.diag() = rho.value()*(coefft*halfRdeltaT2)*VV0;

fvm.source() = halfRdeltaT2*rho.value()*
(
(coefft*VV0 + coefft00*V0V00)
*vf.oldTime().internalField()

- (coefft00*V0V00)*vf.oldTime().oldTime().internalFi eld()
);
}
else
{
fvm.diag() = (coefft*rDeltaT2)*mesh().V()*rho.value();

fvm.source() = rDeltaT2*mesh().V()*rho.value()*
(
(coefft + coefft00)*vf.oldTime().internalField()
- coefft00*vf.oldTime().oldTime().internalField()
);
}

return tfvm;
}

Seems to be the same... Not sure how this is possible for a higher order scheme.
Any clues? To my knowledge, mesh().moving() returns false, since the dynamic mesh class is not used.

bigphil January 28, 2014 08:47

Ah, I see now, there are three implicit functions defined in backwardbackwardD2dt2Scheme but only the first implemented backward scheme:
Code:

        tmp<fvMatrix<Type> > fvmD2dt2 // This is correct
        (
            GeometricField<Type, fvPatchField, volMesh>&
        );

        tmp<fvMatrix<Type> > fvmD2dt2 // this is just Euler
        (
            const dimensionedScalar&,
            GeometricField<Type, fvPatchField, volMesh>&
        );

        tmp<fvMatrix<Type> > fvmD2dt2 // this is just Euler
        (
            const volScalarField&,
            GeometricField<Type, fvPatchField, volMesh>&
        );

The code should give a not implemented error if either of the bottom two functions are called but the notImplemented functions were not added: I will let them know.

So, for now, you can try out the backward d2tdt2 scheme by changing:
Code:

                  fvm::d2dt2(rho,DU)
to
Code:

                  rho*fvm::d2dt2(DU)
in the solver code: this essentially assumes constant density for the calculation of inertia which is probably fine in most case.
It is probably straight-forward to implement the second two functions if you get an urge ;)

Best regards,
Philip

danny261083 January 28, 2014 16:45

Regarding elasticNonLinTLSolidFoam (cantilever problem)
 
1 Attachment(s)
Hi Dr. Cardiff,

I was attempting to run the tutorial problem involving large deflections of a cantilever beam using the total lagrangian solver 'elasticNonLinTLSolidFoam' (in OpenFoam version 2.2.x). I received an error message stating that the extended least squares method was not a recognized solution method. I attempted to run the simulation using least squares, which resulted in small displacements, as can be seen in the enclosed image. I would like to know whether I might be implementing the test case incorrectly.

Thanks

bigphil January 29, 2014 07:17

Quote:

Originally Posted by danny261083 (Post 472222)
Hi Dr. Cardiff,

I was attempting to run the tutorial problem involving large deflections of a cantilever beam using the total lagrangian solver 'elasticNonLinTLSolidFoam' (in OpenFoam version 2.2.x). I received an error message stating that the extended least squares method was not a recognized solution method. I attempted to run the simulation using least squares, which resulted in small displacements, as can be seen in the enclosed image. I would like to know whether I might be implementing the test case incorrectly.

Thanks

Hi Danny,

OK, the "leastSquares" gradScheme is equivalent to "extendedLeastSquares 0" on orthogonal meshes, so that's fine. Actually, as a side point, I have yet to try out the new point/face least squares in official OpenFOAM, it would be interesting to see how good they are on unstructured meshes.

Also, you say small displacements but your mag(U) is almost 1 metre so that seems quite big to me; if you are referring to the mesh motion being small, then this is because the Total Lagrangian solver uses a non-moving mesh (it integrates over the reference configuration ie mesh); to see the actual deformation use the "Warp By Vector" filter in ParaView and uses the total displacement field "U" and a scale factor of 1.

Another point: your mesh has only one cell across its thickness (top to bottom): you will need at least 2 cells. This is because the computational nodes lie at the cell centres so you need at least 2 to approximate shear strains and the variation of tensile/compressive stress.

Best regards,
Philip

davidsblom January 29, 2014 07:47

Quote:

Originally Posted by bigphil (Post 472145)
Ah, I see now, there are three implicit functions defined in backwardbackwardD2dt2Scheme but only the first implemented backward scheme:
Code:

        tmp<fvMatrix<Type> > fvmD2dt2 // This is correct
        (
            GeometricField<Type, fvPatchField, volMesh>&
    );

    tmp<fvMatrix<Type> > fvmD2dt2 // this is just Euler
        (
            const dimensionedScalar&,
            GeometricField<Type, fvPatchField, volMesh>&
    );

    tmp<fvMatrix<Type> > fvmD2dt2 // this is just Euler
        (
            const volScalarField&,
            GeometricField<Type, fvPatchField, volMesh>&
        );

The code should give a not implemented error if either of the bottom two functions are called but the notImplemented functions were not added: I will let them know.

So, for now, you can try out the backward d2tdt2 scheme by changing:
Code:

                  fvm::d2dt2(rho,DU)
to
Code:

                  rho*fvm::d2dt2(DU)
in the solver code: this essentially assumes constant density for the calculation of inertia which is probably fine in most case.
It is probably straight-forward to implement the second two functions if you get an urge ;)

Best regards,
Philip

Hi Philip,

Thanks for all your help. I was wondering if it is possible to split up the time integration of DU into two steps. So first to solve for the velocity DV, and thereafter for the displacement DU.

I have tried the following:

Code:

fvVectorMatrix DVEqn
(
    fvm::ddt ( rho, DV )
    ==
    fvm::laplacian ( 2 * mu + lambda, DU, "laplacian(DDU,DU)" )
    - fvc::laplacian ( mu + lambda, DU, "laplacian(DDU,DU)" )
    + fvc::div
    (
    mu * gradDU.T ( )
    + lambda * ( I * tr ( gradDU ) )
    + mu * ( gradDU & gradDU.T ( ) )
    + 0.5 * lambda * ( I * tr ( gradDU & gradDU.T ( ) ) )
    + ( sigma & DF.T ( ) )
    + ( DSigma & DF.T ( ) ),
    "div(sigma)"
    )
);

solverPerf = DVEqn.solve ( );

fvVectorMatrix DUEqn ( fvm::ddt ( DU ) == DV );

DUEqn.solve();

But a fatal error is thrown when evaluating DVEqn. Am I doing something wrong or is this not possible with the current code setup.
The following error is thrown:

Code:

--> FOAM FATAL ERROR:

    request for volTensorField grad(DV) from objectRegistry region0 failed
    available objects of type volTensorField are

3
(
((1)+grad(DU).T())
grad(DU)
(((1)+grad(DU).T())-(1))
)

Thanks alot.

Best regards,
David Blom

bigphil January 29, 2014 09:42

Hi David,

I don't think it is possible to do it that way because there must be just one primary variable in the equation, either DV or DU but not both because the linear matrix will be A*DU = B OR A*DV = B; you can't mix and match.
It is probably possible to use implicit Euler and then iteratively correct the equation with explicit source term which is the explicit difference between Euler and backward (and it could be calculated using a mix of velocities or whatever).

However, my previous suggestion of rho*d2dt2(DU) should work fine and quite accurately, as long as you don't have large changes in rho: this is actually a good assumption here because the implemented constitutive law is St Venant Kirchhoff model (nonlinear version of Hooke's law) which doesn't actually match most materials for large elastic/elastoplastic strains.

If you really do want it, the derivation/implementation of d2dt2(rho, DU) is actually quite straight-forward.

Best regards,
Philip

codder January 29, 2014 12:56

using crackerFvMesh and another dynamic mesh
 
@ Phillip Cardiff -

First off thanks for your efforts packaging the elasticAcpSolidFoam and other solid mechanics solvers into foam-extend.

I experienced problems adapting that solver, for FSI, which I'm wondering if result from a basic conceptional mistake on my part, resulting from having read (oddly enough) the block coupled report.

Previously I wrote:
Quote:

Two questions:

(1) Does the use of the crackerFvMesh library for the solid, then preclude use of a second dynamic meshing library for an additional fluid domain?

(2) If so, are their steps I can take to segregate the crackerFvMesh from the fluid's dynamicFvMesh?

Not sure if I'm totally making sense; especially, as I initially thought that using icoFsiFoam's tet decomposition would protect me from this issue.
Edit #1
I have checked with a friend. There does not always seem to be a problem with two conflicting dynamic meshes.

Edit #2
Still puzzled by meshing differences between solid and fluid. However, suffice to say:

(1) If you are creating a FSI solver along the lines of icoFsiFoam
(2) Make sure to change the word in "createStressMesh.H" from "default" to "solid".

... problem solved.

codder February 4, 2014 20:46

broad elaticAcpQuestions
 
@ Dr. Cardiff

Three broad questions about the craking solver contributions from UCD, in my mind.

1. If you yourself were to attempt an FSI solver using the elaticAcp suite of solvers, how would you go about this?
(In broad-brush general terms, e.g.: "I would definitely use UCD's own FSI solvers, because ...")

2. Is there any fundamental, conceptual problem with using the icoFsiFoam methods for the above purpose?
(Looked at the solid models in foam-extend-3.0/src, but I couldn't resolve this in my mind...)

3. On defining patches:

a. What is the function of the 0/materials boundaryField, in crackingBiMatDcbLinear tut?

... I think they don't do anything, because just defines material heterogeneity on a per-cell basis.

b. How to visualize, for example with paraFoam, the 0/U crack patch?

... I am confused about the nature of the computed values for crack - e.g., as to what "1" or "2" means.


Thanks much for helping me understand, Eric

bigphil February 5, 2014 05:10

Hi Eric,

Quote:

Originally Posted by codder (Post 473463)
1. If you yourself were to attempt an FSI solver using the elaticAcp suite of solvers, how would you go about this?
(In broad-brush general terms, e.g.: "I would definitely use UCD's own FSI solvers, because …")

Finite volume crack-FSI solvers have been used successfully in previous analyses (e.g. see here) and they have used similar methods to elasticAcp, so I suppose they should be suitable.
As I see, the main difficulties will be how the fluid is represented inside the cracks; there are (at least) two options:
  • Do not solve fluid equations inside cracks, just represent the fluid pressure as a boundary condition on the crack faces;
  • Add fluid cells between the cracked faces to get more exact fluid pressure.
The second option may require quite a bit of coding.

Quote:

Originally Posted by codder (Post 473463)
2. Is there any fundamental, conceptual problem with using the icoFsiFoam methods for the above purpose?
(Looked at the solid models in foam-extend-3.0/src, but I couldn't resolve this in my mind...)

Using icoFsiFoam as a basis should be fine.

Quote:

Originally Posted by codder (Post 473463)
3. On defining patches:

a. What is the function of the 0/materials boundaryField, in crackingBiMatDcbLinear tut?

... I think they don't do anything, because just defines material heterogeneity on a per-cell basis.

The material properties are defined in constant/rheologyProperties; when multiMaterial is used (i.e. when there are more than one material present) then you must define/set the 0/materials field, where 0 corresponds to the first material in constant/rheologyProperties, 1 corresponds to the second material in constant/rheologyProperties, etc.

The crackingBiMatDcbLinear case has two materials defined: you can view the materials field in ParaView.

Quote:

Originally Posted by codder (Post 473463)
b. How to visualize, for example with paraFoam, the 0/U crack patch?

... I am confused about the nature of the computed values for crack - e.g., as to what "1" or "2" means.

To visualise the crack, turn off the internalField and just turn on the crack patch in ParaView then you will see faces added to it in time.
As regards "1" and "2":
  • a faces with "1" means that the face is damaging; this means the face is within the cohesive zone and is currently is the process of dissipating energy. Comparing with standard FE methods, this corresponds to when the cohesive element has initiated;
  • a face with "2" means that the face is fully cracked i.e. the traction if zero, unless it is in contact.

Best regards,
Philip

codder February 8, 2014 00:26

links in Allrun for solidMechanics/depreciated/icoFsiFoam
 
Hi Dr. Cardiff -

I'm happy to put this on "Mantis", but I thought this might be the right place, cause it's not a core code issue. Just noticed that there's a minor duplication of work in:

Code:

~/foam/foam-extend-3.0/tutorials/solidMechanics/deprecatedTutorials/icoFsiFoam/flappingConsoleSmall/Allrun
... described by this post.

These lines can be deleted from the icoFsiFoam tutorial:

Quote:

Code:

cd constant
ln -s ../../solid/constant solid
cd ..
cd 0
ln -s ../../solid/0 solid
cd ..


I myself have run the tutorial successfully after having deleted them.

Best, Eric

codder February 13, 2014 00:05

updates to cohesivePatch BC
 
1 Attachment(s)
@ Dr. Cardiff -

Thank you answering my questions, as well as the reference. I have contained in this and the following posst two questions about the code contained in elasticAcpSolidFoam.


QUESTION #1


How is it that I can represent the propagation of fluid, as a pressure boundary condition, inside a elasticAcpSolidFoam crack?

Quote:

As I see, the main difficulties will be how the fluid is represented inside the cracks; there are (at least) two options:
  • Do not solve fluid equations inside cracks, just represent the fluid pressure as a boundary condition on the crack faces;


SOLUTION TO QUESTION #1


Basically, my trouble was not just to update the BC, but also to do so for each face of an interactively expanding patch.** Initially, I attempted to accomplish this by editing the patch source. But there's another way! I have worked out how to do this, from also another post by Dr. Cardiiff.

The first step involves getting a pointer to the expanding patch (documented in elasticAcpSolidFoam). Then, you go in and update the BC, by inserting a #include on the top of the solver loop... e.g., for me, the loop in which UEqn is defined.

My #include looks like:

Code:

{
    int cohesivePatchPresSize(cohesivePatchUPtr ? cohesivePatchUPtr->size() : cohesivePatchUFixedModePtr->size());
    for (label i=0; i<cohesivePatchPresSize; i++)
        { 
              vector pressure = 10e9 * mesh.Sf().boundaryField()[cohesivePatchID][i];
              //Info << "\nLabel "<< i <<" ."  << nl << endl;
              //Info << "\nPressure vector "<< pressure <<" ."  << nl << endl;

          if(cohesivePatchUPtr)
            { 
              cohesivePatchUPtr->traction()[i] -= pressure;
            } 
          else
            { 
              cohesivePatchUFixedModePtr->traction()[i] -= pressure;
              cohesivePatchUFixedModePtr->initiationTraction()[i] -= pressure;
            } 
   
        } 
}

I attach documentation of my misguided attempts at FvPatch editing as a warning to others :)


Best, Eric


**Also, with BC values specified by a non-uniform function, S.T. traction= traction[i].

codder February 23, 2014 14:37

guestion on globalCrackFaceAddressing
 
4 Attachment(s)
@ Dr. Cardiff -

The following question relates to an unexplained error I see during runtime of myIcoFsiElasticAcpSolidFoam, specifically relating to use of the crackerFvMesh library. Unlike Question #1 (above), I'm not exactly sure where to start on this - I believe because it seems to require a deeper understanding of meshing.

QUESTION #2

I have acted based upon your (tacit) approval of an icoFsiFoam modification. The (attached) "myIcoFsiElasticAcpSolidFoam" solver now complies and will execute over both fluid and solid case -- IFF the original crackingBiMatDcbLinear displacement boundary conditions have been set to zero (see attached images).

I was worried about runtime errors on stressedMesh.update() at the first crack event -- but no, that works. Instead, I'm seeing a runtime error at line in updateCrack.H:

Code:

        const labelList& gcfa = stressMesh.globalCrackFaceAddressing();
The error corresponds to the first cracked face. In my log:

Code:

Internal face to break: 1(1391)
Coupled face to break: 0()
--> FOAM FATAL ERROR:
problem with defining global crack face addressing

    From function crackerFvMesh::makeGlobalCrackFaceAddressing() const
    in file arbitraryCrack/crackerFvMesh/crackerFvMesh.C at line 400.

I have traced the error in file arbitraryCrack/crackerFvMesh/crackerFvMesh.C to (I think) a negative value of

Code:

    const vectorField::subField crackCf =
        boundaryMesh()[crackPatchID_.index()].faceCentres();

... which gets checked for negativity at line 395:

Code:

        if (gcfa[faceI] < 0)
        { 
            FatalErrorIn

I'm wondering what I'm doing wrong?

I though my code was fully segregated between (fluid) mesh and (cracking) stressedMesh - thus boundaryMesh() would produce identical results for "myIcoFsiElasticAcpSolidFoam" as does elasticAcpSolidFoam.

Thanks for any help, Eric

davidsblom February 27, 2014 09:55

Hi Philip,

Small questions, I noticed that in writeFields.H of the elasticNonLinTLSolidFoam solver the density is updated with rho = rho / J.
I was wondering whether this is correct, since it is not executed at every time step, since runTime->outputTime() does not return true for every time step.
Any thoughts on this?

Thanks.

David

iczajka March 5, 2014 08:44

displacement limit
 
Hi, everybody,
I am trying to solve fsi problem with OpenFoam extended 3.0.
I'm using isoFsiElasticNonLinULSolidFoam solver. I have kind of beam, that is moving due to fluid pressure. But also there is support, that should limit displacement of beam.
Is there easy way to implement displacement limit in beam ?

Irek

bigphil March 6, 2014 05:08

Quote:

Originally Posted by iczajka (Post 478289)
Hi, everybody,
I am trying to solve fsi problem with OpenFoam extended 3.0.
I'm using isoFsiElasticNonLinULSolidFoam solver. I have kind of beam, that is moving due to fluid pressure. But also there is support, that should limit displacement of beam.
Is there easy way to implement displacement limit in beam ?

Irek

Hmnn, there is always a way but I'm not sure if there is an easy way.
It sounds like you essentially want to activate a contact-style condition.

You would have to do a bit of coding in the solver and check the solid FSI interface if it goes outside the specified bounds; if it does then you would need to fix the normal displacement or apply a penalty force or something along those lines.

Philip

bigphil March 6, 2014 05:21

Quote:

Originally Posted by davidsblom (Post 477123)
Hi Philip,

Small questions, I noticed that in writeFields.H of the elasticNonLinTLSolidFoam solver the density is updated with rho = rho / J.
I was wondering whether this is correct, since it is not executed at every time step, since runTime->outputTime() does not return true for every time step.
Any thoughts on this?

Thanks.

David

Hi David,

You are correct: this is a mistake.

rho should not be updated at all in the total Lagrangian solver, as it integrates over the initial mesh and hence always uses the initial density.

So this line should be removed:
Code:

rho = rho / J
This line was probably added during analysis of a quasi-static case as a quick way to check rho changes.

Thanks,
Philip

Forum March 6, 2014 05:52

Roller BC in Simply Supported Beam
 
1 Attachment(s)
Hi,

I would like to know how a roller BC of a simply supported beam, the right BC in attachment, can be modeled.

Thanks.

bigphil March 6, 2014 07:01

Quote:

Originally Posted by Forum (Post 478495)
Hi,

I would like to know how a roller BC of a simply supported beam, the right BC in attachment, can be modeled.

Thanks.

If you apply a pressure to the top surface of the beam then it will bend downwards and the roller will not play any part, if I understand your drawing correctly.

If the pressure was on the bottom surface of the beam then there would be contact between the beam and the roller; in that case you would need to use a contact boundary condition: take a look at the elasticSolidFoam tutorials which use the solidContact boundary condition.

Philip

Forum March 6, 2014 08:30

Simply Supported Beam
 
How can the right BC of attached beam be modeled, please? The right BC is like a pin so beam can rotate around the connection point.

Thanks.

bigphil March 6, 2014 08:41

Quote:

Originally Posted by Forum (Post 478529)
How can the right BC of attached beam be modeled, please? The right BC is like a pin so beam can rotate around the connection point.

Thanks.

I am not sure if I understand, but if you make a very small boundary patch where the pin is attached, with only one face, then you can set the displacement of this patch/face to be fixedValue ( 0 0 0 ): this will act like pin which the beam can rotate about.

Philip

hxaxtma March 6, 2014 09:12

Hi small question,

I am using the flappingConsole icoFsiFoaam Tutorial in Couette Channel.Therfore I used cyclicGgi for inlet and outlet. How do I have to define these boundaries in the motionU file, cause cyclicGgi is not supported.

bigphil March 6, 2014 09:14

Quote:

Originally Posted by hxaxtma (Post 478544)
Hi small question,

I am using the flappingConsole icoFsiFoaam Tutorial in Couette Channel.Therfore I used cyclicGgi for inlet and outlet. How do I have to define these boundaries in the motionU file, cause cyclicGgi is not supported.

I don't have much experience with cyclicGgi so I'm afraid I can't help. Maybe someone else has ideas.

Philip

hxaxtma March 6, 2014 09:31

1 Attachment(s)
The problem is that I get backflow at the outlet, I tried in motionU file for inlet and outlet
fixedValue and slip; both are resulting in backlow at the outlet


All times are GMT -4. The time now is 14:46.