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

Access y coordinate next to a wall pach

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2022, 13:35
Default Access y coordinate next to a wall pach
  #1
New Member
 
Kermit
Join Date: Jan 2021
Location: France
Posts: 19
Rep Power: 5
tyskies is on a distinguished road
Hello everyone,

I'm having difficulties to access the y coordinate of the wall patches of my test case.
Here is the code I use:

Code:
    const fvPatchList& patches = this->mesh_.boundary();
    forAll(patches, patchi)
    {
        const fvPatch& curPatch = patches[patchi];
        if (isA<wallFvPatch>(curPatch))
        {
          forAll(curPatch, facei)
          {
              label celli = curPatch.faceCells()[facei];
              const double y = curPatch.Cf()[facei].y(); // 0.0003;
              Info << "\n\n" << y << endl;
              epsilon_[celli] = 2.0 * nu_[celli] * k_[celli] / y / y;
              // epsilon_[celli] = 2.0 * nu_[celli] * k_[celli] / mag(y) / mag(y);
           }
       }
    }

Despite the fact that no errors are detected during the compilation, the simulation crashes before it completes the first step.

I found that the simulation crashes at the line where epsilon_[celli] is evaluated and that it is because y is equal to 0...

Do you have any idea why my code isn't working?

Thanks for your support!
tyskies 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
Enhanced Wall Treatment paduchev FLUENT 24 January 8, 2018 11:55
Macros to access the laminar viscosity at wall boundary? lgning Fluent UDF and Scheme Programming 0 October 28, 2016 18:09
Node Coordinate and ID on Boundary Wall phanh STAR-CCM+ 1 September 25, 2014 08:32
Radiation interface hinca CFX 15 January 26, 2014 17:11
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 01:16


All times are GMT -4. The time now is 17:52.