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

Non-orthogonal for Up Coupling solver in foamextend41

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 12, 2025, 14:47
Default Non-orthogonal for Up Coupling solver in foamextend41
  #1
New Member
 
Duc Anh
Join Date: Dec 2018
Posts: 23
Rep Power: 8
anhkenyt is on a distinguished road
Dear Foamers,

I've ran pUCoupledFoam solve in fe41 in the simple case "flow over cylinder". However, the non-orthogonal mesh affects the results. After reading the source code, I realize that after Ueqn Peqn, UinP and PinU equation inserted in blockMatrix UpEqn, there is no any function like "non-orthogonal" to handle non-orthogonal mesh function like other non-coupling solvers.
This is the main code
Code:
        fvBlockMatrix<vector4> UpEqn(Up);

        // Assemble and insert momentum equation
#       include "UEqn.H"

        // Assemble and insert pressure equation
#       include "pEqn.H"

        // Assemble and insert coupling terms
#       include "couplingTerms.H"

        Info<<"Solve the block matrix"<<endl;
       maxResidual = cmptMax(UpEqn.solve().initialResidual());
        UpEqn.solve();
with Ueqn.H
Code:
 // Momentum equation
    fvVectorMatrix UEqn
    (
        fvm::ddt(U)
      + fvm::div(phi, U)
      + turbulence->divDevReff() //co cai nay la dig luon tang len 1 luong
    );

    rAU = 1.0/UEqn.A();

    if (gMin(rAU) < 0)
    {
        WarningIn(args.executable())
            << "Negative rAU detected.  Check mesh and discretisation"
            << endl;
    }
    
    // Under-relax momentum. Note this will destroy the H and A
    UEqn.relax();
and Peqn.H
Code:
// Pressure parts of the continuity equation
surfaceScalarField presSource
(
    "presSource",
    fvc::interpolate(rAU)*
    (fvc::interpolate(fvc::grad(p)) & mesh.Sf())
);

fvScalarMatrix pEqn
(
  - fvm::laplacian(rAU, p)
 ==
  - fvc::div(presSource)
); pEqn.setReference(pRefCell, pRefValue);UpEqn.insertEquation(3, pEqn);
and couplingTerms.H
Code:
UpEqn.insertBlockCoupling(0, 3, pInU, true);
    UpEqn.insertBlockCoupling(3, 0, UInp, false);
.
I tried to add pimple and simple loop control correctNonOrthogonal over whole process
Code:
  fvBlockMatrix<vector4> UpEqn(Up);
        while(pimple.correctNonOrthogonal()){
        // Assemble and insert momentum equation
#       include "UEqn.H"

        // Assemble and insert pressure equation
#       include "pEqn.H"

        // Assemble and insert coupling terms
#       include "couplingTerms.H"

        Info<<"Solve the block matrix"<<endl;
       maxResidual = cmptMax(UpEqn.solve().initialResidual());
        UpEqn.solve();
       

    
        UpEqn.retrieveSolution(0, U.internalField());
        UpEqn.retrieveSolution(3, p.internalField());
        
        U.correctBoundaryConditions();
        p.correctBoundaryConditions();
        
        phi = (fvc::interpolate(U) & mesh.Sf()) + pEqn.flux() + presSource;

#       include "continuityErrs.H"

#       include "boundPU.H"

        p.relax();
        
        turbulence->correct();
        
        }
        runTime.write();

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
But the solution accuracy doesn't improve.
It would be great if you can give me some suggestions to fix this.
Thank you so much
Best regards,
anhkenyt is offline   Reply With Quote

Reply

Tags
blockmatrix, coupled solver, non-orthogonal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Coupling Openfoam solver and keras trained neutral network model AhmedHafez OpenFOAM Programming & Development 2 March 11, 2022 14:33
How do I connect a geometry to my solver devansh.purohit Main CFD Forum 4 November 16, 2021 09:51
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 16:44
Which solver should be used for coupling (thermal/hydraulic/chemical)? aminem OpenFOAM 1 March 6, 2018 16:42
Poisson solver - orthogonal grid Fuka Main CFD Forum 0 May 11, 2006 12:19


All times are GMT -4. The time now is 01:19.