CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   New boundary condition and %23ifdef NoRepository (https://www.cfd-online.com/Forums/openfoam-solving/59675-new-boundary-condition-23ifdef-norepository.html)

tehache February 13, 2007 04:58

Hello everybody, I am once
 
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!

hjasak February 13, 2007 05:05

Heya, The message means you
 
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

tehache February 13, 2007 05:05

just found out ... sorry for s
 
just found out ... sorry for spamming http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif

I had to include the linearFixedValueFvPatchFields.C,
not the linearFixedValueFvPatchField.C,
into finiteVolume/Make/files ...

coops May 23, 2007 01:19

Hello All, I am trying to c
 
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 May 23, 2007 20:58

Hello all, My mistake, I lo
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Thanks,

Shaun

lam May 24, 2007 11:34

Hi all, I need to know if i
 
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

gschaider May 24, 2007 14:54

Hi Lam! Looking at Table 6.
 
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

lam May 25, 2007 05:50

hi Bernhard, Thanks to repl
 
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?

gschaider May 25, 2007 06:46

Hi Lam! I'm afraid this BC
 
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

lam May 29, 2007 05:56

Hi Bernhard, I tried, but I
 
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


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