CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

1D two fluid model development

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2023, 02:28
Unhappy 1D two fluid model development
  #1
New Member
 
ZP zhao
Join Date: Oct 2023
Location: China
Posts: 7
Rep Power: 3
ZX-zha is on a distinguished road
I know for sure that OpenFOAM can be used in 1D calculation. So I want to simulate the 1D two-phase pipe flow using the multiphaseEulerFoam solver, but some modifications are also needed. So I ignored the lift model, the virtual mass model often used in the 3D simulation and developed a drag model used in 1D simulation, the basic equations should be:
\frac{\partial}{\partial t}(\alpha_i\rho_i)+\nabla\cdot(\alpha_i\rho_i\vec u_i)=0
\frac{\partial}{\partial t}(\alpha_i\rho_i\vec u_i)+\nabla\cdot(\alpha_i\rho_i\vec u_i\vec u_i)=-\alpha_i\nabla p+\alpha_i\rho_i |g|\nabla h+\alpha_i\rho_i\vec g+\vec F_i+\vec F_{iw}
where h is the depth of water.

So I thought the only thing I needed to do was write a drag model and add the water depth term. I also found a paper that uses the same idea as mine.

The K() member function of the drag model is:
Code:
Foam::tmp<Foam::volScalarField> Foam::dragModels::PipeLayer::K() const
{
    const fvMesh& mesh(interface_.phase1().mesh());
    const volScalarField& alpha2(interface_.phase2());

    const volScalarField& rho1(interface_.phase1().rho());

    tmp<volScalarField> tnu1(interface_.phase1().thermo().nu());

    const volScalarField& nu1(tnu1());

    Info<< "Create the Circle Object"<< endl;
    Circle cir(d_);

    wordList pbt = alpha2.boundaryField().types();
    forAll(pbt,pbi)
    {
        if (pbt[pbi] != "empty")
        {
            pbt[pbi] = "zeroGradient";
        }
    }

    volScalarField relativeHeight_
    (
        IOobject
        (
            "calc",
            mesh.time().timeName(),
            mesh
        ),
        mesh,
        dimensionedScalar("zero",dimLength,0.0),
        pbt
    );
    relativeHeight_.primitiveFieldRef() = cir.HeightRef(alpha2);
    relativeHeight_.correctBoundaryConditions();

    volScalarField hydroDiameter(cir.hydroDiameterG(alpha2,relativeHeight_));

    volScalarField Re1(Foam::max(hydroDiameter*interface_.magUr()/nu1,Foam::SMALL));

    volScalarField f1(Foam::max(16/Re1,0.014));
    volScalarField AG = Foam::max(cir.AG(alpha2)/pow(d_,2),Foam::SMALL)*pow(d_,2);

    return 0.5*f1*rho1*hydroDiameter*interface_.magUr()/AG;
}
And the water depth term(in UEqn.H file):
Code:
        UEqns.set
        (
            phase.index(),
            new fvVectorMatrix
            (
                // fvm::ddt(alpha, rho, U)
                // + fvm::div(alphaRhoPhi, U)
                // + fvm::SuSp(-this->continuityError(), U)
                phase.UEqn()
                ==
                *momentumTransfer[phase.name()]
                + fvModels.source(alpha, rho, U)
                - cosTheta*alpha*rho*Foam::mag(g)*fvc::grad(height)
            )
        );
But for me, it didn't work.

I know there is something wrong, but I can't find the mistake(s). It would be very helpful if anyone could take a look.
ZX-zha is offline   Reply With Quote

Old   November 6, 2023, 04:45
Default Some tests
  #2
New Member
 
ZP zhao
Join Date: Oct 2023
Location: China
Posts: 7
Rep Power: 3
ZX-zha is on a distinguished road
I also took some tests:
Test1(without source term):
in this paper:Study of flow at the air-Water interface

The result shows:


Test2(without source term):
in this paper:Hybrid flux-splitting schemes for a common two-fluid model

The result shows:

(The left is the paper result and the right is my result)

These tests show that this idea is feasible, so either my drag model or the water depth term is wrong.
ZX-zha is offline   Reply With Quote

Reply

Tags
1d simulation, two-fluid


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Artificial wall error in fluent aiden_1995 Main CFD Forum 0 January 9, 2023 15:06
Intuition for why flow follows convex surfaces lopp Main CFD Forum 47 February 1, 2022 14:14
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 17, 2020 00:44
Error in Two phase (condensation) modeling adilsyyed CFX 15 June 24, 2015 20:42
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 07:05.