CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Gradients on surfaces or how to find neighbour faces for face on a patch

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 7, 2007, 10:09
Default Hi there, For a face on a p
  #1
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Hi there,

For a face on a patch, I need variable values on the neighbouring faces (I want to compute a gradient on the surface).
I have spent quite some time now on it, but the only way I could figure out was to get the corresponding internal cell, cycle through its faces, get the neighbour cells for these faces, check their faces if they are external - in short, horribly messy and prone to errors.
Is there perhaps any hidden functionality which could give me that in an easier way?

Thank you!

Thomas
tehache is offline   Reply With Quote

Old   May 7, 2007, 10:19
Default It sounds like you really wish
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
It sounds like you really wish to be iterating over the boundary patches.

The quick-start would be to look at
applications/utilities/postProcessing/wall
and see if they do something similar to what you need.
olesen is offline   Reply With Quote

Old   May 7, 2007, 11:18
Default Thank you - but there is some
  #3
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Thank you - but there is some misunderstanding:

@Marc: its not just iterating - for each face (I can iterate through faces) I would like to know the faces sharing edges with this face on the surface - which reminds me right now that somewhere I have seen a function called edgesFaces .... have to search again ...

@Bernhard:
snGrad gives me the gradient normal to surface, I need the tangential one ...

I have also tried to figure out the finiteArea stuff - there is some code to compute gradients on areaMeshes - here I am stuck with that I do not know (Yet?) how to construct a faMesh. Found a constructor taking a polyMesh - but is that only my surface mesh? If so, how to make a polyMesh from my boundaryMesh?
Questions, questions, questions ....

I think you can really get lost in OpenFOAM - a lifetime occupation
tehache is offline   Reply With Quote

Old   May 7, 2007, 13:56
Default Tangential gradient can be cal
  #4
New Member
 
Zeljko Tukovic
Join Date: Mar 2009
Posts: 22
Rep Power: 8
ztukovic is on a distinguished road
Tangential gradient can be calculated using finite are calculus. See the attached application and case.






Regards,
Zeljko Tukovic
ztukovic is offline   Reply With Quote

Old   May 8, 2007, 02:30
Default Zeljko, sounds great! But t
  #5
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Zeljko, sounds great!

But the links dont work, there is just an image
tehache is offline   Reply With Quote

Old   May 8, 2007, 02:44
Default sorry, just saw your mail.
  #6
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
sorry, just saw your mail.

Works out of the box, sweet!

Thank you a lot!

Thomas
tehache is offline   Reply With Quote

Old   May 8, 2007, 04:32
Default Hello! May I also have the
  #7
New Member
 
Normunds Jekabsons
Join Date: Mar 2009
Location: Riga, Latvia
Posts: 10
Rep Power: 8
normunds is on a distinguished road
Hello!

May I also have the same example? The link in post above seems to be broken. Thank you a lot!

/Normunds
normunds is offline   Reply With Quote

Old   May 8, 2007, 07:33
Default Hi Normunds, I suppose its
  #8
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Hi Normunds,

I suppose its o.k. if I post it here again, since Zeljko tried to do that already.
So here is what he tried to post and then sent me by mail:

http://servww6.ww.uni-erlangen.de/~j...rfGradCase.tgz

http://servww6.ww.uni-erlangen.de/~j...adientFoam.tgz
tehache is offline   Reply With Quote

Old   May 8, 2007, 08:02
Default I got it. Thank you very much
  #9
New Member
 
Normunds Jekabsons
Join Date: Mar 2009
Location: Riga, Latvia
Posts: 10
Rep Power: 8
normunds is on a distinguished road
I got it. Thank you very much both, Zeljko and Thomas, with it I will save a lot of my time!

Have a nice day!

/normunds
normunds is offline   Reply With Quote

Old   May 9, 2007, 03:22
Default Zeljko, I just found out I
  #10
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Zeljko,

I just found out I apparently need the utility makeFaMesh to generate the surface mesh, however, I cant find it.
Do you have a hint perhaps?

Thanks again!

Thomas
tehache is offline   Reply With Quote

Old   May 9, 2007, 03:34
Default OpenFOAM-1.3/applications/util
  #11
New Member
 
Zeljko Tukovic
Join Date: Mar 2009
Posts: 22
Rep Power: 8
ztukovic is on a distinguished road
OpenFOAM-1.3/applications/utilities/mesh/generation/makeFaMesh

