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/)
-   -   Pressure outlet boundary condition (http://www.cfd-online.com/Forums/openfoam-solving/59271-pressure-outlet-boundary-condition.html)

rolando October 23, 2007 08:42

Hi all, I“m intending to do s
 
Hi all,
I“m intending to do some turbomachinery calculations.
For that simulations I“m looking for an appropriate outlet boundary condition for the pressure. I“m looking for an alternative to the fixedValue condition.
I know something like a "mean pressure condition" for that kind of problem. Is something like that available in OpenFOAM?
Any other suggestions are welcome too.

Rolando

hjasak October 23, 2007 08:53

Yeah, I know what you mean. I
 
Yeah, I know what you mean. I have implemented fixedMeanValue a while back and it behaves much better than "simple" fixed value. You can find it in the dev-version SVN:

fixedMeanValue boundary condition

The setup is straightforward: just add

type fixedMeanValue;
meanValue 3.3;


or similar.

Enjoy,

Hrv

rolando October 23, 2007 09:07

Thanks a lot Hrvoje, it seems
 
Thanks a lot Hrvoje,
it seems to be what I am looking for.

Rolando

msrinath80 December 14, 2007 15:22

Hrv, what exactly is the advan
 
Hrv, what exactly is the advantage when we use this 'fixedMeanValue' B/C instead of a constant static pressure at the outlet?

Thanks!

hjasak December 15, 2007 11:13

The advantage of fixedMeanValu
 
The advantage of fixedMeanValue boundary condition is a much smaller flow distortion on the boundary. Basically, you get the same behaviour as the fixed pressure outlter, but the local variation next to the boundary around the prescribed mean is picked up from the cells next to it.

If you want to see the effect, try any flow with the vortices leaving the domain through a pressure boundary, a stratified flow or something similar.

I now use fixed mean pressure almost exclusively in "real life" runs.

Enjoy,

Hrv

msrinath80 December 15, 2007 16:37

Thanks Hrv. I check the differ
 
Thanks Hrv. I check the difference in my vortex shedding simulations and get back to you.

msrinath80 December 20, 2007 17:04

Hi Hrv, I added the fixedMe
 
Hi Hrv,

I added the fixedMeanValue folder from the svn repo onto my OF 1.4.1 installation and rebuilt libfiniteVolume.so. It went without any problems. However, when ever I try to use the B/C, I get this error:

--> FOAM FATAL ERROR :
gradientInternalCoeffs cannot be called for a defaultFvPatchField (actual type fixedMeanValue)
on patch poutlet of field p in file "/home/madhavan/square_cylinder/re1002d_refined_fmvbc/0/p"
You are probably trying to solve for a field with a default boundary condition.

From function defaultFvPatchField<type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/default/defaultFvPatchField.C at line 694.

FOAM exiting

Is there something else that I need to build?

hjasak December 20, 2007 17:29

You didn't rebuild it properly
 
You didn't rebuild it properly or you mis-spelled the name - the code picks up the default patch field instead.

Edit the ~/.OpenFOAM-1.4.1-dev/controlDict and set:

disallowDefaultFvPatchField 1;

If the code fails, it will give you the list of available patch fields. fixedMeanValue should be on the list and it probably isn't. For the record, you should have the following entry in Make/files:

$(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C

Also, check that the file actually compiled - touch it and try again. Then check you are picking up the right library... etc etc.

Hrv

msrinath80 December 20, 2007 17:52

Problem solved! Thanks a lot H
 
Problem solved! Thanks a lot Hrv. I added the entry in Make/files and did a wmake libso finiteVolume and all was well http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

mcjicpm2 May 11, 2009 08:57

Question
 
Hi
1-I did copy the files in this directory:
/home/sf/OpenFOAM/sf-1.5/applications/fixedMeanValue

2-then I did:

[sf@ls55cb1028 fixedMeanValue]$ wmakeFilesAndOptions
wmakeFilesAndOptions: Creating files
wmakeFilesAndOptions: Creating options

3- this happend:
wmake
SOURCE=fixedMeanValueFvPatchField.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/sf/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/sf/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/sf/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/fixedMeanValueFvPatchField.o
fixedMeanValueFvPatchField.C:42: error: redefinition of āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)ā
fixedMeanValueFvPatchField.C:42: error: āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)ā previously declared here
fixedMeanValueFvPatchField.C:57: error: redefinition of āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fixedMeanValueFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)ā
fixedMeanValueFvPatchField.C:57: error: āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fixedMeanValueFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)ā previously declared here
fixedMeanValueFvPatchField.C:71: error: redefinition of āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)ā
fixedMeanValueFvPatchField.C:71: error: āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)ā previously declared here
fixedMeanValueFvPatchField.C:96: error: redefinition of āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fixedMeanValueFvPatchField<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&)ā
fixedMeanValueFvPatchField.C:96: error: āFoam::fixedMeanValueFvPatchField<Type>::fixedMean ValueFvPatchField(const Foam::fixedMeanValueFvPatchField<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&)ā previously declared here
fixedMeanValueFvPatchField.C:111: error: redefinition of āvoid Foam::fixedMeanValueFvPatchField<Type>::autoMap(co nst Foam::fvPatchFieldMapper&)ā
fixedMeanValueFvPatchField.C:111: error: āvirtual void Foam::fixedMeanValueFvPatchField<Type>::autoMap(co nst Foam::fvPatchFieldMapper&)ā previously declared here
fixedMeanValueFvPatchField.C:123: error: redefinition of āvoid Foam::fixedMeanValueFvPatchField<Type>::rmap(const Foam::fvPatchField<Type>&, const Foam::labelList&)ā
fixedMeanValueFvPatchField.C:123: error: āvirtual void Foam::fixedMeanValueFvPatchField<Type>::rmap(const Foam::fvPatchField<Type>&, const Foam::labelList&)ā previously declared here
fixedMeanValueFvPatchField.C:131: error: redefinition of āvoid Foam::fixedMeanValueFvPatchField<Type>::updateCoef fs()ā
fixedMeanValueFvPatchField.C:131: error: āvirtual void Foam::fixedMeanValueFvPatchField<Type>::updateCoef fs()ā previously declared here
fixedMeanValueFvPatchField.C:155: error: redefinition of āvoid Foam::fixedMeanValueFvPatchField<Type>::write(Foam ::Ostream&) constā
fixedMeanValueFvPatchField.C:155: error: āvirtual void Foam::fixedMeanValueFvPatchField<Type>::write(Foam ::Ostream&) constā previously declared here
make: *** [Make/linux64GccDPOpt/fixedMeanValueFvPatchField.o] Error 1


