|
[Sponsors] |
Calculate surfaceScalarField in parallel (boundary processor) |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 8 ![]() |
Hi everyone,
I have a diffusivity "D" calculated in the faces of the cell. I want to limit D on some faces (make it zero), when a parameter "P" (also defined in the faces) is smaller than "epsilon". The code I use works well, EXCEPT ON THE BOUNDARIES BETWEEN PROCESSORS. Attached is a figure of D calculated in series, and D calculated in parallel with 32 processors. You'll see that they are different ONLY in the boundaries between processors (indicated with the glyphs) Following the implementation of flux limiters on MULES, I do the following (simplified code): Code:
surfaceScalarField D(fvc::interpolate(D_cell)); scalarField allLambda(mesh.nFaces(), 1.0); slicedSurfaceScalarField lambda ( IOobject ( "lambda", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), mesh, dimless, allLambda, false // Use slices for the couples ); scalarField& lambdaIf = lambda; surfaceScalarField::Boundary& lambdaBf = lambda.boundaryFieldRef(); forAll(lambdaIf, facei) { if(P[facei] < epsilon) {lambdaIf[facei] = 0;} } forAll(lambdaBf, patchi) { scalarField& lambdaPf = lambdaBf[patchi]; forAll(lambdaPf, pFacei) { if(P[pFacei] < epsilon) {lambdaIf[pFacei] = 0;} } } syncTools::syncFaceList(mesh,allLambda,minEqOp<scalar>()); D*=lambda; ![]() ![]() |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 8 ![]() |
Found the error. It was a stupid typo. It should have said lambdaPf and not lambdaIf on the boundary fields.
Code:
forAll(lambdaBf, patchi) { scalarField& lambdaPf = lambdaBf[patchi]; forAll(lambdaPf, pFacei) { if(P[pFacei] < epsilon) {lambdaPf[pFacei] = 0;} } } |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary condition problem (Freestream) | KAYANO | OpenFOAM Running, Solving & CFD | 5 | June 1, 2021 05:57 |
foam-extend_3.1 decompose and pyfoam warning | shipman | OpenFOAM | 3 | July 24, 2014 08:14 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 06:28 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 07:00 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 15:55 |