|
[Sponsors] |
Coupled processor faces in e.g. gaussLaplacianScheme class |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 19, 2020, 05:29 |
Coupled processor faces in e.g. gaussLaplacianScheme class
|
#1 |
New Member
Jesper R. K. Qwist
Join Date: Dec 2017
Posts: 22
Rep Power: 8 |
Hi,
I have for a while tried to understand how the coupled interfaces between the processor sub domains work without success. Below I have posted the boundary loop from the class gaussLaplacianScheme, where it has been modified to only work with scalars. This class creates the discretisation for the laplacian term in our equations. I believe that the treatment of the processor faces happens in the boundary loop below: Code:
forAll(vf.boundaryField(), patchi) { const fvPatchField<scalar>& pvf = vf.boundaryField()[patchi]; const fvsPatchScalarField& pGamma = gammaMagSf.boundaryField()[patchi]; const fvsPatchScalarField& pDeltaCoeffs = deltaCoeffs.boundaryField()[patchi]; // Boundary face cells in patch i: const polyPatch& pp = vf.mesh().boundaryMesh()[patchi]; const UList<label>& bfaceCells = pp.faceCells(); if (pvf.coupled()) { forAll(bfaceCells,facei) { // Does this contribution goes to fvMatrix diagonal? fvm.internalCoeffs()[patchi][facei] = pGamma[facei]*pvf.gradientInternalCoeffs(pDeltaCoeffs).ref()[facei]; // Does this contribution goes to the fvMatrix source vector // or the upper() and lower() vectors for the off-diagonal terms? fvm.boundaryCoeffs()[patchi][facei] = -pGamma[facei]*pvf.gradientBoundaryCoeffs(pDeltaCoeffs).ref()[facei]; } } else { fvm.internalCoeffs()[patchi] = pGamma*pvf.gradientInternalCoeffs(); fvm.boundaryCoeffs()[patchi] = -pGamma*pvf.gradientBoundaryCoeffs(); } } Code:
fvm.internalCoeffs()[patchi][facei] = pGamma[facei]*pvf.gradientInternalCoeffs(pDeltaCoeffs).ref()[facei]; The term pvf.gradientInternalCoeffs(pDeltaCoeffs) for a coupled patch is defined in coupledFvPatchField.C as Code:
template<class Type> Foam::tmp<Foam::Field<Type>> Foam::coupledFvPatchField<Type>::gradientInternalCoeffs ( const scalarField& deltaCoeffs ) const { return -Type(pTraits<Type>::one)*deltaCoeffs; } The coefficient pvf.gradientBoundaryCoeffs(pDeltaCoeffs) is also defined in coupledFvPatchField.C as Code:
template<class Type> Foam::tmp<Foam::Field<Type>> Foam::coupledFvPatchField<Type>::gradientBoundaryCoeffs ( const scalarField& deltaCoeffs ) const { return -this->gradientInternalCoeffs(deltaCoeffs); } Cheers, Jesper. |
|
Tags |
coupled faces, ldu interfaces, parallel programming, processor, processor faces |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GeometricField -> mesh() Function | Tobi | OpenFOAM Programming & Development | 10 | November 19, 2020 12:33 |
[ANSYS Meshing] Help with element size | sandri_92 | ANSYS Meshing & Geometry | 14 | November 14, 2018 08:54 |
Reasons for decoupling the pressure and velocity computations | highlando | Main CFD Forum | 36 | April 10, 2017 11:41 |
How to rewrite a standard OpenFOAM solver as a C++ class | cfbaptista | OpenFOAM Programming & Development | 7 | March 23, 2016 05:50 |
Coupled 1D/3D STAR-CD Training | CD adapco Group Marketing | Siemens | 1 | November 13, 2002 16:48 |