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/)
-   -   Using MULES to solve transport equation with sharp interface (https://www.cfd-online.com/Forums/openfoam-programming-development/123577-using-mules-solve-transport-equation-sharp-interface.html)

derkermit September 16, 2013 12:47

Using MULES to solve transport equation with sharp interface
 
Hi,
I'm modelling the curing behavior of a thermosetting polymer which is injected into a mold. For this, I took the compressibleInterFoam solver as a starting point and extended it in order to calculate the increase in degree of cure. This then is added to the current degree of cure which has to be convected with the flow field. At this point, I'm facing the problem of numerical diffusion during the filling step. Due to this I get a degree of cure greater than zero in areas where there is no resin at all. Up to now I tried limitedLinear01 and currently I'm running a test case with vanLeer. Besides this, I'm curious if it is possible to use the MULES solver for this specific problem. I tried some implementations but most of them crashed the solver in the second time step and the other led to unphysical values.

Long story short: Is it even possible to convect a scalar through a domain by coupling its flux field to that of alpha by using MULES? This should give an interface as sharp as that of alpha or not?

Thanks in advance!
Alex

becklei February 26, 2014 23:03

1 Attachment(s)
Hi, Derkermit!

I also tried to simulate injection molding filling process, and encountered similar problems. The results(shown in the picture) of the unsteady convection equation(VOF model) of scalar field alpha is disappointing. I don't know if my questions are similar to yours?

Looking forward to your reply:)

derkermit February 27, 2014 05:09

Hey,
I think your problem is somehow different. The implementation of the alpha field already uses MULES to maintain a sharp interface. This should work (more or less) out of the box. Which solver and OF version are you using and how does your fvSchemes look like?

Back to topic:
I managed to solve the transport equation for the degree of cure with MULES. I had to adapt the alphaEqnsSubCycle.H file of compressibleInterFoam (OF221) and extended it by this:

Code:

...
    else
    {
        #include "alphaEqns.H"
    }

// Here begins the new part

    volScalarField::DimensionedInternalField SpCure
    (
        IOobject
        (
            "SpCure",
            runTime.timeName(),
            mesh
        ),
        mesh,
        dimensionedScalar("SpCure", cureSource.dimensions(), 0.0)
    );

    volScalarField::DimensionedInternalField SuCure
    (
        IOobject
        (
            "SuCure",
            runTime.timeName(),
            mesh
        ),
        // Divergence term is handled explicitly to be
        // consistent with the explicit transport solution
        divU*cure
    );

    forAll(cureSource, celli)
    {
        SuCure[celli] += cureSource[celli]*alpha1[celli];
    }

    surfaceScalarField phiCure
    (
        fvc::flux
        (
            phi,
            cure,
            alphaScheme
        )
      + fvc::flux
        (
            -fvc::flux(-phir, alpha2, alpharScheme),
            cure,
            alpharScheme
        )
    );

    MULES::explicitSolve
    (
        geometricOneField(),
        cure,
        phiCure,
        SpCure,
        SuCure
    );
    Info<< "Cure = "
        << cure.weightedAverage(mesh.V()).value()
        << "  Max(cure) = " << max(cure).value()
        << "  Min(cure) = " << min(cure).value()
        << endl;

I would appreciate any comments as I'm not totally sure about this implementation. However, some testing has shown it to be way better than before regarding numerical diffusion.

becklei February 27, 2014 06:37

My OF is the 1.6-ext version, and divschemes {div(phi,alpha) gauss vanleer; div(phirb,alpha) gauss intefaceCompression} .


All times are GMT -4. The time now is 23:35.