CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

New boundary condition and %23ifdef NoRepository

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 13, 2007, 05:58
Default Hello everybody, I am once
  #1
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 7
tehache is on a distinguished road
Hello everybody,

I am once again trying to implement a new boundary condition. To have a starting point, I simply copied the uniformFixedValueFvPatchField to a new subdirectory and just changed names to something different (uniform to linear ...).
Now, when compiling, something throws in a definition of NoRepository, which makes the header file include the source, resulting in duplicate definitions of everything I define in the source file. If I comment out the inclusion of the source file, it compiles fine, but when running a testcase with such a BC, I get this:

--> FOAM FATAL ERROR : gradientInternalCoeffs cannot be called for a defaultFvPatchField.
(Actual type linearFixedValue)
You are probably trying to solve for a field with a default boundary conditions.

Is this related to commenting out the inclusion of the source file?

Or what is the meaning of this NoRepository definition?

Thank you very much for any hint!
tehache is offline   Reply With Quote

Old   February 13, 2007, 06:05
Default Heya, The message means you
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,748
Rep Power: 20
hjasak will become famous soon enough
Heya,

The message means you are not picking up your boundary condition correctly - you are getting the "default" instead.

I have written a long message on compiling and liking boundary conditions earlier today so please have a look there for details.

Regarding the NoRepository stuff, you don't need to worry about it: it is to do with template instantiation mechanisms in C++.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 13, 2007, 06:05
Default just found out ... sorry for s
  #3
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 100
Rep Power: 7
tehache is on a distinguished road
just found out ... sorry for spamming

I had to include the linearFixedValueFvPatchFields.C,
not the linearFixedValueFvPatchField.C,
into finiteVolume/Make/files ...
tehache is offline   Reply With Quote

Old   May 23, 2007, 02:19
Default Hello All, I am trying to c
  #4
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 7
coops is on a distinguished road
Hello All,

I am trying to create a boundary condition that sets the pressure gradient to a certain value based on the fields.

I only want this to work in the vertical (z) direction. I wish to set the pressure gradient (dp/dz) = -rho * g.

I am able to create and compile this condition and I think that it is working (in as much as it seems to write out the correct number of values at each times step and these values change) but I have a few problems:

1. When I go to preprocess the case, setting the required pressure fields etc. I am not able to supply a gradient in the /0/ directory. It wants a value.

2. I am able to run (solve) the case and all seems to be fine but when I with too look at the results with paraFoam I receive the following:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

--> FOAM Warning :
From function dictionary::read(Istream&, const word&)
in file db/dictionary/dictionaryIO.C at line 92
Reading "././1/p" at line 404047
could not add entry
gradient nonuniform List<scalar> 2000{0.000108516};
on line 404047 of dictionary "././1/p"
entry already in dictionary :
ITstream : ././1/p::gradient, line 400038, IOstream: Version 2.0, format ASCII, line 400038, OPENED, GOOD

--> FOAM Warning :
From function dictionary::read(Istream&, const word&)
in file db/dictionary/dictionaryIO.C at line 92
Reading "././1/p" at line 408061
could not add entry
gradient nonuniform List<scalar> 2000{2.30764e-05};
on line 408061 of dictionary "././1/p"
entry already in dictionary :
ITstream : ././1/p::gradient, line 404052, IOstream: Version 2.0, format ASCII, line 404052, OPENED, GOOD

--> FOAM FATAL IO ERROR :
Cannot find 'value' entry which is required to set the values of the default patch field.
(Actual type bottomHydro)

Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so

file: ././1/p::Bottom from line 400037 to line 400038.

From function defaultFvPatchField<type>::defaultFvPatchField(con st fvPatch&, const Field<type>&, const dictionary&)
in file fields/fvPatchFields/basicFvPatchFields/default/defaultFvPatchField.C at line 155.

FOAM exiting


Does anyone have any ideas why this might be the case? If you use a fixedGradient boundary condition you are able to supply a gradient and it works. That is essentially what I wish to do but I want to alter the value of this gradient at each timestep.

Thanks

Shaun
coops is offline   Reply With Quote

Old   May 23, 2007, 21:58
Default Hello all, My mistake, I lo
  #5
Member
 
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 7
coops is on a distinguished road
Hello all,

My mistake, I looked through my code again and I discovered that I had stupidly written out the gradient twice, and not a value.

I don't understand why both is needed but I guess I will discover why when I play with the code more

Thanks,

Shaun
coops is offline   Reply With Quote

Old   May 24, 2007, 12:34
Default Hi all, I need to know if i
  #6
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 7
lam is on a distinguished road
Hi all,

I need to know if it is possible in Foam, to put 2 boudary conditions in the same patch:
- the first one on the pressure (e.g p=0)
- and the second one on the Velocity :
guess that my vector is like that : U= (Ux, Uy)
And i want to have Ux=0 (and Uy free)

How can I do? Is it possible? what kind of boudary condition could make that ?

(I know that I when I said Ux=0, I mean U.T=0, where T (e.g T=(1,0)) is the tangent vector of the patch)

Hope that somebody could give me a hand!

Thanks in advance,

Lam
lam is offline   Reply With Quote

Old   May 24, 2007, 15:54
Default Hi Lam! Looking at Table 6.
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Lam!

Looking at Table 6.4 of the user guide I would say that surfaceNormaleFixedValue just might be the the thing for you.

(BTW: How does this question fit into the rest of this thread? Apart from the fact that it's about boundary conditions)

regards
Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 25, 2007, 06:50
Default hi Bernhard, Thanks to repl
  #8
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 7
lam is on a distinguished road
hi Bernhard,

Thanks to reply me.

I've read about surfaceNormalFixedValue, but I think that I could not try it, because I use the "simpleFoam" solver, and Foam does not allow me to use it.
But with which solver, can we use this boundary condition?
lam is offline   Reply With Quote

Old   May 25, 2007, 07:46
Default Hi Lam! I'm afraid this BC
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Lam!

I'm afraid this BC is not supported by FoamX. Two options:
a) adapt the cfg-files for FoamX to support it (but if you have to ask that is not really an option)
b) abandon FoamX and hand-edit the boundary conditions
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 29, 2007, 06:56
Default Hi Bernhard, I tried, but I
  #10
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 7
lam is on a distinguished road
Hi Bernhard,

I tried, but I do not know the way to edit athe boudary conditions by hand:

I tried to write in the "boundary" file :

sortie
{
type patch;
type surfaceNormalFixedValue;
}

But it seems not to be recognize by Foam: "invalid boundary"

I really want to test every boundary conditions.

So, can anybody give some involved files to show me, for example, how to use the boundary "mixed", "directionMixed", or "surfaceNormalFixedValue" conditions.

Thanks in advance,

Lam
lam 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
Which Boundary Condition To Use??? Learner FLUENT 0 October 11, 2008 04:25
Boundary condition of the third kind or Danckwertz boundary condition plage OpenFOAM Running, Solving & CFD 4 October 3, 2006 13:21
Boundary Condition???? Anant FLUENT 0 September 7, 2006 04:41
Slip Boundary Condition for Moving Boundary Shukla Main CFD Forum 3 November 11, 2005 16:02
Boundary Condition KIAN FLUENT 6 February 17, 2000 11:09


All times are GMT -4. The time now is 02:13.