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/)
-   -   Implementation of orthotropic thermal effects in tractionBoundaryGradient class (https://www.cfd-online.com/Forums/openfoam-programming-development/144405-implementation-orthotropic-thermal-effects-tractionboundarygradient-class.html)

derkermit November 13, 2014 14:59

Implementation of orthotropic thermal effects in tractionBoundaryGradient class
 
Hello,
I've modified the elasticOrthoSolidFoam solver such that it accounts for thermal residual stresses because I got oscillations in the stress and epsilon fields which seems to be introduced by the BC. The thermal contribution has to be incorporated into the tractionBoundaryGradient class in order to get the BC's right but that hasn't been done for orthotropic boundaries so far.

My implementation in tractionBoundaryGradient.C (foam ext 3.1) looks like this:

Code:

// Thermal effects
        if
        (
            patch.boundaryMesh().mesh().objectRegistry::
            foundObject<thermalModel>("thermalProperties")
        )
        {
            const thermalModel& thermo =
                patch.boundaryMesh().mesh().objectRegistry::
                lookupObject<thermalModel>("thermalProperties");

            const fvPatchSymmTensor4thOrderField& C =
                patch.lookupPatchField<volSymmTensor4thOrderField, symmTensor4thOrder>
                (
                    "rheologyLawStoredC"
                );

            const fvPatchSymmTensorField& alphaOrtho =
                patch.lookupPatchField<volSymmTensorField, symmTensor>
                (
                    "alphaOrtho"
                );

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

                    gradient += n & (C && (alphaOrtho*DT));
                }
                else
                {
                    const fvPatchScalarField& T =
                        patch.lookupPatchField<volScalarField, scalar>("T");

                    const scalarField T0 =
                        thermo.T0()().boundaryField()[patch.index()];

                    gradient += n & (C && (alphaOrtho*(T - T0)));
                }
        }

I pretty much just copied most of the code from the isotropic part (which actually contains a bug at line 554 which should be true for incremental solvers) and changed the calculation of the contribution to the gradient. alphaOrtho is a symmetrical tensor with the orthotropic thermal expansion coefficients.

I'm running a simulation right now to compare the results but was wondering if someone else has already tried this and can give me some feedback wether this implementation is correct or not.

EDIT: Looks like the stress oscillations are gone =) However the cpu time increased by about 11%...

Thanks, Alex

bigphil November 16, 2014 07:24

Hi Alex,

As far as I can see, the way you are doing it should be correct.
Is it possible for you to share your solver and a simple case? And the tractionBoundaryGradient.C file?

Philip

derkermit November 17, 2014 07:34

Hi Philip,
that would be possible but I have to clean things up before that... :D

Thanks for checking the code.

Alex


All times are GMT -4. The time now is 11:57.