CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   New Boundary Condition (http://www.cfd-online.com/Forums/openfoam-programming-development/103534-new-boundary-condition.html)

kimotbwb June 20, 2012 06:28

New Boundary Condition
 
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

Linse June 20, 2012 06:53

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...

Peter Müller February 18, 2013 06:44

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 \

Sherlock_1812 November 8, 2013 06:57

1 Attachment(s)
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,

Bernhard November 8, 2013 08:47

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.

Sherlock_1812 November 8, 2013 11:44

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.


All times are GMT -4. The time now is 10:28.