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

correctBoundaryConditions

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

Like Tree5Likes
  • 3 Post By mnajafi
  • 2 Post By joshwilliams

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2018, 20:22
Default correctBoundaryConditions
  #1
New Member
 
Mohammad Najafi
Join Date: Oct 2017
Posts: 11
Rep Power: 9
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, 21:11
Default
  #2
New Member
 
Mohammad Najafi
Join Date: Oct 2017
Posts: 11
Rep Power: 9
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, Action.Kamen and lpz456 like this.
mnajafi is offline   Reply With Quote

Old   February 20, 2022, 21:02
Default Correct boundary condition
  #3
Member
 
Anonymous.
Join Date: Sep 2020
Posts: 35
Rep Power: 6
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, 06:11
Default
  #4
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 4
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, 16:20
Default
  #5
Senior Member
 
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
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 and lpz456 like this.
joshwilliams is offline   Reply With Quote

Reply

Tags
correctboundaryconditions, geometricfield

Thread Tools Search this Thread
Search this Thread:

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



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