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

Creating new boundary conditions from existing ones

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2010, 03:43
Default Creating new boundary conditions from existing ones
  #1
Member
 
Join Date: Mar 2009
Location: Sydney, New South Wales, Australia
Posts: 42
Rep Power: 17
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:
myTimeVaryingFixedUniformFixedValueFvPatchField.C
timeVaryingFixedUniformFixedValueFvPatchFields.C

8. Modify the final line so that it reads:
EXE = $(FOAM_USER_APPBIN)/myInterFoam

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

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

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:

Quote:
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!


R
rassilon is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Impinging Jet Boundary Conditions Anindya Main CFD Forum 25 February 27, 2016 13:58
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 06:14
Pressure boundary conditions Lionel S. Main CFD Forum 1 August 24, 2007 19:03
A problem about setting boundary conditions lyang Main CFD Forum 0 September 19, 1999 19:29


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