CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Problems on applying pressure outlet boundary for open source cfd code

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2017, 21:26
Default Problems on applying pressure outlet boundary for open source cfd code
  #1
New Member
 
Green
Join Date: Apr 2016
Posts: 27
Rep Power: 10
hjxy2012 is on a distinguished road
Is there anyone writing cfd codes? I wrote the pressure outlet boundary for dolfyn(an open source cfd code) but it just got divergence. The mass conservation equations could not get convergence. Is there any tricks for this problem? The theory guide is the book by Ferziger Peric--"Computational Methods for Fluid Dynamics". Thank you!
https://www.dolfyn.net/index_en.html
hjxy2012 is offline   Reply With Quote

Old   April 12, 2017, 00:05
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,283
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by hjxy2012 View Post
Is there anyone writing cfd codes? I wrote the pressure outlet boundary for dolfyn(an open source cfd code) but it just got divergence. The mass conservation equations could not get convergence. Is there any tricks for this problem? The theory guide is the book by Ferziger Peric--"Computational Methods for Fluid Dynamics". Thank you!
https://www.dolfyn.net/index_en.html

Cases with pressure outlet also can diverge in commercial code too. So if your calculation diverged on off then i am not sure what your question is.

If your question is that it diverged all the time, then makes sense.

There is nothing special in pressure-outlet condition. In fact it is preferred condition because it adds Dirichlet condition and makes linear system converge faster.

I have written iNavier in past and now writing wildkatze FVUS and pressure outlet works good. Don't have complain so far.
arjun is offline   Reply With Quote

Old   April 12, 2017, 00:59
Default
  #3
New Member
 
Green
Join Date: Apr 2016
Posts: 27
Rep Power: 10
hjxy2012 is on a distinguished road
Quote:
Originally Posted by arjun View Post
Cases with pressure outlet also can diverge in commercial code too. So if your calculation diverged on off then i am not sure what your question is.

If your question is that it diverged all the time, then makes sense.

There is nothing special in pressure-outlet condition. In fact it is preferred condition because it adds Dirichlet condition and makes linear system converge faster.

I have written iNavier in past and now writing wildkatze FVUS and pressure outlet works good. Don't have complain so far.
Thank you. I am checking my code now. And it will be better if there is some codes to refer to. The source code of iNavier can not be downloaded now. I am using Windows 10 and the exe can not execute. Would you please send me the source code of iNavier if it is proper? Thank you very much.
hjxy2012 is offline   Reply With Quote

Old   April 12, 2017, 21:35
Default
  #4
New Member
 
Green
Join Date: Apr 2016
Posts: 27
Rep Power: 10
hjxy2012 is on a distinguished road
Quote:
Originally Posted by arjun View Post
Cases with pressure outlet also can diverge in commercial code too. So if your calculation diverged on off then i am not sure what your question is.

If your question is that it diverged all the time, then makes sense.

There is nothing special in pressure-outlet condition. In fact it is preferred condition because it adds Dirichlet condition and makes linear system converge faster.

I have written iNavier in past and now writing wildkatze FVUS and pressure outlet works good. Don't have complain so far.
Oh, I found the problem. The coefficient of the pressure correction equations was wrong. It worked well after fixing it. Anyway, thank you for helping me. The pressure outlet bc was just as easy as you said.
hjxy2012 is offline   Reply With Quote

Old   April 13, 2017, 07:14
Default
  #5
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,283
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
commercial solvers also add dynamic head in case of reversed flow. This discourages reversed flow that can make solver instable. This is optional in FVUS (and in starccm), in fluent I am not sure if you can switch it off but by default it is on there.

Here is code that does in FVUS wildkatze


Code:

void
PBasedFlowModelEquation::
BoundaryConditionTerm::
addDynamicHead(
    FVFaces& fvFaces, PhaseContinuum& phase, StorageAndMemoryManager& stManBnd,
    ObjectOptions& objOptions)
{

  StorageAndMemoryManager * stMan  =  getSimulation().getStorageAndMemoryManager( phase, getFiniteVolume());

  double *ax = fvFaces.areaX() ;
  double *ay = fvFaces.areaY() ;
  double *az = fvFaces.areaZ() ;

  double *xVel    = stMan->getDoubleVar("x-velocity");
  double *yVel    = stMan->getDoubleVar("y-velocity");
  double *zVel    = stMan->getDoubleVar("z-velocity");
  double *pres    = stMan->getDoubleVar("pressure"  );
  double *density = stMan->getDoubleVar("eff-density");

  int const nfaces  = fvFaces.size      ();
  int const    *CL  = fvFaces.cellsLeft ();
  int const    *CR  = fvFaces.cellsRight();

  int    cl   = 0;
  int    cr   = 0;

  for (int f = 1; f <= nfaces; f++)
    {
      cl     =     CL[f];
      cr     =     CR[f];

      double AdotVel    =    xVel[cr] * ax[f] + yVel[cr] * ay[f] + zVel[cr] * az[f];

      if (AdotVel < 0.0)
        {
          pres[ cr ]    -=    0.5*density[ cr ]*( xVel[cr] * xVel[cr] + yVel[cr] * yVel[cr] + zVel[cr] * zVel[cr] );
        }
    }
}
arjun is offline   Reply With Quote

Reply

Tags
cfd codes, dolfyn, finite volume method, pressure boundaries

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 03:23


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