CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   Mesh problem/ coarse OK - fine not OK (http://www.cfd-online.com/Forums/openfoam-meshing/115870-mesh-problem-coarse-ok-fine-not-ok.html)

erichu April 8, 2013 14:47

Mesh problem/ coarse OK - fine not OK
 
1 Attachment(s)
Hello everyone,


I am trying to simulate maximum flow inside a tiny pipe using totalPressure = 106325 Pa boundary and fixedPressure=101325 Pa.
Dimensions of pipe is (0.004 m length and 0.003 mm diameter)

Using a very coarse netgen mesh and about 15000 iterations, a fully converged solution is obtained.
However, when refine the mesh, a solution cannot be obtained due to failure in the thermophyical- or the pressure model.

Anyone having ideas why the refined mesh cannot converge. Pictures are attached, 'fine2' is the fine mesh and 'coarse' is the coarse mesh. Coarse picture is posted separatley.

Thanks

erichu April 8, 2013 14:49

1 Attachment(s)
Coarse mesh attached

immortality April 8, 2013 15:45

hi
did you use both totalPressure and fixedValue? which is converged?both act same?

erichu April 8, 2013 16:16

Thanks for a quick answer.

I used

inlet
{
type totalPressure;
p0 uniform 106325;
value uniform 106325;
gamma 1.4;
}
outlet
{
type outletInlet;
value uniform 101325;
outletValue 101325;
}

How do I know from the output if inlet or outlet has converged?

Furthermore, it appears that the underlying problem might be k or epsilon. If I change the relaxation factors for the coarse model to a slightly higher value than 0.4, OpenFOAM returns the same problem.

JR22 April 8, 2013 19:17

In your problem you have pressure in both the inlet and the outlet?

I think pressure on both inlet and outlet is a classical CFD headache. Maybe try to follow how they do it in the T-junction tutorial (link to p setup):
https://github.com/OpenFOAM/OpenFOAM.../TJunction/0/p

I believe you have to reduce the pressure as the velocity increases using the relation ptot=p0-|U|^2/2 at the inlet. They put it in the form of a table in the p file. It is however a transient problem that uses pimpleFoam.

Ignore this, your mesh is very simple, it is unlikely that it is leaky:
Quote:

Could it be that your surface is not watertight and when you make the elements smaller, you get the errors because the mesh elements are smaller than the holes?

erichu April 9, 2013 03:44

1 Attachment(s)
@JR22

Interesting idea but I am not sure I follow you. Please explain further.


I have uploaded the system- as well the bc files in case someone has time to look through it (valid for both meshes with the result that the coarse mesh is working and the fine not working).

erichu April 9, 2013 04:22

5 Attachment(s)
I have attached the second last iteration before the solver crash on the fine mesh. The last iteration looks rouhgly the same but in the lower left corner (inlet, left side) the maximum magnitude of U, epsilon, p locally spikes to values of ~1e18, 2e25, 1e22, respectivley.

The flow direction follows Z axis


While writing this message further investigated the pictures and added a glyph filter which brings a lot of more information and maybe an explanation as well. It seems like I have vortices close to the wall/inlet. My guess is that this comes from no slip BC. Maybe a coarse mesh is very forgiving and does not allow the flow to turn backwards as there is no small cells to represent the turbulence flow.

A glyph picutre is also attached for the fine mesh.

In case this is a BC problem, can someone give further guidance of how to properly set up the BC:s for this kind of problem?

Thanks!

erichu April 10, 2013 06:30

Problem solved

Solutions:
Using a structured mesh
Choosing second order upwind
Fine tuning k e initial values
Fine tuning relaxation parameters during running solver.

I found an old post yesterday pointing out that k-e is very hard to get working. A more stable way is to use RNG /realizable or omegaSST.

JR22 April 10, 2013 06:49

Can you post what your fvSchemes looks like when you start your run? Thanks

erichu April 10, 2013 07:23

Quote:

Originally Posted by JR22 (Post 419594)
Can you post what your fvSchemes looks like when you start your run? Thanks


snGradSchemes default corrected
interpolationSchemes default linear
laplacianSchemes Gauss linear corrected
divSchemes
div(phi,U) bounded Gauss upwind --> switch to Gauss linearUpwind phi after some it
div((muEff*dev2(T(grad(U)))) Gauss linear
others div(phi, XXX) bounded Gauss cubic
gradSchemes default linear
ddtSchemes default steadyState

immortality April 10, 2013 12:29

Quote:

Originally Posted by JR22 (Post 419239)
In your problem you have pressure in both the inlet and the outlet?

I think pressure on both inlet and outlet is a classical CFD headache. Maybe try to follow how they do it in the T-junction tutorial (link to p setup):
https://github.com/OpenFOAM/OpenFOAM.../TJunction/0/p

I believe you have to reduce the pressure as the velocity increases using the relation ptot=p0-|U|^2/2 at the inlet. They put it in the form of a table in the p file. It is however a transient problem that uses pimpleFoam.

Ignore this, your mesh is very simple, it is unlikely that it is leaky:

dear Rose whats the reason of putting a table for p in total pressure at inlet?
I have an issue on this problem.the pressure goes very low and velocity goes very high.
whats the reason? when i limit U on the ptch to 350m/s the neighbour cells act as i told above again.
why table is inverse from low value to high value for p?


All times are GMT -4. The time now is 15:18.