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

Understanding about updateCoeffs() in solidDisplacementFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By wyldckat
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 30, 2014, 07:11
Default Understanding about updateCoeffs() in solidDisplacementFoam
  #1
Member
 
Anil Kunwar
Join Date: Jun 2013
Posts: 64
Rep Power: 12
Annier is an unknown quantity at this point
Hi,
In solidDisplacementFoam solver,at tractionDisplacementFvPatchVectorField.C, there is a following piece of code for updateCoeffs().
Code:
void tractionDisplacementFvPatchVectorField::updateCoeffs()
{
...
gradient() =
    (
        (traction_ - pressure_*n)/rho
      + twoMuLambda*fvPatchField<vector>::snGrad() - (n & sigmaD)
    )/twoMuLambda;
...
fixedGradientFvPatchVectorField::updateCoeffs();
}
Whereas, in stressedFoam solver, at tractionDisplacementFvPatchVectorField.C;the corresponding code is:
Code:
void tractionDisplacementFvPatchVectorField::updateCoeffs()
{
...
gradient() =
    (
        (traction_ - pressure_*n)/rho.value()
      - (n & (mu.value()*gradU.T() - (mu + lambda).value()*gradU))
      - n*tr(gradU)*lambda.value()
    )/(2.0*mu + lambda).value();

fixedGradientFvPatchVectorField::updateCoeffs();
}
1. What does the value() assign to mu in mu.value()?
2. Similarly, the meaning of gradU.T().
3. Do they convert a scalar to a matrix of given size?
4. Is there a layman way to understand the process of coefficients being updated?


Yours
Anil Kunwar
Annier is offline   Reply With Quote

Old   December 30, 2014, 08:31
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Anil Kunwar,

I'll only be able to answer a few of your questions:
Quote:
Originally Posted by Annier View Post
1. What does the value() assign to mu in mu.value()?
"mu" is a dimensioned scalar, the method "value()" gets access to only the value itself. Otherwise, the operations would try to do the necessary mathematics including units.

Quote:
Originally Posted by Annier View Post
2. Similarly, the meaning of gradU.T().
"T()" - Transposes the vector/matrix. For more details: http://openfoamwiki.net/index.php/Op...s_Guide_Errata

Quote:
Originally Posted by Annier View Post
3. Do they convert a scalar to a matrix of given size?
Uhm... the calculations are automatically made by taking into account all values in the patch or field, depending on the context. This is why there isn't a "for" loop in that code that goes along all faces of a patch or all the cells of a mesh.

Quote:
Originally Posted by Annier View Post
4. Is there a layman way to understand the process of coefficients being updated?
You'll have to be more specific to which coefficients you're referring to.

Best regards,
Bruno
Annier likes this.
wyldckat is offline   Reply With Quote

Old   December 30, 2014, 10:38
Default
  #3
Member
 
Anil Kunwar
Join Date: Jun 2013
Posts: 64
Rep Power: 12
Annier is an unknown quantity at this point
Hi Bruno,
Thank you very much for making me understand more about OpenFOAM code structure.
I studied about updateCoeffs() in this thread http://www.cfd-online.com/Forums/ope...m-solvers.html
Some of my understandings are:
  • The updateCoeffs() ,is defined at the boundary for updating the coefficients as per the gradient specified in the BC file.
  • The updateCoeffs() is first defined virtually at the GeometricBoundaryField.C and overloaded (redefined) later in the specific derived classes such as fixedGradientFvPatchVectorField.C.
  • Another function evaluate(), are also defined at the Boundaries.
  • These functions are virtual functions of C++.
  • They are important functions associated with the boundary conditions subroutines.

Still, there are many things I need to know further, in order to conceptualize how the coefficients are updated [updateCoeffs()] and evaluated [evaluate()] at the boundaries.
Where is the source location of fixedGradientFvPatchVectorField.C?
Thank you.

Yours
Anil Kunwar

Last edited by Annier; December 30, 2014 at 12:02. Reason: rectified the link
Annier is offline   Reply With Quote

Old   December 30, 2014, 11:55
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer:
  • You can search in the source code online here: https://github.com/OpenFOAM/OpenFOAM-2.3.x
  • You can search in the online code documentation: http://www.openfoam.com/docs/cpp/
  • You can search in the source code you are currently using, as explained here: http://openfoamwiki.net/index.php/In...with_the_Shell
    Quote:
    • Finding all dictionary files that end with "Dict" in the tutorials folder:
      Code:
      find $FOAM_TUTORIALS -name "*Dict"
    • Finding all dictionary files that end with "Dict" in the applications folder:
      Code:
      find $FOAM_APP -name "*Dict"
    • Finding which tutorial files use the boundary condition "slip":
      Code:
      find $FOAM_TUTORIALS -type f | xargs grep -sl 'slip'
    • Find where the code for the boundary condition "slip" is located:
      Code:
      find $FOAM_SRC -name "*slip*"
fumiya and Annier like this.
wyldckat is offline   Reply With Quote

Old   January 1, 2015, 07:23
Default
  #5
Member
 
Anil Kunwar
Join Date: Jun 2013
Posts: 64
Rep Power: 12
Annier is an unknown quantity at this point
Hi Bruno,

Thank you very much. I will try to learn the things.




Yours
Anil Kunwar

Last edited by Annier; January 1, 2015 at 10:56.
Annier 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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
Purposes of updateCoeffs, initEvaluate and evaluate....? philippose OpenFOAM Programming & Development 9 September 29, 2020 06:09
updateCoeffs() and evaluate() lixx OpenFOAM Programming & Development 11 August 12, 2020 16:41
Coupling of OpenFOAM solvers Annier OpenFOAM Running, Solving & CFD 1 January 5, 2015 11:50
TimeVaryingMappedFixedValue for Direct Numerical Simulation inlet johndeas OpenFOAM 5 May 21, 2014 08:11


All times are GMT -4. The time now is 05:42.