CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Creating new boundary conditions from existing ones

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   February 12, 2010, 03:43
Default Creating new boundary conditions from existing ones
Join Date: Mar 2009
Location: Sydney, New South Wales, Australia
Posts: 42
Rep Power: 8
rassilon is on a distinguished road
I need to create a new boundary condition, so have been experimenting with editing and compiling an existing condition. At the moment I am just trying to change the name of a condition - nothing more - as a proof of concept of being able to edit and compile.

I have been using the following method to make a statically linked solver and boundary condition 'package'

1. Make a copy of my case folder

2. Copy my solver (interFoam) into my case folder ($OpenFOAM/apps/case/interFoam)

3. Copy the contents of the boundary condition I am trying to rename into the solver folder (timeVaryingFixedUniformFixedValue)

4. Rename the solver folder (myInterFoam)

5. In the myInterFoam folder, rename the following files:
timeVaryingFixedUniformFixedValueFvPatchField.C -> myTimeVaryingFixedUniformFixedValueFvPatchField.C
timeVaryingFixedUniformFixedValueFvPatchField.H -> myTimeVaryingFixedUniformFixedValueFvPatchField.H
timeVaryingFixedUniformFixedValueFvPatchFields.C -> myTimeVaryingFixedUniformFixedValueFvPatchFields.C
timeVaryingFixedUniformFixedValueFvPatchFields.H -> myTimeVaryingFixedUniformFixedValueFvPatchFields.H
timeVaryingFixedUniformFixedValueFvPatchFieldsFwd. H -> myTimeVaryingFixedUniformFixedValueFvPatchFieldsFw d.H

6. Edit the files using a text editor, replacing all instances of timeVaryingUniformFixedValue with myTimeVaryingUniformFixedValue

7. Add the following to the second line of the Make/files file:

8. Modify the final line so that it reads:

9. Add the following to the header of the interFoam.C file:

10. Compile using:
rm -rf Make/linux*

I have got this method to work for a simple boundary condition (totalPressure), but when I attempt to compile this more complex boundary condition, I receive numerous instances of the following error:

myTimeVaryingUniformFixedValueFvPatchField.C:38: error: redefinition of ‘Foam::myTimeVaryingUniformFixedValueFvPatchField< Type>::myTimeVaryingUniformFixedValueFvPatchField( const Foam::fvPatch&, const Foam: DimensionedField<Type, Foam::volMesh>&)’
myTimeVaryingUniformFixedValueFvPatchField.C:38: error: ‘Foam::myTimeVaryingUniformFixedValueFvPatchField< Type>::myTimeVaryingUniformFixedValueFvPatchField( const Foam::fvPatch&, const Foam: DimensionedField<Type, Foam::volMesh>&)’ previously declared here
What am I doing wrong? Is there something that I am missing when I am editing my boundary condition files by hand prior to compiling?

Any pointers would be greatly appreciated!

rassilon is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Impinging Jet Boundary Conditions Anindya Main CFD Forum 24 January 11, 2012 14:40
Problems with boundary conditions for a lowRekOmegaSST turbulence model cfdmarkus OpenFOAM Running, Solving & CFD 16 November 14, 2011 05:44
Boundary conditions for turbulent boundary layer Thomas FLUENT 1 June 17, 2008 05:14
Pressure boundary conditions Lionel S. Main CFD Forum 1 August 24, 2007 18:03
A problem about setting boundary conditions lyang Main CFD Forum 0 September 19, 1999 18:29

All times are GMT -4. The time now is 22:20.