|
[Sponsors] |
Non-orthogonal for Up Coupling solver in foamextend41 |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Duc Anh
Join Date: Dec 2018
Posts: 23
Rep Power: 8 ![]() |
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(); 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(); 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); 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; It would be great if you can give me some suggestions to fix this. Thank you so much Best regards, |
|
![]() |
![]() |
![]() |
Tags |
blockmatrix, coupled solver, non-orthogonal |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |