CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

OscillatingFixedValue in OpenFOAM 141dev

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2008, 18:42
Default Hi, It looks like the oscil
  #1
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 77
Rep Power: 17
mathieu is on a distinguished road
Hi,

It looks like the oscillatingFixedValue boundary condition does not work properly when it is used in the motionU file to apply a movement. See the case in attachment (moveDynamicMesh <root> <case>).



Regards,

Mathieu
mathieu is offline   Reply With Quote

Old   September 10, 2008, 03:05
Default Hi, I can't get the attachm
  #2
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
Hi,

I can't get the attachment.

Anyway, i'm using oscillatingFixedValue in motionU, and it works.

Can you detail your problem ?

Etienne.
elorriaux is offline   Reply With Quote

Old   September 10, 2008, 10:09
Default Hi, Here is a smaller case
  #3
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 77
Rep Power: 17
mathieu is on a distinguished road
Hi,

Here is a smaller case that should upload. Use fluentMeshToFoam to generate the mesh (cylindre.msh).

cylindre.tgz

It looks like that the motion of the boundary is the half of what it is supposed to be, but the rest of the mesh moves like it should. See the picture :



Mathieu
mathieu is offline   Reply With Quote

Old   September 10, 2008, 15:39
Default Hi Mathieu, take a look at
  #4
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
Hi Mathieu,

take a look at this file src/fvMotionSolver/lnInclude/oscillatingDisplacementPointPatchVectorField.C

Your boundary motion is computed in this code part.

Note that motionU is a velocity and not a displacement, and the velocity imposed is '1.0 + amplitude * sin (2 * pi * frequency * t). You'll have to rebuild your library if you don't want the '1.0'.
elorriaux is offline   Reply With Quote

Old   September 10, 2008, 15:44
Default Humm sorry, i gave you the wro
  #5
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
Humm sorry, i gave you the wrong path.

Check src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C

Etienne.
elorriaux is offline   Reply With Quote

Old   September 10, 2008, 16:39
Default Hi Etienne, Thank you for y
  #6
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 77
Rep Power: 17
mathieu is on a distinguished road
Hi Etienne,

Thank you for your reply. Did my case work correctly on your OpenFOAM installation ?

Mathieu
mathieu is offline   Reply With Quote

Old   September 11, 2008, 07:53
Default Hello Matthieu, i'm getting
  #7
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
Hello Matthieu,

i'm getting the same issue with my installation.

In fact, i think your timestep is too long. Try with smaller deltaT (ie 0.05 or 0.1). Here is an attempt with deltat=0.05 :

http://etienne.lorriaux.free.fr/OF_stuff/cylindre.avi

Etienne.
elorriaux is offline   Reply With Quote

Old   September 11, 2008, 10:22
Default Hi Etienne, I also tried a
  #8
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 77
Rep Power: 17
mathieu is on a distinguished road
Hi Etienne,

I also tried a smaller timestep (in fact, I put a big time step in my case to clearly show the problem) and as one can see on your video, there is still a "distortion" of the mesh near the boundary which becomes an important issue for meshes with fine discretization on boundary layers. On the opposite, if you try the uniformFixedValue BC (with a constant non-zero velocity) instead of oscillatingFixedValue you'll see that it works perfectly.

By the way, I don't think the timestep size is important for dynamic mesh purposes since the Laplace equation is steady state (however it might affect the computation time within each timestep). Thanks again !

Mathieu
mathieu is offline   Reply With Quote

Old   September 11, 2008, 10:46
Default I don't think the problem come
  #9
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
elorriaux is on a distinguished road
I don't think the problem comes from oscillatingFixedValue condition. The mesh solver seems to have difficulties when there are variations of velocity. It seems to work properly with constant velocity.

Etienne.
elorriaux is offline   Reply With Quote

Old   September 11, 2008, 12:24
Default Hi people, hi Etienne, It l
  #10
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 77
Rep Power: 17
mathieu is on a distinguished road
Hi people, hi Etienne,

It looks like I am very lucky...

I removed lines 313 and 314 in src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C :

// FixedValuePointPatchField
// <patchfield,>::initEvaluate();

Then, I recompile the tetDecompositionFiniteElement librairy :

cd ~/OpenFOAM/OpenFOAM-1.4.1-dev/src/tetDecompositionFiniteElement
./Allwmake

After those modifications, my case works perfectly with the oscillationgFixedValue BC in the motionU file.

However, I am not an expert with the code and it would be nice if an OpenFOAM expert could take a look at this issue.

Kind regards,

Mathieu
mathieu is offline   Reply With Quote

Old   November 12, 2008, 17:12
Default I used openfoam 1.5. The file
  #11
New Member
 
Peter Lian
Join Date: Mar 2009
Posts: 12
Rep Power: 17
peter73 is on a distinguished road
I used openfoam 1.5. The file OscillatingFi xedValuePointPatchField.C is not in the directory mentioned here but it was located at src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingF ixedValueFvPatchField.C

Implement the oscillating boundary in the files pointMotionU and cellMotionU as follows. But I get the error message like

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: velocityLaplacian


Not Implemented
Trying to construct an genericFvPatchField on patch movingWall of field cellMotionU#0 Foam::error::printStack(Foam:stream&) in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::genericFvPatchField<foam::vector<double> >::genericFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<foam::vector<double>, Foam::volMesh> const&) in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"

It seems the boundary condition is not implemented in the new version. I appreciate any suggestions.

Thanks,
Peter


