CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   groovyBC oscilating pipe flow problems (http://www.cfd-online.com/Forums/openfoam-solving/112195-groovybc-oscilating-pipe-flow-problems.html)

duncan21187 January 23, 2013 14:49

groovyBC oscilating pipe flow problems
 
1 Attachment(s)
Hi All

I am trying to use the groovyBC utility to model oscillating pipe flow but am having trouble. OpenFOAM does not appear to be solving for the velocities according to the equation I have set up in the 0/'U' directory, and as such is taking a '0' value for all times other than time t=0. I was wondering if anyone could help suggest why the code is not processing the equation for all timesteps? The 'U' file is attached.

Many thanks

Duncan

gschaider January 23, 2013 15:28

Quote:

Originally Posted by duncan21187 (Post 403612)
The 'U' file is attached.

May first impression was "a word file? Really?". Then found out that it is a plain ol' text file. I think uploading files with .txt is possible and would be more appropriate.

Quote:

Originally Posted by duncan21187 (Post 403612)
I am trying to use the groovyBC utility to model oscillating pipe flow but am having trouble. OpenFOAM does not appear to be solving for the velocities according to the equation I have set up in the 0/'U' directory, and as such is taking a '0' value for all times other than time t=0. I was wondering if anyone could help suggest why the code is not processing the equation for all timesteps?

What do you mean with "does not solve"? The boundary conditions do not get the anticipated values or the rest of the fluid.

To make sure that the BCs are correct you can use the replayTransientBC-utility that comes with swak4Foam: it loads field files and then steps through simulation time but only updates the boundary conditions (because of that it is MUCH faster ... several orders of magnitude usually ... than running the real simulation). If the boundary conditions for U give the values you expect (you can for instance check that in paraview) I refuse all responsibility and blame the solver

immortality January 23, 2013 16:40

I used replayTransientBC as you said before to me.now at paraview is observed only initial condition with blue color and nothing change when time is going ahead.how can i see boundary values?

gschaider January 23, 2013 17:19

Quote:

Originally Posted by immortality (Post 403631)
I used replayTransientBC as you said before to me.now at paraview is observed only initial condition with blue color and nothing change when time is going ahead.how can i see boundary values?

OK. I assume that you visualized the patch and not the internal field in paraview.

Anyway. I assume that your problem is with testpipe_inlet BC:

Code:

        variables (
 //        "yp=pts().y;"
 //        "minY=min(yp);"
//          "maxY=max(yp);"
 //        "para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"
//      "para=5.0*vector(1,0,0);"
      )
       
        valueExpression  "20+(10*sin(0.5*time()))*normal()";

When looking at it the first thing that occurred to me that in the valueExpression you try to add a scalar ("20") to a vector ("scalar*normal()") and no syntax error occurs. So it seems that valueExpression is not evaluated because it was not found (and therefor replaced with an expression equivalent to 0). The reason seems to be that the variables entry above is not terminated by a ; (in that case valueExpression is treated by the OpenFOAM-dictionary-parser as a part of variables .... and discarded)

duncan21187 January 24, 2013 12:39

Hi Bernhard

Firstly apologies for my lazy choice of format!! When finding I could not submit the file as a .C file, I just converted it to the first option on the list.

Thank you very much for your advice and pointing out my writing error, I have fixed this now and the code runs fine :) .

immortality January 24, 2013 13:29

i selected all patches and in display seleted wireframe.is it true?then how can i see fields on a speciefic patch like that was in internalfield case?

gschaider January 24, 2013 14:05

Quote:

Originally Posted by immortality (Post 403840)
i selected all patches and in display seleted wireframe.is it true?then how can i see fields on a speciefic patch like that was in internalfield case?

If you also loaded the internalField then "split off" the patch with the "Extract Block"-filter and just display it as "Surface". The values you see are the values on the patch. If you didn't load the internalField then the filter is not necessary

immortality January 27, 2013 04:36

since my patch is 2D with small depth,patches are so hard to see by themselves.how to correct this situation?

gschaider January 27, 2013 06:21

Quote:

Originally Posted by immortality (Post 404279)
since my patch is 2D with small depth,patches are so hard to see by themselves.how to correct this situation?

"Hard to see" you mean "Hard To see in paraview"?

Two things might help you there:
- "Zoom to Data"-Button in the "Display" panel of the filter
- further down in that panel with a "Scale"-entry you can enlarge the patch in the "thin" direction

But that is hardly OF-specific (not to speak of groovyBC)


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