Regards
Zeljko
ztukovic is offline   Reply With Quote

Old   May 9, 2007, 03:51
Default no http://www.cfd-online.com/O
  #12
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
no
its in tutorials/finiteAreaFoam/surfactantsTransport/makeFaMesh

(at least in my OpenFOAM-1.3..)
but thanks!
tehache is offline   Reply With Quote

Old   May 9, 2007, 04:19
Default to whom it may concern: the
  #13
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
to whom it may concern:

the above mentioned makeFaMesh fails

I then downloaded from http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/release/ OpenFOAM-1.3.General_01_05_07.tgz, made a backup copy of my original finiteArea subdirectory, copied the one from the downloaded distribution there, built libfiniteArea.so again, built makeFaMesh again, and voila - got the finite area mesh.
tehache is offline   Reply With Quote

Old   May 9, 2007, 05:07
Default Zeljko, Is there perhaps an
  #14
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
Zeljko,

Is there perhaps an elegant way to transfer data from areaField (on surface mesh from a patch) to corresponding patchField (on patch from volume mesh) ?
Currently I am trying to iterate over them and to assign values, but have the strong feeling this is not OpenFOAM-Style
tehache is offline   Reply With Quote

Old   May 9, 2007, 05:42
Default May I see how you performe the
  #15
New Member
 
Zeljko Tukovic
Join Date: Mar 2009
Posts: 22
Rep Power: 8
ztukovic is on a distinguished road
May I see how you performe the transfer?

Zeljko
ztukovic is offline   Reply With Quote

Old   May 9, 2007, 06:36
Default You can do all that using the
  #16
New Member
 
Zeljko Tukovic
Join Date: Mar 2009
Posts: 22
Rep Power: 8
ztukovic is on a distinguished road
You can do all that using the following line:

TSurf.internalField() = T.boundaryField()[pathcID];

where

patchID = mesh.boundaryMesh().findPatchID("top");


If your area mesh consists of only one patch, face ordering in the area mesh is the same as in the patch.

Zeljko
ztukovic is offline   Reply With Quote

Old   May 9, 2007, 07:18
Default Hi Zeljko, Do you plan on p
  #17
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Hi Zeljko,

Do you plan on porting the finite Area code to 1.4?
Are parallel edge communications working yet?

Eugene
eugene is offline   Reply With Quote

Old   May 9, 2007, 07:35
Default alas ..... that changes everyt
  #18
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 8
tehache is on a distinguished road
alas ..... that changes everything ....
does it mean that code wont work in parallel?
tehache is offline   Reply With Quote

Old   May 9, 2007, 08:53
Default Yes, parallel edge communicati
  #19
New Member
 
Zeljko Tukovic
Join Date: Mar 2009
Posts: 22
Rep Power: 8
ztukovic is on a distinguished road
Yes, parallel edge communications don't work yet. I plane to do that till the end of this year.
ztukovic is offline   Reply With Quote

Old   June 22, 2009, 09:15
Default finiteArea compiling error
  #20
Member
 
Andrea Petronio
Join Date: Mar 2009
Location: Trieste, Italy
Posts: 38
Rep Power: 8
andrea is on a distinguished road
hi everybody,
I would like to try the finiteArea method for a film simulation, I'm working with the 1.5 release and I downloaded the 1.5-dev in order to get the finite area stuff. But when I compile the lduSolver that I think it's needed for finiteArea I get this error:

In file included from lduPrecon/CholeskyPrecon/CholeskyPrecon.C:36:
lduPrecon/CholeskyPrecon/CholeskyPrecon.H:56: error: expected class-name before { token

and this is the code line:

class CholeskyPrecon
:
public lduPreconditioner
{
// Private Data

Have you any hint?
I've tried also with folders of version 1.4-dev and 1.4.1-dev, with same results.

Thanks you in advance
andrea is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access to faces of a patch jaswi OpenFOAM Running, Solving & CFD 12 September 19, 2014 05:20
Frontal projected reference face area computation from patch kprzysowagmailcom OpenFOAM Pre-Processing 0 January 6, 2009 11:06
Intersection from ray witrh patch or face hjasak OpenFOAM Running, Solving & CFD 1 August 1, 2007 10:02
Patch face centres order shrina OpenFOAM Running, Solving & CFD 1 October 3, 2006 03:48
Reversed flow in ###faces on face ### TOM FLUENT 1 March 1, 2002 12:43


All times are GMT -4. The time now is 12:53.