|
[Sponsors] |
Block coupling three equations using foam extend 4.1 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 16, 2019, 12:29 |
Block coupling three equations using foam extend 4.1
|
#1 |
Member
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 41
Rep Power: 10 |
Hi all,
I'm using (trying to use ) foam-extend's coupledFvMatrix (https://github.com/Unofficial-Extend...vBlockMatrix.H) to couple three equations. The coupling terms consist of "laplacians" and Time derivatives . This thread explains how I'm approaching this and what the current results are. I know I'm doing something (Or more) wrong since these results are not sane enough . First, construct a volVectorField to hold solved (scalar) Fields: Code:
volVector3Field pSwSg ( IOobject ( "pSwSg", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedVector3("zero", dimless, vector3::zero) ); Code:
// "Main" pressure equation fvScalarMatrix pEqn ( fvm::ddt(M, p) + fvm::laplacian(-D, p) + fvc::div(somePhi) ); // Coupled term between pEqn and some other SwEqn fvScalarMatrix SwInp ( - fvm::ddt(M1, Sw) // and maybe fvm::laplacian(D1, Sw) ); Code:
// Instantiate the coubled matrix fvBlockMatrix<vector3> resEqn(pSwSg); // Add equations resEqn.insertEquation(0, pEqn); resEqn.insertEquation(1, SwEqn); resEqn.insertEquation(2, SgEqn); // Insert coupling terms // Sw term in pEqn: resEqn.insertEquationCoupling(0, 1, SwInp); // Note that SwInp is a fvScalarMatrix // Add more couplings ... The problem is, inserting the following code: Code:
Info<< "Lower Coupling:" << << resEqn.coupleLower() << nl << "Upper Coupling:" << << resEqn.coupleUpper() << nl << "Component Coupled:" << << resEqn.componentCoupled() << nl << "Coupled Diagonal:" << nl << resEqn.diag() << endl; Code:
Lower Coupling: 3 ( unallocated 1 unallocated 1 unallocated 0 ) Upper Coupling: 3 ( unallocated 1 unallocated 1 unallocated 0 ) Component Coupled: 1 Coupled Diagonal: square 5 ( (-865.137 -7.42132e-07 -7.42132e-07 21.9694 7.42132e-06 0 -129771 -0.00011132 -0.000103899) (-14549.7 -1.51723e-13 -1.51723e-13 368.569 1.51723e-12 0 -2.18245e+06 -2.27584e-11 -2.12412e-11) (-302060 -4.08706e-29 -4.08706e-29 7645.23 4.08706e-28 0 -4.5309e+07 -6.13059e-27 -5.72188e-27) (-1.3066e+07 -8.3987e-74 -8.3987e-74 330590 8.3987e-73 0 -1.95991e+09 -1.2598e-71 -1.17582e-71) (-1.27778e+07 -3.88293e-254 -3.88293e-254 323294 3.88293e-253 0 -1.91666e+09 -5.8244e-252 -5.4361e-252) ) GMRES: Solving for pSwSg, Initial residual = (0.006936 0.000167427 0.992364), Final residual = (2.11584e-12 7.29283e-15 1.42317e-14), No Iterations 1 Huh, no upper/lower coupling . Any help or orientation to some reference materials is greatly appreciated. Best regards, |
|
March 18, 2019, 22:20 |
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Are you looking at the right place? Look at the matrix: there is diag, upper and lower; then there is out-of-core coefficient like processor boundaries.
From your output, you MUST get block clefs for upper and lower; otherwise GMT’s would not be called. I think you are looking at the wrong place. I also have doubts about your cross-mciupling matrix, but that’s another thing...
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
March 19, 2019, 11:35 |
|
#3 |
Member
Elwardi Fadeli
Join Date: Dec 2016
Location: Boumerdes, Algeria
Posts: 41
Rep Power: 10 |
Mr @hjasak, thank you for your reply.
As you pointed out, the coupled matrix seems to be OK unless I'm making a vague, invalid assumption somewhere (detailed log attached). I need to be 100% sure of something though; Does Code:
fvBlockMatrix::insertEquationCoupling(id1, id2, 2In1) (following the same convention of insertBlockCoupling used in pUCoupledFoam) Or is it the other way around. |
|
Tags |
block matrix, block-coupling, foam ext 4.0, foam extend |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 05:18 |
[Commercial meshers] Using starToFoam | clo | OpenFOAM Meshing & Mesh Conversion | 33 | September 26, 2012 05:04 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
gmsh2ToFoam | sarajags_89 | OpenFOAM | 0 | November 24, 2009 23:50 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |