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

wallDist error in OF-1.5.x

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2010, 11:27
Default wallDist error in OF-1.5.x
  #1
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Hi everybody,

I've experienced some problems with the wallDist function for the case shown below. It consists on two banana shaped channels (inlet at left and outlet at right) and the U-bend that connects both channels. I need to evaluate the wall distance from the patch market in black (at the left of the figure)

banana_shape.png

The wallDist function seems to return the good wall distance for the inlet channel but for the outlet channel it somehow follows what would be a fluid trajectory:

banana_wallDist.png

In order to obtain the right wall distance I've had to create a new geometry without the separation of both channels and, over it, apply the wallDist function. Afterwards, interpolate the result to the real geometry:

unifiedBanana_wallDist.png

In my case, as I needed the wall distance as a pre-processor and not during the simulation, the above mentioned solution was good enough (despite not elegant at all...).

I guess the solution is not straightforward but for those who like maths challenges... here you are!

Regards,

Elisabet
elisabet is offline   Reply With Quote

Old   August 19, 2010, 12:06
Default
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
wallDist calculates the distance to any 'wall' patches. Where are your walls?

Can you post/send the mesh?

Mattijs
mattijs is offline   Reply With Quote

Old   August 19, 2010, 12:41
Default
  #3
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Dear Matiijs,

For the pre-processor I modified the boundary file in order to have one unique wall type boundary condition: the one that I want as a reference for the wallDist function (shown in black in the first figure).

I'll send you the mesh in a private mail.


Elisabet
elisabet is offline   Reply With Quote

Old   August 20, 2010, 06:11
Default
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
The wall distance is used in turbulence models to determine the effect of the wall so the current behaviour seems to be correct - it is the shortest path through fluid to the wall - it does not 'jump' gaps. If you want to change the behaviour you'll have to change finiteVolume/fvMesh/wallDist to do the calculation yourself.
mattijs is offline   Reply With Quote

Old   August 20, 2010, 16:45
Default
  #5
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Yes, I first thought this, but when I tried to define the inlet as the 'wall' boundary and find the wall distance, wallDist function jumped the gap.

See for instance the U-shaped channel defined by blockMeshDict.txt. When the bottom is defined as the unique 'wall', the output of wallDist is: bottom_wall.png

However, when the inlet (left and bottom boundary) is the unique 'wall', the output is:
inlet_wall.png

hence, in this case, it jumps the gap!
elisabet is offline   Reply With Quote

Old   August 23, 2010, 16:14
Default
  #6
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Elisabet,

you are indeed right - it does jump the gap. The information travels on the mesh but then the distance is calculated 'as the crow flies'.

Attached an interesting hack in the form of replacements for wallDist.C, patchWave.[CH] and wallPoint*[CH]. It calculates the cumulative distance through the mesh which I think is what you want for your case. It also reads the wallDistance if it is already there so you can calculate your own as a preprocessing step.

Mattijs
Attached Files
File Type: gz wallDist.tar.gz (5.8 KB, 31 views)
mattijs is offline   Reply With Quote

Old   August 27, 2010, 16:48
Default
  #7
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Dear Mattijs,

Sorry for the delay, but I've been really busy these days....

I've saved your new files in the src directory and run Allwmake. There are some problems related with the usage of 'distSqr' in:

1. wallPointDataI.H: there are no arguments to ‘distSqr’ that depend on a template parameter, so a declaration of ‘distSqr’ must be available

2. wallPointYPlusI.H: ‘distSqr’ was not declared in this scope

3. inverseFaceDistanceDiffusivity.C: ‘const class Foam::wallPoint’ has no member named ‘distSqr’

4. patchDataWave.C: ‘const class Foam::wallPointData<Foam::Vector<double> >’ has no member named ‘distSqr’

5. wallPointDataI.H: ‘distSqr’ was not declared in this scope

Any suggestions?

Elisabet
elisabet is offline   Reply With Quote

Old   August 30, 2010, 11:59
Default
  #8
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
My fault - tested it just with a copy of a solver - they will not be drop-in replacements. Just copy your favourite solver and add the files (and add wallPoint.C, patchWave.C, wallDist.C to the Make/files).
mattijs is offline   Reply With Quote

Old   September 7, 2010, 10:56
Default
  #9
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Hi Mattijs,

I've arrived today from real holidays (those without any available PC), so probably I'm not reaaly concentrated today and I missed something.

I've saved all your files (.C and .H) in my application folder. In order to make it compile, I've changed the line 74 in wallDist.C:

old:
Code:
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
new:
Code:
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
but it still provides the wrong result when I call the function
Code:
wallDist(mesh).y()
what am I missing?

elisabet
elisabet is offline   Reply With Quote

Old   September 7, 2010, 11:20
Default
  #10
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Attached my little test program (a stripped down yPlusRas) which just calculates and writes wallDist. It compiles fine under 1.7.x, probably needs some small changes for 1.5.x.
Attached Files
File Type: gz dumpWallDist.tar.gz (6.8 KB, 25 views)
mattijs is offline   Reply With Quote

Old   September 8, 2010, 04:13
Default
  #11
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Ok, again the same results but I've realized that, based on the geometry I attached some days before:

1. If 'inlet' is the unique patch: your dumpWallDist works perfectly

2. If the 'refWall' is the unique patch: keeps giving the same result as before

so.... almost you get it!

elisabet
elisabet is offline   Reply With Quote

Old   March 27, 2017, 04:24
Default
  #12
New Member
 
Hagen
Join Date: Nov 2016
Posts: 16
Rep Power: 9
HagenC is on a distinguished road
Hi,
sorry very basic question: How do I access the wallDist value?
For the k-Omega SST model ywall is calculated, but where is it saved, how can I output these values to check their accuracy?
Thanks.
HagenC is offline   Reply With Quote

Old   March 30, 2017, 09:07
Default
  #13
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Hi Hagen,
It's quite a long time since I last used this function, I'm not sure about the possibility of calling it from controlDict file. I suggest you to look into the solvers or utilities in your OF version and look how it is called (grep wallDist -r .). Then, call it in the same way in your own utility/solver.

An alternative that I've just discovered is the use of the Test-wallDist utility (complied in applications/tests/wallDist). Once compiled, just go to your case folder, modify your fvSchemes as hereafter indicated, and run Test-wallDist. As a result, two new files will appear in your 0 folder (nWall and yWall, being the normal direction to the wall and the distance, respectively)

Quote:
wallDist
{
method meshWave;
nRequired false;
}
Good luck!

Elisabet
elisabet is offline   Reply With Quote

Old   April 27, 2017, 02:39
Default
  #14
New Member
 
Hagen
Join Date: Nov 2016
Posts: 16
Rep Power: 9
HagenC is on a distinguished road
Thank you very much!
Test-wallDist is what I was searching for.
Now I see that advection diffusion methods sometimes struggles to solve for my complex geometry. It seems like meshwave is more robust on that.
Thank you again.
HagenC is offline   Reply With Quote

Old   October 29, 2017, 09:59
Default
  #15
Member
 
Amir
Join Date: Jan 2017
Posts: 32
Rep Power: 9
albet is on a distinguished road
Hi,
Is it possible to use wallDist for only one specified wall?
since wallDist calculates the distance from all wall patches.
Thanks in advance,
Regards,
Amir
albet is offline   Reply With Quote

Old   May 21, 2020, 09:50
Default Can you use wallDist from specific wall or patch?
  #16
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 15
semaviso is on a distinguished road
Quote:
Originally Posted by albet View Post
Hi,
Is it possible to use wallDist for only one specified wall?
since wallDist calculates the distance from all wall patches.
Thanks in advance,
Regards,
Amir
Hi Foamers,

Is there anyone who knows how to use wallDist to calculate a cell's distance from a particular type "wall" boundary specified in '0'? or in a specific coordinate direction (x-axis)?

Thank you.
semaviso 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
calculating wall distance wallDist volker OpenFOAM Programming & Development 12 December 28, 2017 11:29
Help needed: building 1.5.x on Lucid sripplinger OpenFOAM Installation 3 June 10, 2010 22:01
Differences between 1.5.x and 1.5-dev carsten OpenFOAM 20 October 12, 2009 09:18
OpenFOAM 1.5.x package - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 7 July 30, 2009 03:14
OpenFoam 1.5.x installation gareth__it_power OpenFOAM Installation 5 April 1, 2009 03:27


All times are GMT -4. The time now is 15:35.