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

Patch normals patch().nf() in basicSymmetryFvPatchField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jherb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2020, 09:04
Default Patch normals patch().nf() in basicSymmetryFvPatchField
  #1
New Member
 
Saeed Salehi
Join Date: Aug 2010
Posts: 27
Rep Power: 15
salehi144 is on a distinguished road
Dear Foamers!

I am using surfaceSlipDisplacementFvPatchFields BC. It appears that it inherits from the slip BC and the slip BC inherits from the basicSymmetry. So it all comes down to the evaluate function in the basicSymmetry. This evaluate function simply eliminate the normal component to the patch by:

Code:
    tmp<vectorField> nHat = this->patch().nf();

    const Field<Type> iF(this->patchInternalField());

    Field<Type>::operator=
    (
        (iF + transform(I - 2.0*sqr(nHat), iF))/2.0
    );

    transformFvPatchField<Type>::evaluate();

It can be seen that the normal vector to the patch, patch().nf(), is first read (the red line) and then the normal component of the quantity of interest is removed.

Now, I have a case where the mesh is changing through time and OpenFOAM naturally updates the patch().nf() in each time-step. However, I specifically need to fix patch().nf(). In other words, I need to always read the patch normals, of the initial mesh (i.e., the mesh in the constant folder and not the mesh in the time folders).

Any ideas or help would be much appreciated.

Saeed

Last edited by salehi144; September 1, 2020 at 04:55.
salehi144 is offline   Reply With Quote

Old   August 28, 2020, 18:36
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
You could add a vectorField to a modified boundary class and initialize it within the constructor. But for this to be restart-enabled, you have to store this field in the write method of the boundary condition and read it if available in the constructor (the one with dict in the parameter list).
salehi144 likes this.
jherb is offline   Reply With Quote

Old   August 31, 2020, 09:24
Default
  #3
New Member
 
Saeed Salehi
Join Date: Aug 2010
Posts: 27
Rep Power: 15
salehi144 is on a distinguished road
Thank Joachim for the answer.

That seems a good idea. I will give it a try and let you know.

Saeed
salehi144 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
Plotting Surface tension force with interfoam Mahmoud_aboukhedr OpenFOAM Programming & Development 5 December 1, 2016 08:37
2D train nose profile analysis Jchan88 FLUENT 2 April 30, 2013 00:15


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