CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Thermal stress prediction with elasticThermalSolidFoam - No contribution to UEqn? (https://www.cfd-online.com/Forums/openfoam-programming-development/144217-thermal-stress-prediction-elasticthermalsolidfoam-no-contribution-ueqn.html)

derkermit November 10, 2014 11:28

Thermal stress prediction with elasticThermalSolidFoam - No contribution to UEqn?
 
1 Attachment(s)
Hello all,
I'm trying to predict thermal stresses in a polymer that cures in a mold. At the same time I model the same problem with FEM (Abaqus) in order to compare the results.

In order to simplify my problem, I started with a cube with 20x20x20 elements and 0.1m edge length. Only thermal expansion is taken into account at the moment.

In the source code of the solver one can find the following lines:

Code:

    divSigmaExp = fvc::div
      (
      mu*gradU.T() + lambda*(I*tr(gradU)) - (mu + lambda)*gradU,
      "div(sigma)"
      )
      - gradThreeKalphaDeltaT;

This is part of the source term of the momentum equation an the thing I don't understand is the behaviour of gradThreeKalphaDeltaT in the presence of homogenous temperature fields. As an example, consider the cubes temperature to be 323.15 K and the specified reference temperatur T0 = 373.15 K. This will give a non zero threeKalphaDeltaT but as soon as the gradient of this is calculated and put in the momentum equation, the thermal contribution is just zero, at least for my understanding. As a consquence, the cube doesn't deform as it should and is only showing very small values of epsilon. From my calculations, it should reach epsilon_xx = -0.00275 of contraction (which is confirmed by abaqus) but elasticThermalSolidFoam only gives around 2e-5.
Does anyone have an idea what is wrong here?
I've attached the case to this post.

Thanks in advance for any help!
Alex

bigphil November 15, 2014 06:06

Hi,

I found a bug that was introduced in $FOAM_SRC/solidModels/constitutiveModel/tractionBoundaryGradient/tractionBoundaryGradient.C in foam-extend-3.1:

Change this line:
Quote:

if (!incremental)
{
const fvPatchScalarField& DT =
patch.lookupPatchField<volScalarField, scalar>("DT");

gradient += n*threeKalpha*DT;
}
to this line:
Quote:

if (incremental) // bugfix philipc Nov-14 remove not
{
const fvPatchScalarField& DT =
patch.lookupPatchField<volScalarField, scalar>("DT");

gradient += n*threeKalpha*DT;
}
This bug meant that the traction boundary conditions were incorrect with thermal stresses.

I tried your case and it seems to work now.

One comment on your case: in general I have found that the solution tolerance for U should typically be at least 1e-6, in the solidMechanics dict in system/fvSolution:
Quote:

solidMechanics
{
nCorrectors 10000;
U 1e-6;
//U 1e-3;
}
Let me know how it goes,
Philip


EDIT:
Ah I see you already found this problem and reported it:
http://sourceforge.net/p/openfoam-ex...ndrelease/258/

derkermit November 15, 2014 10:35

1 Attachment(s)
Hi Philip,
thanks for your answer. Your right, it works now, at least for the isotropic case =)

I also added TEqn to your orthotropic solver (elasticOrthoSolidFoam) and modified divSigmaExp like this:

Code:

if(divSigmaExpMethod == "standard")
  {
    //- calculating the full gradient has good convergence and no high freq oscillations
    divSigmaExp =
      fvc::div(
          (C && (symm(gradU) - alphaOrtho*(T-T0)))
          - (K & gradU),
          "div(sigma)"
          );
  }

tractionBoudnaryGradient.C has also been modified (http://www.cfd-online.com/Forums/ope...ent-class.html) in order to account for the thermal effects.
However, the solver doesn't converge. I attached the case to this post. Do you have an idea what could be the problem here?

Quote:

Originally Posted by bigphil (Post 519288)
One comment on your case: in general I have found that the solution tolerance for U should typically be at least 1e-6, in the solidMechanics dict in system/fvSolution:

I tried different values for this and didn't got that much of a difference besides a much faster simulation. I also searched for the criteria abaqus uses and this seems to be about 1e-3. But I have to mention that this was solely on simple meshes/geometries. Maybe on more complex meshes this affects the solution accuracy more. How did you figure out this specific value of 1e-6?

Have a nice weekend!
Alex

bigphil November 16, 2014 06:14

I will have a look at the addition of an orthotropic thermal term.

Quote:

Originally Posted by derkermit (Post 519316)
I tried different values for this and didn't got that much of a difference besides a much faster simulation. I also searched for the criteria abaqus uses and this seems to be about 1e-3. But I have to mention that this was solely on simple meshes/geometries. Maybe on more complex meshes this affects the solution accuracy more. How did you figure out this specific value of 1e-6?

This is just based on what I found works in general; but yep for a given case you just have to check that the tolerance is low enough that the results are independent of it.

Philip

derkermit November 26, 2014 06:07

Hi Philip,
I'm facing another problem with the thermal part of the solver.
If there is only very small change in temperature within the domain, the TEqn doesn't converge even after 10000 iterations. However, if temperature changes occur, it converges really fast.
Did you also observe this behavior?
Is there a reason why TEqn is first solved and then T (not TEqn) is relaxed? I looked into the fluid solver codes and they always relax TEqn first and then solve it. However, modifying the solver that way doesn't help so it has to be something else.

Thanks,
Alex

bigphil December 11, 2014 05:53

Yes I've noticed this too.
A very small amount of equation under-relaxation will fix this.

Put this line after the TEqn is created (and before it is solved):
Code:

TEqn.relax(TEqnRelaxFac);
And you read in the relaxation factor somewhere at the start of the solver, like this:
Code:

scalar TEqnRelaxFac = -1;
if (mesh.solutionDict().relax("TEqn"))
{
    TEqnRelaxFac = mesh.solutionDict().relaxationFactor("TEqn");
}

Then in your case system/fvSolution, add this:
Code:

relaxationFactors
{
    TEqn 0.999;
}

Note: the equation convergence is very sensitive to this factor, I have found a big difference between 0.99 and 0.999.

Philip

derkermit December 15, 2014 17:12

Hi Philip,
thanks, will give it a try :)
Is it possible to under-relaxate UEqn/DUEqn too or would that introduce some error?
In CFD it's applied to both p and U so maybe this could be of advantage here too.

Regards, Alex

bigphil December 16, 2014 11:21

Quote:

Originally Posted by derkermit (Post 524102)
Is it possible to under-relaxate UEqn/DUEqn too or would that introduce some error?

Yes, this is allowed as outer iterations are performed within each time-step, and this can be very helpful in some situations.
Typically only a very small amount is needed, between 0.99 and 0.999 often works well.

Philip


All times are GMT -4. The time now is 22:24.