CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Coupled processor faces in e.g. gaussLaplacianScheme class

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Jesper_Roland

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2020, 05:29
Post Coupled processor faces in e.g. gaussLaplacianScheme class
  #1
New Member
 
Jesper R. K. Qwist
Join Date: Dec 2017
Posts: 22
Rep Power: 9
Jesper_Roland is on a distinguished road
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();
        }
    }
I am quite sure that fvm.internalCoeffs

Code:
                     fvm.internalCoeffs()[patchi][facei] =  pGamma[facei]*pvf.gradientInternalCoeffs(pDeltaCoeffs).ref()[facei];
goes to the matrix diagonal. Please correct me if I am wrong.

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;
}
I am not sure I understand what fvm.boundaryCoeffs() is. I know it relates to the neighbouring field, but is this added to the matrix as a source term or is it accounted for in the matrix off diagonal elements? If it is accounted for like matrix off-diagonal elements, how is this obtained in the code?

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);
}
I have read about ldu interfaces, but I do not understand how they are used for the coupled processor faces. Can anyone shed some light on this, or have a reference which explains this in detail?


Cheers,


Jesper.
yueyun likes this.
Jesper_Roland is offline   Reply With Quote

Reply

Tags
coupled faces, ldu interfaces, parallel programming, processor, processor faces


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:29.