|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 14 ![]() |
Hi Foamers,
I am using a simple internal faces only scheme for smoothing, I can do this just fine in serial. Basically I am by hand setting coefficients of the matrices. my system is Gx=W, I have verified that this is exactly what I need. Code:
fvScalarMatrix W(fvm::Sp(rho,rhoNew)); //my rhs matrix
fvScalarMatrix G(fvm::Sp(rho,rhoNew)); //lhs matrix
W.diag() = rho.primitiveField();
const labelUList& owner = mesh.owner(); //internal faces
const labelUList& neighbour = mesh.neighbour(); // internal faces neighbour
forAll(owner,facei)
{
G.upper()[facei] += (-alpha*(rho[owner[facei]] + rho[neighbour[facei]])/2); // r[facei] = (r[owner] + r[neighbour]) /2;
}
G.negSumDiag();
G.source() += W.diag()*rho.primitiveField(); //rhs
G.relax();
G.solve();
|
|
|
|
|
|
|
|
|
#2 | |
|
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 14 ![]() |
Quote:
This took 4-5 days for me to actually figure out, but this book is quite helpful https://www.springer.com/us/book/9783319168739 Code:
fvScalarMatrix W(fvm::Sp(rho,rhoNew)); //my rhs matrix
fvScalarMatrix G(fvm::Sp(rho,rhoNew)); //lhs matrix
W.diag() = rho.primitiveField();
const labelUList& owner = mesh.owner(); //internal faces
const labelUList& neighbour = mesh.neighbour(); // internal faces neighbour
//this instead of doing the main loop by hand
surfaceScalarField rhoS("rhoS",fvc::interpolate(rho,"midPoint"));
A.upper() = -alphaS*rhoS;
A.negSumDiag();
G.diag() = A.diag() + W.diag();
G.upper() = A.upper();
//works
G.source() = W.diag()*sfield.primitiveField();
//this is how you handle parallelism using boundaryCoeffs and internallCoeffs on processor patches
forAll(mesh_.boundary(), patchi)
{
const polyPatch &ppatch = mesh_.boundaryMesh()[patchi];
if (isA<processorPolyPatch>(ppatch))
{
auto rhoSBf = rhoS.boundaryFieldRef()[patchi];
G.internalCoeffs()[patchi] = alphaS*rhoSBf;
G.boundaryCoeffs()[patchi] = alphaS*rhoSBf;
}
}
G.relax();
G.solve();
Last edited by fedvasu; April 28, 2019 at 23:15. |
||
|
|
|
||
![]() |
| Tags |
| lduaddressing, ldumatrix, parallel, processor boundary |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simpleFoam parallel | AndrewMortimer | OpenFOAM Running, Solving & CFD | 12 | August 7, 2015 19:45 |
| Any Parallel install procedure on Mac OS | JinZhiyi | SU2 Installation | 2 | March 11, 2014 02:12 |
| simpleFoam in parallel issue | plucas | OpenFOAM Running, Solving & CFD | 3 | July 17, 2013 12:30 |
| Paraview Compiling Error (OpenFOAM 2.1.x + openSUSE 12.2) | sfigato | OpenFOAM Installation | 22 | January 31, 2013 11:16 |
| Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 | Amitava Majumdar | Main CFD Forum | 0 | January 5, 1999 13:00 |