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

correctBoundaryConditions

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By mnajafi
  • 1 Post By joshwilliams

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2018, 19:22
Default correctBoundaryConditions
  #1
New Member
 
Mohammad Najafi
Join Date: Oct 2017
Posts: 11
Rep Power: 8
mnajafi is on a distinguished road
Hi

1.As I understand, p.correctBoundaryConditions(), updates boundary values after explicit update of p. But p is a volScalarField and it's not defined on the boundaries. So what would be the benefit of this function.

2. In the other hand when I try this I get error.
Code:
surfaceScalarField P=fvc::interpolate(p);
P.correctBoundaryConditions();
How should I make the above code work?

Thanks
mnajafi is offline   Reply With Quote

Old   May 2, 2018, 20:11
Default
  #2
New Member
 
Mohammad Najafi
Join Date: Oct 2017
Posts: 11
Rep Power: 8
mnajafi is on a distinguished road
1.I found out that it difference is revealed when I call interpolate as code below:
Code:
     forAll(p,pi)
    {
        p[pi]=1;
        i++;
    }
    
    Info<<endl<<"p beofre correct:"<<p<<endl;
    Info<<endl<<fvc::interpolate(p)<<endl;
    p.correctBoundaryConditions();
    Info<<endl<<"p after correct:"<<p<<endl;
    Info<<endl<<fvc::interpolate(p)<<endl;
2. Apparently functions that are called by correctBoundaryConditions() (like evaluate) are not defined for fvsPatchField and so this function can't be applied for a surfaceScalarField.
bany and Action.Kamen like this.
mnajafi is offline   Reply With Quote

Old   February 20, 2022, 20:02
Default Correct boundary condition
  #3
Member
 
Anonymous.
Join Date: Sep 2020
Posts: 35
Rep Power: 5
gentodin is on a distinguished road
If we cant apply correctBoundaryConditions(); on surfaceScalarField, how do we apply it to correct boundary conditions for surfaceScarlarField at every timestep due to the update of certain variables during parallel simulation?
gentodin is offline   Reply With Quote

Old   September 21, 2022, 05:11
Default
  #4
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 3
sreehahaha is on a distinguished road
Quote:
Originally Posted by gentodin View Post
If we cant apply correctBoundaryConditions(); on surfaceScalarField, how do we apply it to correct boundary conditions for surfaceScarlarField at every timestep due to the update of certain variables during parallel simulation?
Hi gentodin,

Did you find answer to your questions about correcting boundary conditions of a surfaceScalarField using correctBoundaryConditions()? Please let me know. I've been struggling with a similar issue.

Thanks,
S
sreehahaha is offline   Reply With Quote

Old   September 21, 2022, 15:20
Default
  #5
Senior Member
 
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 112
Rep Power: 5
joshwilliams is on a distinguished road
This is fundamentally wrong. In 0/p, you define the internal field and boundary values of p. The boundary values can be found by something like "p.boundaryField()[patchName]".
Quote:
Originally Posted by mnajafi View Post
But p is a volScalarField and it's not defined on the boundaries.
Hughtong likes this.
joshwilliams is offline   Reply With Quote

Reply

Tags
correctboundaryconditions, geometricfield


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



All times are GMT -4. The time now is 07:57.