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

Appropriate boundary conditions for top atmosphere

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By sturgeon
  • 1 Post By nandhakumar
  • 1 Post By nandhakumar
  • 1 Post By nandhakumar
  • 1 Post By sturgeon

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2017, 09:58
Default Appropriate boundary conditions for top atmosphere
  #1
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
I'm using buoyantSimpleFoam for a simple 2D case where the left hand side is a velocity inlet, bottom is a solid surface with slip condition, and the top and right hand side should be open to the atmosphere. Turbulence is disabled.

I'm trying to figure out the appropriate boundary conditions for the top. From looking at tutorials and online, the best I've managed is pressureInletOutletVelocity for U and totalPressure for p_rgh. However, I am getting floating point errors almost immediately unless I massively relax all the variables, where I get a strange solution like this:



So alternating rows of flow exiting and entering the domain at rather large velocities. Here's my case files:

p_rgh

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
	    location    "0";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 101325;

boundaryField
{

	
    inlet
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        value           uniform 101325;
    }
	    roof
    {	
        type            totalPressure;
        p0              uniform 101325;
    }
	

outlet
{
        type            totalPressure;
        p0              uniform 101325;
}

    coldWalls
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        value           uniform 101325;
    }
	
	 hotWalls
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        value           uniform 101325;
    }
	
	    frontAndBack
    {
        type            empty;
    }
	
	
	
}

// ************************************************************************* //
U

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1612+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (5 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
		value $internalField;
    }
	
	    roof
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
	
    outlet
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    coldWalls
    {
        type            slip;
    }
    hotWalls
    {
        type            slip;
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
(ignore the hotWalls and coldWalls - it is just one single surface of homogeneous boundary conditions for now - this is a case I've massively simplified trying to source errors in a more complicated case)

Should the value for the pressureInletOutletVelocity be (0 0 0), or (5 0 0) to match the internal field/velocity BC? I have tried both with no success. Can anyone see where I'm going wrong or recommend better BC for the top atmosphere? Everything I've tried so far has led to massive flux across the top that spirals into floating point errors.

Thanks. Can upload entire case if it seems useful in diagnosis.

EDIT: By massively relaxing for a few thousands iterations then gradually bringing the relaxation back to standard values, I get a simulation that doesn't explode. But it never converges, and the fluctuations of positive and negative vertical velocities continue throughout the domain. Considering that the scenario being modeled is so simple I feel like there is definitely still something wrong with my conditions. Maybe this will help point to the issue?
raj kumar saini likes this.

Last edited by sturgeon; September 28, 2017 at 13:35.
sturgeon is offline   Reply With Quote

Old   October 2, 2017, 11:57
Default
  #2
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
Sorry to bump but I still can't figure out what's going wrong, trying variations on fixedValue, totalPressure and fixedFluxPressure, can't get anything to solve.

I thought using pressureInletOutletVelocity or inletOutlet would prevent backflow, but I'm clearly getting it regardless. Can anyone give me advice? Cheers
sturgeon is offline   Reply With Quote

Old   October 3, 2017, 00:10
Default
  #3
New Member
 
CFDfreak
Join Date: Dec 2016
Posts: 15
Rep Power: 9
nandhakumar is on a distinguished road
Try to use symmetry boundary condition for this case and also make sure that u have enough width to avoid variation of properties across top boundary. Actually I have solved a case recently. I think that might help.


kindly solve and update the case.

Thank you.
sturgeon likes this.
nandhakumar is offline   Reply With Quote

Old   October 3, 2017, 07:48
Default
  #4
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
Thank you for your response. Unfortunately, I tried applying symmetry to the roof and the simulation still explodes after a few hundred iterations, even with extreme relaxation. Now the velocities are reasonable and there is no backflow from the roof, but my pressure approaches extreme values and I am getting negative densities.

Why is using symmetry appropriate for a case like this? How does damBreak use the same boundary conditions for the atmosphere as my case but avoids the backflow? I have compared my case versus damBreak and I can't see any differences that would allow it to solve properly but mine to explode.
sturgeon is offline   Reply With Quote

Old   October 3, 2017, 08:40
Default
  #5
New Member
 
CFDfreak
Join Date: Dec 2016
Posts: 15
Rep Power: 9
nandhakumar is on a distinguished road
can you upload your case file. Also why are you using slip condition for the wall? why buoyantSimple solver has been selected.

Thank you
sturgeon likes this.
nandhakumar is offline   Reply With Quote

Old   October 3, 2017, 08:50
Default
  #6
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
Thanks for the response. Just looking for somewhere to upload the case file just now.

The reason I am using buoyantSimpleFoam is because I am trying to model heat driven convection. This isn't modeled in the current case, since I have been trying to simplify everything to locate my error in the more complex case. I am using slip on walls because I am not interested in any drag/turbulence from the solid surface. (I am trying to match an analytic solution which does not consider these.) Are either of these wrong for what I am trying to achieve?
sturgeon is offline   Reply With Quote

Old   October 3, 2017, 08:56
Default
  #7
New Member
 
CFDfreak
Join Date: Dec 2016
Posts: 15
Rep Power: 9
nandhakumar is on a distinguished road
symmetry boundary condition I used to specify when there is no gradient perpendicular to its face. Its a simple boundary condition for free stream. Reverse flow and back flow always affect your solution and convergence.Always its better to model your domain to avoid back/reverse flow.
You can try changing your boundary conditions initially go with simple boundary condition like fixedValue and zeroGradient.
Try changing your divergence schemes to lower order like guass upwind it is the most stable one.
Then you need to play with under relaxation factors.

If any of the doesnt work. Then try modelling different geometry.


thank you
sturgeon likes this.

Last edited by nandhakumar; October 4, 2017 at 02:39.
nandhakumar is offline   Reply With Quote

Old   October 3, 2017, 09:07
Default
  #8
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
Thank you for your advice. I will investigate the different schemes and revising boundary conditions

EDIT: In case anyone finds this thread having similar issues, in addition to nandhakumar's advice, I followed the suggestion in this thread: strange pressure behaviour with symmetricPlane boudary condition - interFoam

I increased the OrthogonalCorrectors and it seemed to solve my issues at the outlet, where the symmetryPlane intersects with the pressure outlet. I was getting weird flow in that corner, and the fluctuations propagated throughout the domain, but having the OrthogonalCorrectors set to ~8 seemed to fix it.
nandhakumar likes this.
sturgeon 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
Wrong multiphase flow at rotating interface Sanyo CFX 14 February 7, 2017 17:19
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 11:14
Waterwheel shaped turbine inside a pipe simulation problem mshahed91 CFX 3 January 10, 2015 11:19
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Need help with boundary conditions: open to atmosphere Wolle OpenFOAM 2 April 11, 2011 07:32


All times are GMT -4. The time now is 12:24.