|
[Sponsors] |
lapalce discretization for couple boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 31, 2022, 01:45 |
lapalce discretization for couple boundary condition
|
#1 |
New Member
Mostafa
Join Date: Oct 2021
Posts: 22
Rep Power: 5 |
Hello foamers ,
I'm currently studying source code of coupledFvPatchField so i will use it in my future research extension for Discretizing the Laplace operator , we need gradientInternalCoeffs and gradientBoundaryCoeffs so we have gamma*surface area*( gradientBoundaryCoeffs + gradientInternalCoeffs*internal field ) My question is how the those coefficients are evaluated for couple boundary condition so that we get the following results as stated in source code template<class Type> tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs( ) const { return -pTraits<Type>:ne*this->patch().deltaCoeffs(); } template<class Type> tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs( ) const { return -this->gradientInternalCoeffs(); } |
|
November 2, 2022, 15:45 |
|
#3 |
New Member
Mostafa
Join Date: Oct 2021
Posts: 22
Rep Power: 5 |
Hello Domenico ,
in boundary conditions files in /src/finiteVolume/fields/fvPatchFields , we have three cases for boundary conditions basic --> (fixedValue-zeroGradient-fixedGradient-couple- etc) derived --> (any derived boundary condition according to used model) constrained ---> ( symmery - processors Bcs , region couple (patch to patch BC) ) in any one of them , boundary faces contributions to diagonal coefficient and source of ldu Matrix is presented through 5 functions The ones related to divergence (convection term) discretization are valueInternalCoeffs() valueBoundaryCoeffs() so discretizing the divergence term we get gamma*face area*( valueBoundaryCoeffs + valueInternalCoeffs*adjacent cell center value ) The ones related to laplace (diffusuion term ) discretization are gradientInternalCoeffs() gradientBoundaryCoeffs() and discretizing the laplace term we get gamma*face area*( gradientBoundaryCoeffs + gradientInternalCoeffs*adjacent cell center value ) My problem is in couple boundary condition src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C I want to understant how the following coefficients are obtained template<class Type> tmp<Field<Type> > coupledFvPatchField<Type>::gradientInternalCoeffs( ) const { return -pTraits<Type>:ne*this->patch().deltaCoeffs(); } template<class Type> tmp<Field<Type> > coupledFvPatchField<Type>::gradientBoundaryCoeffs( ) const { return -this->gradientInternalCoeffs(); } what i understand is that gamma*face area*(phiN-phiO)/deltaX take the form gamma*face area*(gradientBoundaryCoeffs + gradientInternalCoeffs*phiO) so gradientBoundaryCoeffs = phiN*1/deltaX gradientInternalCoeffs = -1/deltaX but the answer indicated that gradientBoundaryCoeffs = 1/deltaX gradientInternalCoeffs = -1/deltaX |
|
November 3, 2022, 06:59 |
|
#4 |
Senior Member
|
I am confused by your explanation for the following two reasons.
1/ valueInternalCoeffs() and valueBoundaryCoeffs() are related to Dirichlet bc (fixed values). gradientInternalCoeffs() and gradientBoundaryCoeffs() are related to Neumann bc (fixed gradient). 2/ boundary conditions are imposed on differential equations, not on individual differential operators (Laplacian or gradient). Does this help? |
|
November 3, 2022, 10:44 |
|
#5 |
New Member
Mostafa
Join Date: Oct 2021
Posts: 22
Rep Power: 5 |
first of all
valueInternalCoeffs() , valueBoundaryCoeffs() , gradientInternalCoeffs() and gradientBoundaryCoeffs() are related to discretization of laplace and divergence operator not Drichelete and neumann Open fixedValue BC , you will see the four functions define ; two of them are called when discretizing the laplace operator and the other two when discretizing the divergence operator look at these lines of codes in gaussLaplacianScheme<Type, GType>::fvmLaplacianUncorrected class forAll(vf.boundaryField(), patchi) { const fvPatchField<Type>& pvf = vf.boundaryField()[patchi]; const fvsPatchScalarField& pGamma = gammaMagSf.boundaryField()[patchi]; const fvsPatchScalarField& pDeltaCoeffs = deltaCoeffs.boundaryField()[patchi]; if (pvf.coupled()) { fvm.internalCoeffs()[patchi] = pGamma*pvf.gradientInternalCoeffs(pDeltaCoeffs); fvm.boundaryCoeffs()[patchi] = -pGamma*pvf.gradientBoundaryCoeffs(pDeltaCoeffs); } else { fvm.internalCoeffs()[patchi] = pGamma*pvf.gradientInternalCoeffs(); fvm.boundaryCoeffs()[patchi] = -pGamma*pvf.gradientBoundaryCoeffs(); } } gradientInternalCoeffs , gradientBoundaryCoeffs are called to account for boundary face contribution to diagonal and source coefficient of ldu Matrix 2) regarding your second not indeed differential equations are set of operators which will be spatially and temporally discretized so that are applied to boundary cells while discretization |
|
November 3, 2022, 12:53 |
|
#6 | |
Senior Member
|
Dear Mostafa,
1/ My bad. Thank you for pointing our my mistake. Appreciated. I will redo my homework. 2/ Returning to your original question. Quote:
Greetings. |
||
Tags |
boundaries condition, interface bc, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
Question about adaptive timestepping | Guille1811 | CFX | 25 | November 12, 2017 18:38 |
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field | xiexing | CFX | 3 | March 29, 2017 11:00 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
inlet velocity boundary condition | murali | CFX | 5 | August 3, 2012 09:56 |