|
[Sponsors] |
Access to field which is evaluated at the moment |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
Hey everybody,
after a lot of suggestions from Philip Cardiff, I implement non-orthogonal corrections to the symmetry patches. In foam-extend it is straight forward and it is already implemented. However in FOAM-4.x it was not as straight forward than in extend or maybe I did it in an complex way. However, I build my own solidSymmetric boundary condition. Based on the fact that the class is a template one, I have to make some checks:
Code:
template<class Type> Foam::tmp<Foam::Field<Type>> Foam::solidSymmetryFvPatchField<Type>::snGrad() const { const vectorField nHat(this->patch().nf()); Field<Type> iF(this->patchInternalField()); //- Non-orthogonal correctors if ("Displacement field") { vectorField delta(this->patch().delta()); vectorField k = delta - nHat * (nHat & delta); const fvPatchTensorField& gradD = this->patch().template lookupPatchField<volTensorField, tensor> ( "grad(D)" ); //- Correct iF iF ... } return (transform(I - 2.0*sqr(nHat), iF) - iF) *(this->patch().deltaCoeffs()/2.0); } Any feedback would be warmly welcomed and I hope I pointed out what I want to do.
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
Okay solved in an easy way. I added a boolean for switching on and off the nonOrthoCorrection in the boundary of each field (default = false). So the solution is:
Code:
//- Non-orthogonal correctors if (nonOrthoCorrection_) { vectorField delta(this->patch().delta()); vectorField k = delta - nHat * (nHat & delta); const fvPatchTensorField& gradD = this->patch().template lookupPatchField<volTensorField, tensor> ( "gradD" ); const vectorField corrector = (k & gradD.patchInternalField()); //- PROBLEM iF += corrector; } Good night.
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
Hey all,
solved in the way that I derived a new class without using a template. Finally, now it is like in foam-extend but you have to take a bit more care (things are not 100% similar, as we would expect). Everything is working now ![]()
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 ![]() |
Have you done any tests to check for the influence of this correction at the boundary?
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 ![]() |
So, are there any relevant differences or is this a minor effect? I'm wondering if it's important to consider this when nonorthogonal meshes with symmetries are used.
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
To keep everything clear. I consider only solid stress calculation. And yes it accelerates the convergence. In fluid dynamics I would say, that you can not see the difference but I did not checked that.
Sent from my HTC One mini using CFD Online Forum mobile app
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem | cico0815 | OpenFOAM Community Contributions | 36 | February 3, 2022 12:54 |
Access field from different region in chtMultiRegionFoam | JoeFriend | OpenFOAM Programming & Development | 0 | March 21, 2017 11:35 |
How to access the field of weighting factor of interpolations | fumiya | OpenFOAM | 2 | November 16, 2012 08:33 |
Access to field data | sepp | OpenFOAM | 2 | February 10, 2011 12:45 |