Am I doing something wrong??

can anyone help me?

heavy_user May 20, 2010 12:06

Hi mcjicpm2,

i am getting the exact same error...just for fun I commented every definition but one...and he still brings me the error for just the ONE definition.
I am using OF 1.6. ..

Did you solve the Problem??

regards!

heavy_user May 20, 2010 13:26

Ok I just figured it out...

in files it needs to be:

Code:

fixedMeanValueFvPatchFields.C

LIB = $(FOAM_USER_LIBBIN)/libfixedMeanValue

so WITH the "s.C" at the end. The file without the s is the wrong one :rolleyes: ..

The options file needs only:

Code:

EXE_INC = \
      -I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
      -lfiniteVolume

in the control dict you need to add:

Code:

libs ( "libfixedMeanValue.so" ) ;

jml October 7, 2010 12:19

Hello,

I've seen that the boundary "fixedMeanValue" is available in OpenFOAM 1.5 (/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanValue). However when I try to use it with the next set up

------------------------------
type fixedMeanValue;
meanValue 100000;
------------------------------

the next message appear:

------------------------------
Cannot find 'value' entry on patch salida of field p in file "/... /0/p"
which is required to set the values of the generic patch field.
(Actual type fixedMeanValue)
------------------------------


Why does Openfoam demand 'value'? Is not enough with 'meanValue'?

siddharameshwara November 30, 2010 06:32

fixedMeanvalue adding code
 
hello to all,

Could you please tell me how to add the following code in the controldict file

Code:

libs ( "libfixedMeanValue.so" ) ;
[/QUOTE

Thanks

siddharameshwara November 30, 2010 10:30

how to calculate fixedMeanvalue
 
Hello to all,

Could you please tell me how to calculate the meanvalue in the below example. I am using this for outlet boundary condition for velocity.

type fixedMeanValue;
meanValue 3.3;


Thanks to all.

mohsen cheraghi March 6, 2011 07:55

Outflow boundary condition
 
Hello to all
I'm a new user of OpenFoam and I'm looking for a boundary condition like outflow B.C like Fluent. Help me please.

chegdan January 12, 2012 19:40

fixedMeanValue in 2.1.x?
 
1 Attachment(s)
Hello All,

I usually go back and forth between the ext and openCFD version of openfoam and I need to use the fixedMeanValue condition in the OpenCFD version. In earlier versions of 2.0.x I was able to compile the code provided above without any changes. However, now that my administrator has spent all this time getting 2.1.x set up on a small cluster...i cannot compile fixedMeanValue (not even on a recently updated version of 2.0.x). My errors are too long to include and are attached in a separate file.

Thoughts?

falke126 April 25, 2012 16:50

Hi to all,

i also need the fixedMeanValue bc in the regular OF version 2.1.0 ...
i“ve read that this bc was available in former versions (eg 1.5).

Is there a specific reason, why this kind of bc is“nt available any more?
Eg in cfx the average static pressure bc is very common...

chegdan April 25, 2012 17:22

Quote:

Originally Posted by falke126 (Post 357038)
Hi to all,

i also need the fixedMeanValue bc in the regular OF version 2.1.0 ...
i“ve read that this bc was available in former versions (eg 1.5).

Is there a specific reason, why this kind of bc isn't available any more?
Eg in cfx the average static pressure bc is very common...

I didn't answer my own post, but it turns out to be easy enough to compile in 2.1.x. I couldn't get it as a standalone library using wmake libso, but I just put the fixedMeanValue BC in with the other BCs in

Code:

$FOAM_SRC/finiteVolume/fields/fvPatchFields/derived
and then added the lines

Code:

$(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C
below the line

Code:

$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
in the file

Code:

$FOAM_SRC/finiteVolume/Make/files
and then an Allwmake in the $FOAM_INST_DIR to recompile everything again and grabbed a coffee. Hope this helps.

Industrial_CFD February 2, 2013 13:06

Help fixedMeanValue Outlet
 
Hi guys,

I tried to implement fixedMeanValue at the outlet, and I get the followng error:

file: /home/adam/OpenFOAM/adam-2.1.0/run/tutorials/incompressible/pimpleFoam/hvles/0/p::boundaryField::OUTLET from line 30 to line 32.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /opt/openfoam210/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 135.

FOAM exiting

Obviously even though I re-compiled after putting fixedMeanValue in the BCs it did not take.

Help?

Cheers: Adam


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