boundaryField
{
movingWall
{
type oscillatingFixedValue;
refValue uniform (0 0 0);
amplitude uniform (0 2 0);
frequency 50;
curTimeIndex 0.0;
}
peter73 is offline   Reply With Quote

Old   November 12, 2008, 18:07
Default What BC have you specified for
  #12
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
What BC have you specified for the movingWall in the file pointMotionU?

H
henry is offline   Reply With Quote

Old   November 12, 2008, 19:06
Default The bc posted there is just on
  #13
New Member
 
Peter Lian
Join Date: Mar 2009
Posts: 12
Rep Power: 17
peter73 is on a distinguished road
The bc posted there is just one example. Basically, I want to oscillate one object around certain point, meanwhile, the object will move up and down.


h(t)=c*cos(omega*t)

alfa(t)=alfa_0+alfa_1*cos(omega*t+beta)

The problem is the the oscillatingFixedValue does not work with OF1.5.
peter73 is offline   Reply With Quote

Old   November 13, 2008, 04:36
Default oscillatingFixedValue is not a
  #14
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
oscillatingFixedValue is not a valid BC for pointMotionU which is a pointField not a volField. Look at the avalable BCs for pointMotionU in
OpenFOAM-1.5/src/fvMotionSolver/pointPatchFields/derived
and if none of these suit your needs you can easily roll your own based on these examples.

H
henry is offline   Reply With Quote

Old   November 13, 2008, 08:49
Default Henry, Thanks. I noticed t
  #15
New Member
 
Peter Lian
Join Date: Mar 2009
Posts: 12
Rep Power: 17
peter73 is on a distinguished road
Henry,

Thanks. I noticed that last night and I copied the oscillatingFixedValue from the
src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/

After comparing
(timeVaryingUniformFixedValue Fv PatchField.C)
( Point )
I noticed the difference between these two is one use Fv and another use Point in the .C and .H file. So I change that the oscillating**.C.

When I compile the file, I get the error message that

fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:159: error: expected initializer before ā<ā token
fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:39: error: redefinition of āFoam::scalar Foam::oscillatingFixedValuePointPatchField<type>:: currentScale() constā
fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:39: error: āFoam::scalar Foam::oscillatingFixedValuePointPatchField<type>:: currentScale() constā previously declared here

I just start to learn C++ and so I search the internet for help but still cannot find a solution yet.
peter73 is offline   Reply With Quote

Old   November 13, 2008, 18:25
Default I reduced the error to only on
  #16
New Member
 
Peter Lian
Join Date: Mar 2009
Posts: 12
Rep Power: 17
peter73 is on a distinguished road
I reduced the error to only one: refined variables. If someone wants to take a look and fixed this bug, please send me email so I will send the files to you.

y0lian05@louisville.edu

Peter
peter73 is offline   Reply With Quote

Old   January 31, 2009, 11:08
Default Hello Foamers, i have a que
  #17
New Member
 
patrick riemer
Join Date: Mar 2009
Location: Uni Stuttgart, Germany
Posts: 19
Rep Power: 17
patriem is on a distinguished road
Hello Foamers,

i have a question concerning the formula for oscillatingfixedvalue in 1.4.1-dev.

At the top posting, you said that the velocity imposed is '1.0 + amplitude * sin (2 * pi * frequency * t).

I“m not a C++ crack, but in my files it seems to be
U = amplitude * cos(2*pi*frequency*t)



I just don“t understand follwing:
If you have a simple oscillating motion, it can be described as

x=amplitude*sin(2*pi*frequency*t)

then the velocity is

v=dx/dt=amplitude*2*frequency*t*cos(2*f*t)

Where is the 2*frequency*t in OscillatingFi xedValuePointPatchField.C? Can anyone explain me the differencies between the last and the first formula?

Thank you!
patriem is offline   Reply With Quote

Old   January 31, 2009, 13:01
Default Yes, that would be my fault.
  #18
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Yes, that would be my fault. I've been playing with various forms, depending on whether you want the mean value in the oscillation to be zero or not and whether you prefer to start from zero (sin) or from extreme (cos).

I have no strong opinions on what this should be and soon we will have an intepreted formula here instead. Do you hav a preference? It would be easy to simply change your local version of the code (no consequences).

Apologies,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 31, 2009, 14:08
Default Still thinking about the frequ
  #19
New Member
 
patrick riemer
Join Date: Mar 2009
Location: Uni Stuttgart, Germany
Posts: 19
Rep Power: 17
patriem is on a distinguished road
Still thinking about the frequency.
Is that the number of oscillations per one second or the number of oscillations per given intervall (between starttime and stoptime)?

Thank you very much for answering.

I“m just getting familiar with the topic movingmesh, dynamicmesh and oscillation b.c. I also read your dissertations about the fem moving mesh solvers etc.
I want to calculate a test case and present OF to my institute (part of the University Stuttgart)
In like the oscillatingFixedValue b.c. and maybe i want to couple it with a topological layer add/removal.
But i“m just working in, so a little help is useful even if some questions may be stupid;)
patriem is offline   Reply With Quote

Old   February 3, 2009, 16:12
Default Hallo Foamers! At the momen
  #20
New Member
 
patrick riemer
Join Date: Mar 2009
Location: Uni Stuttgart, Germany
Posts: 19
Rep Power: 17
patriem is on a distinguished road
Hallo Foamers!

At the moment i use laplacefacedecomposition and a motonU file with oscillatingFixedValue b.c. to define mesh-motion. Version 1.4.1-dev. But i am not sure about the appropriate files:

src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/
Is the internal-meshpoint motion dscribed here?

src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C
Is the movement/velocity of the oscillating b. c. described here?


Thank you very much for answers, the movement of my mesh seems to be too small...
patriem 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
Piston motion with time varying experimental data oscillatingFixedValue eno OpenFOAM Running, Solving & CFD 3 March 19, 2009 11:06
Piston motion with time varying experimental data oscillatingFixedValue eno OpenFOAM Running, Solving & CFD 0 March 12, 2009 18:31
OscillatingFixedValue in OpenFOAM 141dev mathieu OpenFOAM Bugs 0 September 9, 2008 18:50
141dev svn repository egp OpenFOAM Installation 1 August 25, 2008 17:10
SonicFoam 141dev changes what do they mean mike_jaworski OpenFOAM Running, Solving & CFD 0 December 30, 2007 16:55


All times are GMT -4. The time now is 04:33.