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/)
-   -   Transport Equation in InterFoam using MULES (https://www.cfd-online.com/Forums/openfoam-programming-development/191152-transport-equation-interfoam-using-mules.html)

TCS August 1, 2017 17:41

Transport Equation in InterFoam using MULES
 
Hi All,

OpenFOAM 4.1

I am adding a scalar transport equation to the InterFOAM solver
$\frac{\partial c}{\partial t} + \nabla\cdot(c{\bf u})$
to track the progress of a scalar concentration field (c) which I define in setFields to be 0,1,2 initially in certain locations.

I have successfully added a standard equation in the InterFoam.C file:
Code:

fvScalarMatrix CEqn
        (
              fvm::ddt(c)
            + fvm::div(phi, c)
        );

CEqn.solve();

However, this is affected by a large amount of numerical diffusion.

I understand I need to use the MULES FCT scheme to try and solve this, as noted in https://www.cfd-online.com/Forums/op...interface.html but am unsure of how to do this.

I've tried adding the following to the alphaEqn file:
Code:

        tmp<surfaceScalarField> phiCure
        (
            fvc::flux
            (
                phi,
                c,
                alphaScheme
            )
          + fvc::flux
            (
              -fvc::flux(-phir, alpha2, alpharScheme),
                c,
                alpharScheme
            )
        );

together with
Code:

MULES::explicitSolve(c, phiCN, phiCure, 2, 0);
but this does not compile with wmake:
error: no matching function for call to ‘explicitSolve(Foam::volScalarField&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, int, int)’
among many errors.

Any help appreciated! Cheers.

TCS August 7, 2017 17:18

Any help appreciated.

Cyp August 7, 2017 19:48

If you just advect a passive scalar without particular condition at the interfaces, why not just solve C from alpha? In your case you just have C=alpha.

Cheers,

TCS August 10, 2017 23:12

Quote:

Originally Posted by Cyp (Post 659807)
If you just advect a passive scalar without particular condition at the interfaces, why not just solve C from alpha? In your case you just have C=alpha.

Cheers,

Hi, I've got there regions (2 droplets coalescing) of flaid. Two have the same alpha value and the issue is I need to know where one droplet is going when it coalescea with the other. So alpha gets me the outline of the two droplets together but not of each separately if you see what I mean. Because the two droplets are (currently) the same fluid. Thanks for the suggestion though :)

Cyp August 16, 2017 00:08

When two droplets coalesce they become one... I am not sure your problem is well posed.

Blumenkind March 20, 2018 12:57

I am stuck with a similar problem. Have you gotten any further?

Edit: Not a similar problem though. You were trying to compile two int, when the compiler wanted to see fields... :)


All times are GMT -4. The time now is 18:47.