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

Something strange with p_rgh Boundary Condtion setup for OF2.3x and up!!!!

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vatavuk
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 29, 2015, 09:54
Default Something strange with p_rgh Boundary Condtion setup for OF2.3x and up!!!!
  #1
Member
 
Mahmoud Aboukhedr
Join Date: Feb 2014
Location: London
Posts: 40
Rep Power: 12
Mahmoud_aboukhedr is on a distinguished road
Hello All friends,

As you know with new updates for OF versions not everything work smoothly.

I'm working constantly with interfoam and lots of updates in micro flow applications. Anyway All my updates in the code and test case set-up was done in 2.2x ...

Recently I updated all my codes and test cases to 2.3x, but I kept the old BC files for the test cases as following

p_rgh
Code:
   inlet_liquid
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    inlet_gas
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    wall_1
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
U
Code:
inlet_liquid
    {
        type            fixedValue;
        value           uniform (0.106 0 0);
    }

    inlet_gas
    {
        type            fixedValue;
        value           uniform (0 0 -0.344);
    }

    outlet
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    wall_1
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
For OF22x The BC works fine and everything is good,
But for OF23x it gives me error
Code:
updateCoeffs(const scalarField& snGradp) MUST be called before updateCoeffs() or evaluate() to set the boundary gradient.

From function fixedFluxPressureFvPatchScalarField::updateCoeffs( )
in file fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C at line 151.
So did anyone had the same problem with the new versions,
maybe its a very easy problem, that I need to change something with the schemes

Any help from the expatriates will be great

Mahmoud
Mahmoud_aboukhedr is offline   Reply With Quote

Old   December 30, 2015, 10:31
Default
  #2
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 200
Rep Power: 18
vatavuk is on a distinguished road
Hi Mahmoud,
Recently I adapted the spillway tutorial (https://www.hpc.ntnu.no/display/hpc/OpenFOAM+-+Spillway+Tutorial), to version 2.3. I noticed that in 2.3 the boundary condition for p_rgh at inlet, outled and walls was replaced by zeroGradient as is done in the weirOveflow tutorial.
Another problem that I noticed is that it is very difficult to get convergence using the fixed value condition for U, at the water inlet, I had to replace it with the variableHeightFlowRateInletVelocity. I suppose something similar may happen in your case.
Best Regards,
Paulo
Mahmoud_aboukhedr likes this.
vatavuk is offline   Reply With Quote

Old   January 1, 2016, 15:02
Default
  #3
Member
 
Mahmoud Aboukhedr
Join Date: Feb 2014
Location: London
Posts: 40
Rep Power: 12
Mahmoud_aboukhedr is on a distinguished road
Dear Paulo,

Thanks for the update,
I think the fixedFluxPressure tretment method had ben changed from 2.2x to 2.3x .. am still not sure how to fix it to be honest .
Mahmoud_aboukhedr is offline   Reply With Quote

Old   January 1, 2016, 15:30
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

pimpleFoam has the following change in 2.3.x: https://github.com/OpenFOAM/OpenFOAM...46e787db50c95a

The code for "interFoam/pEqn.H" also has the following:
Code:
    // Update the fixedFluxPressure BCs to ensure flux consistency
    setSnGrad<fixedFluxPressureFvPatchScalarField>
    (
        p_rgh.boundaryField(),
        (
            phiHbyA.boundaryField()
          - fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
        )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
    );
The reason is in this commit on the OpenFOAM-history repository: https://github.com/OpenCFD/OpenFOAM-...78c39cb40e82c6
And I quote:
Quote:
fixedFluxPressure BC: the snGrad is now pushed into the BC from pEqn.H rather than being evaluated in the BC
This explains the issue. As for the solution:
  1. I suggest you study the OpenFOAM tutorials and this commit in particular for details.
  2. Or if you cannot figure out the solution, I need an example case to study .
Best regards,
Bruno
Mahmoud_aboukhedr likes this.
__________________
wyldckat is offline   Reply With Quote

Old   January 9, 2017, 08:31
Default
  #5
New Member
 
vijay chauhan
Join Date: Dec 2016
Posts: 2
Rep Power: 0
vijaychauhan is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

pimpleFoam has the following change in 2.3.x: https://github.com/OpenFOAM/OpenFOAM...46e787db50c95a

The code for "interFoam/pEqn.H" also has the following:
Code:
    // Update the fixedFluxPressure BCs to ensure flux consistency
    setSnGrad<fixedFluxPressureFvPatchScalarField>
    (
        p_rgh.boundaryField(),
        (
            phiHbyA.boundaryField()
          - fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
        )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
    );
The reason is in this commit on the OpenFOAM-history repository: https://github.com/OpenCFD/OpenFOAM-...78c39cb40e82c6
And I quote:
This explains the issue. As for the solution:
  1. I suggest you study the OpenFOAM tutorials and this commit in particular for details.
  2. Or if you cannot figure out the solution, I need an example case to study .
Best regards,
Bruno
Dear All,
I hope I can help a bit. I found a similar problem running lagrangian sprayFoam solver which I have modified little bit. What I observed was that, as mentioned by Bruno, setSnGrad<fixedFluxPressureFvPatchScalarField> is missing in some solver pEqn.H. I simply copied it from other solver pEqn.H where it exists and carefully changes variable names according to your solver. It runs well for me. Then wmake. Also dont forget to #include "fixedFluxPressureFvPatchScalarField.H" in solver file. Hope it works.
vijaychauhan 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



All times are GMT -4. The time now is 21:01.