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

New Boundary Condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2012, 07:28
Default New Boundary Condition
  #1
New Member
 
Join Date: Jun 2012
Posts: 12
Rep Power: 14
kimotbwb is on a distinguished road
Hi there!

i am new in this one and i would like to post some questions about adding a new boundary condition in OpenFOAM 2.1.x.

I have read about the boundary condition "fixedMeanValue" which one i would like to use as an alternative boundary condition for the pressure outlet in 0/p.
I refer to an older posting about this topic, which one i found here:
http://www.cfd-online.com/Forums/ope...condition.html

My problem is that i am new into developing applications for OpenFOAM, that's why i have some problems implementing the "fixedMeanValue" boundary condition.

Here are the steps that i performed:

1. download the .H and .C files for the "fixedMeanValue" bc from here:
http://openfoam-extend.svn.sourcefor...ixedMeanValue/

2. i created a new folder named "fixedMeanValue" including the downloaded .H and .C files in:
~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/fields/fvPatchFields/derived

3. i added some lines in Make (the path is: ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/Make:

3.1 .../src/finiteVolume/Make/files:

$(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C
(i added these line below the entry: $(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C)


3.2 .../src/finiteVolume/Make/files:

LIB = $(FOAM_USER_LIBBIN)/libfixedMeanValue
(i added these line at the end of the .../Make/files)


3.3 .../src/finiteVolume/Make/options:
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
-lOpenFOAM \
-ltriSurface \
-lmeshTools
-lfiniteVolume

4. i added the following line to my controlDict file:

libs ("libfixedMeanValue.so")

5. trying to recompile using following steps in ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume:

5.1 wclean
5.2 wmake libso

I am constantinously getting the error message:

"wmake error: file 'Make/linux64Gcc46DOpt/objectFiles' could not be created in ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume"


I have already tried to run ./Allwmake in ~/.../OpenFOAM-2.1.x/src
but i always receive the error message "...could not load libfixedMeanValue.so" when i run my testcase.

Maybe i have to recompile the entire OpenFOAM-folder??


Hopefully somebody could help me in this one, giving me some kind of support or maybe a detailed step by step manual.

Please help me!

sincerely
kimotbwb
kimotbwb is offline   Reply With Quote

Old   June 20, 2012, 07:53
Default
  #2
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 16
Linse is on a distinguished road
I do not know by how far that causes your problem, but have you already tried with doing these things in the folder which is dedicated to the user?
Usually there should be a directory ~OpenFOAM/username-2.1.x/run/ . I usually have a directory for my own BCs in there which works fine with the same procedure you described.
Maybe the "USER" part for the compilation goal requires the directories to be outside of the original OpenFOAM-structure and within the directory which is set for the USER by standard linking within OpenFOAM?

As I said: Just a guess, but maybe it helps...
Linse is offline   Reply With Quote

Old   February 18, 2013, 07:44
Default
  #3
Member
 
Join Date: Oct 2011
Posts: 37
Rep Power: 15
Peter Müller is on a distinguished road
you are missing some \ at the end of the included directories in your Make/options file.

You have:

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

LIB_LIBS = \
-lOpenFOAM \
-ltriSurface \
-lmeshTools
-lfiniteVolume

Should be

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

LIB_LIBS = \
-lOpenFOAM \
-ltriSurface \
-lmeshTools \
-lfiniteVolume \
Peter Müller is offline   Reply With Quote

Old   November 8, 2013, 07:57
Default
  #4
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hi all,

I have my user defined boundary conditions compiled in a directory 'myWork' in user2.2.2/run directory. I have modified a solver (buoyantFoam) and have it in my user2.2.2/applications/solvers directory. When I try and run the case with the 'new BC' I get an error similar to what

Code:
--> FOAM FATAL IO ERROR: 
Unknown patchField type newDirectionMixed for patch type patch

Valid patchField types are :

68
(
SRFFreestreamVelocity
SRFVelocity
activeBaffleVelocity
activePressureForceBaffleVelocity
advective
atmBoundaryLayerInletVelocity
calculated
codedFixedValue
codedMixed
cyclic
cyclicAMI
cyclicSlip
cylindricalInletVelocity
directionMixed
empty
externalCoupled
fixedGradient
fixedInternalValue
fixedJump
fixedJumpAMI
fixedMean
fixedNormalSlip
fixedValue
flowRateInletVelocity
fluxCorrectedVelocity
freestream
inletOutlet
kqRWallFunction
mapped
mappedField
mappedFixedInternalValue
mappedFixedPushedInternalValue
mappedFlowRate
mappedVelocityFlux
mixed
movingWallVelocity
nonuniformTransformCyclic
oscillatingFixedValue
outletInlet
outletMappedUniformInlet
partialSlip
pressureDirectedInletOutletVelocity
pressureDirectedInletVelocity
pressureInletOutletParSlipVelocity
pressureInletOutletVelocity
pressureInletUniformVelocity
pressureInletVelocity
pressureNormalInletOutletVelocity
processor
processorCyclic
rotatingPressureInletOutletVelocity
rotatingWallVelocity
sliced
slip
supersonicFreestream
surfaceNormalFixedValue
swirlFlowRateInletVelocity
symmetryPlane
timeVaryingMappedFixedValue
translatingWallVelocity
turbulentInlet
uniformFixedValue
uniformJump
uniformJumpAMI
variableHeightFlowRateInletVelocity
waveTransmissive
wedge
zeroGradient
)


file: /home/srivathsan/OpenFOAM/srivathsan-2.2.2/run/liquidBridge/0/U.boundaryField.freeSurface from line 25 to line 26.

    From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.2/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 136.
Do I need to change the Make/options folder of the buoyantFoam solver also?

I've attached the options file in my run/myWork/Make directory

Thanks,
Attached Files
File Type: txt options.txt (83 Bytes, 12 views)
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   November 8, 2013, 09:47
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
If you compiled the boundary condition into a library, you can include it in system/controlDict using libs("myLib.so") to access it from the solver.
Bernhard is offline   Reply With Quote

Old   November 8, 2013, 12:44
Default
  #6
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Dear Bernhard,

I had already included the library having this boundary condition in the controlDict file (along with "libOpenFOAM.so"). But I still get the error.
__________________
Regards,

Srivaths
Sherlock_1812 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
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 06:05
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 04:23
How exactly the "pressure outlet" bdry condition compute properties on the boundary? yating9901 FLUENT 3 June 28, 2010 13:26
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 12:44


All times are GMT -4. The time now is 06:31.