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

symmetryPlane coefficients in OpenFOAM/FOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2021, 06:22
Default symmetryPlane coefficients in OpenFOAM/FOAM
  #1
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hello FOAMers!

I have been looking at the symmetry plane implementation in OpenFOAM/FOAM and am struggling to understand how the gradientInternalCoeffs were derived i.e. the matrix coefficients related to the diffusion term. In particular for vectors.

In all main forks of OpenFOAM, the symmetryPlane internal coefficients (gradientInternalCoeffs) are calculated as (in transformFvPatchField.C):
Code:
template<class Type>
tmp<Field<Type> > transformFvPatchField<Type>::gradientInternalCoeffs() const
{
    return -this->patch().deltaCoeffs()*this->snGradTransformDiag();
}
where snGradTransformDiag (in basicSymmetryPlaneFvField.C) is:
Code:
tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGradTransformDiag() const
{
    vectorField nHat = this->patch().nf();
    vectorField diag(nHat.size());

    diag.replace(vector::X, mag(nHat.component(vector::X)));
    diag.replace(vector::Y, mag(nHat.component(vector::Y)));
    diag.replace(vector::Z, mag(nHat.component(vector::Z)));

    return transformFieldMask<Type>(pow<vector, pTraits<Type>::rank>(diag));
}
Side note: the Foundation version of OpenFOAM introduce symmetry and symmetryPlane to allow for "perfectly flat" symmetry planes but the coefficients will still be the same assuming all faces on the patch have the same normal.

From this I can see that the internal coefficients for a vector field will be (when I also include gammaMagS assuming a scalar gamma):
D_{i}^{\text{FOAM}} = \frac{\gamma |\boldsymbol{S}| |\boldsymbol{n}_i|}{\boldsymbol{n} \cdot \boldsymbol{d}}  \quad\quad \text{for}\quad i=1,2,3
Which can equivalently be written as (allows easier comparison with what comes below):
D_{i}^{\text{FOAM}} = \frac{\gamma |\boldsymbol{S}| |\boldsymbol{S}_i|}{\boldsymbol{S} \cdot \boldsymbol{d}}  \quad\quad \text{for}\quad i=1,2,3

It is not clear where the mag(n_i) comes from here. Moukalled, Mangani and Darwish (http://dx.doi.org/10.1080/10407790.2016.1138748) say it should be:
D_{i}^{\text{Mouk}} = \frac{\gamma |\boldsymbol{S}_i| |\boldsymbol{S}_i|}{\boldsymbol{S} \cdot \boldsymbol{d}}  \quad\quad \text{for}\quad i=1,2,3

Notice that Foam replaced one of the mag(S_i) with mag(S) which boosts the coefficient. This does not make a difference when the symmetry plane is aligned with a Cartesian plane but they will give different convergence otherwise.

Of course if outer corrections are performed, the value of this coefficient does not directly affect the answer but just the convergence. From some quick checks, the Foam version seems to give faster convergence for vector problems but it is not clear where it came from.

Maybe somebody can comment or share related references.

Thanks!
Philip
bigphil is offline   Reply With Quote

Reply


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
2DOF Planning hull resistance study with overset CFD_fan OpenFOAM Running, Solving & CFD 7 July 13, 2021 05:03
Trying to convert a case from laminar to turbulent (K-OmegaSST) EternalSeekerX OpenFOAM Running, Solving & CFD 7 November 1, 2020 16:16
turbulent velocity inlet and negative drag coefficients Isaiah_HZ OpenFOAM Running, Solving & CFD 1 September 25, 2020 12:04
Antoine Equation coefficients for water Ludwig Prandtl CFX 2 June 27, 2017 23:24
Divergent temperature in chtMultiRegion(Simple)Foam akrasemann OpenFOAM Running, Solving & CFD 13 March 24, 2014 02:54


All times are GMT -4. The time now is 07:16.