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

How to compile a BC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 22, 2014, 17:07
Default How to compile a BC
  #1
Member
 
xxxxx
Join Date: Feb 2013
Posts: 34
Rep Power: 5
xxxx is on a distinguished road
Hello,

I'm trying to learn how to compile a BC within OF 2.1.1 . I tried to follow the instructions by openfoamwiki (http://openfoamwiki.net/index.php/Ho...dary_condition) but I'm not able to make it work.
I copied all the files in opt/openfoam211/..../finiteVolume/fvPatchFields/..../fixedValue/ in a new directory. I renamed all the files adding the "my" prefix. Within all the files I replaced all the fixedValueFvPatchField occurrences with myfixedValueFvPatchField as indicated by the guide.
I created the Make dir with Make/files file:
myfixedValueFvPatchField.C

LIB = $FOAM_USER_LIBBIN/libmyfixedValueFvPatch

and Make/options file:

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

LIB_LIBS =\
-lfiniteVolume

1st question: In openfoamwiki they say to :
  1. Search for originalFvPatchField in finiteVolume/Make/files.
  2. Copy the relevant entry (entries) into your myCode/Make/files
This is not clear to me and if I do so I get errors. That's why I put "myfixedValueFvPatchField.C" in the files file.

2nd question:
When I try wmake libso I get errors because "in myfixedValueFvPatch.C.....myfixedValueFvPatch<type > is not a type name... " (or something alike)at line 36 (you can refer to the fixedValue source code, since I didn't change it).

Can you help me with this problem please?
I will be grateful
__________________
Federico
xxxx is offline   Reply With Quote

Old   January 23, 2014, 05:55
Post
  #2
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 223
Rep Power: 10
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hint: Here's my "files" file which works,
Code:
fvPatchFields = fields/fvPatchFields
derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/myMovingWallSlip/myMovingWallSlipFvPatchVectorField.C
LIB = $(FOAM_USER_LIBBIN)/libmyFiniteVolume
and here's my "options" file,
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \

EXEC_LIBS =
consider also that my BC is using the directory structure USR-DIR/fields/fvPatchFields/... so that $(derivedFvPatchFields)/myMovingWallSlip/myMovingWallSlipFvPatchVectorField.C points to an actual file...

-Louis
louisgag is offline   Reply With Quote

Old   January 24, 2014, 17:28
Default
  #3
Member
 
xxxxx
Join Date: Feb 2013
Posts: 34
Rep Power: 5
xxxx is on a distinguished road
Thank you louisgag.

Actually I could compile the BC and solve the problem by myself.
The point is that I used as a basis for myBC the basic/fixedValue BC.
Starting from a derived BC it was simple to understand what to do and make it work.
However I still have a question: consider the src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H file.
At lines 50 and following, you can find:
template<class Type>
class fixedValueFvPatchField
:
public fvPatchField<Type>

Is it because fixedValueFvPatchField is a general type and becames a specific class only when you specify if it either refers to a scalar or a vectorial field?
__________________
Federico
xxxx is offline   Reply With Quote

Old   January 24, 2014, 19:42
Default
  #4
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 223
Rep Power: 10
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Quote:
Originally Posted by xxxx View Post
Is it because fixedValueFvPatchField is a general type and becames a specific class only when you specify if it either refers to a scalar or a vectorial field?
Yes, I'm pretty sure it is as such. It will be scalar for pressure and vector for veolcity...
louisgag is offline   Reply With Quote

Reply

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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
How to compile OpenFOAM-1.7.x on CrunchBang linux 10 gwierink OpenFOAM Installation 0 April 5, 2011 04:38
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 17:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 13:24
compile the UDF Li Jingping FLUENT 2 April 14, 2003 21:18


All times are GMT -4. The time now is 14:23.