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/)
-   -   Transient boundary conditions (https://www.cfd-online.com/Forums/openfoam-solving/57830-transient-boundary-conditions.html)

tangd July 3, 2006 07:08

Hi, Anja, I'm using 1.3. I tr
 
Hi, Anja,
I'm using 1.3. I tried the same type "timeVaryingUniformFixedValue", it's running properly. You just typed "solver . case", then it should run.

anja July 5, 2006 05:23

Hi, okay for so far. The ne
 
Hi,

okay for so far. The next error message after starting the time loop is:
--> FOAM FATAL IO ERROR : file "inlet.dat" does not exist.

Where does the inlet.dat have to be? I've tried it at different places.

Thanks
Anja

tangd July 5, 2006 06:43

Hi, Ok, I can take my simul
 
Hi,

Ok, I can take my simulation as an example. I used sonicTurbFoam, and put "inlet.dat" in $FOAM_RUN/tutorial/sonicTurbFoam/. This time the file should be located.

anja July 5, 2006 06:54

Unfortunately that doesn't wor
 
Unfortunately that doesn't work, too.

Here is the complete error message:
Starting time loop

Time = 0.0001
Mean and max Courant Numbers = 0 0.800423
BICCG: Solving for Ux, Initial residual = 1, Final residual = 6.10507e-07, No Iterations 3
BICCG: Solving for Uy, Initial residual = 1, Final residual = 6.10507e-07, No Iterations 3
BICCG: Solving for Uz, Initial residual = 1, Final residual = 7.29578e-07, No Iterations 3


--> FOAM FATAL IO ERROR : file "inlet.dat" does not exist

file: inlet.dat at line 1.

From function IFstream::operator()
in file db/IOstreams/Fstreams/IFstream.C at line 160.

FOAM exiting


Any other suggestions?

tangd July 13, 2006 02:06

Hallo Dr.Jasak, According to
 
Hallo Dr.Jasak,
According to your message on June 27, I implemented the easy transient boundary condition. But now I'm trying to make it more user-friendly. The idea is that there should be a dictionary file similar to "calcMassFlowDict" in the system file of some case to the solover. So I can edit it each time without recompiling. I guess I should create a C file in ~/OpenFOAM/OpenFOAM-1.3/applications/utilities/preProcessing/ to pass parameters to the timeVaryingUniformTotalPressureFvPatchScalarFields .C . But how to write this part of code? I referenced the code in calcMassFlow, but I still don't understand how to let the parameters be read into the timeVaryingUniformTotalPressure file. Please give me some suggestions. Thanks so much in advance!

panara October 9, 2006 10:47

Dear all, I have a question
 
Dear all,

I have a question about the timeVaryingUniformFixedValueFvPatchField BC, if I drop the interpolation part could it be used without big modifications also for non uniform scalar/vector fields?

thanks in advance for any hints,

Daniele

gschaider October 9, 2006 11:20

Hi Daniele! I don't think s
 
Hi Daniele!

I don't think so. As far as I understand it the interpolation part is the stuff that interpolates between the different time-points which are read from a file (making a steady transition possible). XY has nothing to do with the geometry.

But basically anything can be done with BCs derived from fixedValue.

The problem is: should the shape at the inlet be always the same (only scaled)? In that case you could introduce an additional boundary field that is scaled by the function and written to the actual boundary field.

Or if you know your BC as a f(t,x,y,z) (this time x,y being he coordinates) you just write a new BC with a fitting updateCoeffs-method.

The possibilies are endless.

panara October 9, 2006 12:31

Hi Bernhard, I have underst
 
Hi Bernhard,

I have understood the interpolation, but what I would like to do is to impose a inlet.dat in the form:

(
t0 p0(nonuniform List<scalar> (or <vector>
n
(
n1
n2
...
nn
)
t1 p1(nonuniform List<scalar>
n
(
n1
n2
...
nn
)
...
tn pn(nonuniform List<scalar>
n
(
n1
n2
...
nn
)
)

in order to read at each time step a different profile without interpolating between two different time step.

I would like to use infact the profiles of an old LES computation as time varying inlet values of a new one.

I guess I should modify the graph class in order to do that but I am getting a bit lost in the doxygen, I am not very familiar with C++.
Do you think that it can be done in a not so complicated way? Do you have any hints on how to do that?

Thanks for your feedback anyway

Daniele

gschaider October 9, 2006 13:15

Hi Daniele! First: sorry fo
 
Hi Daniele!

First: sorry for implying you didn't read the source

The thing you want do do shouldn't be a big problem: just get your data into a List<scalarlist> p (construction with p(IFstream("myFile")) could work if myFile is in the correct format). Then in updateCoeff it should (havn't done it yet) be sufficient to do operator==(p[n]) (obviously you've got to keept track of n).

My problem with your approach is that you're constraining yourself to the same time-step as the original simulation (but if that's ok with you ....). My recommendation would be if you know that tNow is between t[n] and t[n+1] to do something like this:
scalar f=(tNow-t[n])/(t[n-1]-t[n]);
operator==(f*p[n+1]+(1-f)*p[n]);
(which of course is a interpolation)

alexej_goehring October 23, 2006 04:23

Dear all, Firstly, i am a n
 
Dear all,

Firstly, i am a newby to this sofware and would like to try some incompressible LES simulations using a non-constant LES inlet condition.

As far as i understand i would be choosing the specific turbulence model in the oodles directory. Please correct me if i'm wrong!

Secondly, i read through the posted messages, but didn't really understand the part on how to use the information from a file as LES inlet conditions.

I have a text file that provides velocity vectors for U,V and W as a function of position (y,z) and time (t) for every node on the inlet plane.

What would be the best way of reading that information in? (btw. the text file is about 160Mb)

I would be very greatful for some hints/ideas.

cheers,

alexej

alexej_goehring October 23, 2006 04:27

Dear all, Firstly, i am a n
 
Dear all,

Firstly, i am a newby to this sofware and would like to try some incompressible LES simulations using a non-constant LES inlet condition.

As far as i understand i would be choosing the specific turbulence model in the oodles directory. Please correct me if i'm wrong!

Secondly, i read through the posted messages, but didn't really understand the part on how to use the information from a file as LES inlet conditions.

I have a text file that provides velocity vectors for U,V and W as a function of position (y,z) and time (t) for every node on the inlet plane.

What would be the best way of reading that information in? (btw. the text file is about 160Mb)

I would be very greatful for some hints/ideas.

cheers,

alexej

shawn November 14, 2006 17:21

Hi I would like to do simple
 
Hi
I would like to do simple pressure driven flow. I think the inlet boundary condition I need is somthing like

{
type patch;
physicalType pressureInlet;
nFaces 480;
startFace 200;
}

How do I specify the pressure on the patch? Have I misunderstood that pressureInlet takes a given pressure and creates a consistent velocity field consistent with continuity at the boundary? I know for an incompressible fluid only the difference in pressure between inlet and outlet will matter.

Shawn

dmoroian November 15, 2006 02:52

You can specify the pressure v
 
You can specify the pressure value in a boundary file (dictionary) in a time directory, like 0/p:

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

// Field Dictionary

FoamFile
{

version 2.0;
format ascii;

root "";
case "";
instance "0";
local "";

class volScalarField;
object p;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions [1 -1 -2 0 0 0 0];

internalField uniform 100000;

boundaryField
{

fluid_interface
{<blockquote>
type zeroGradient;
}

inlet
{

type fixedValue;
value uniform 100000;
}
outlet
{

type fixedValue;
value uniform 99990;
}</blockquote>
}


// ************************************************** *********************** //



In the above example there is a patch on which zero gradient is set, and two other on wich fixed value is specified.

Dragos

maka June 18, 2007 13:21

using foamUser lib to define a
 
using foamUser lib to define a new b.c

(1) I copied foamUser to:
/data/maka/OpenFOAM/maka-1.3/applications

(2) I changed its Make/files to:
libfoamUser.C
LIB = $(FOAM_USER_LIBBIN)/libfoamUser

(3) I changed Make options to:
LIB_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lincompressibleLESmodelsUser // I added User to not to conflict with the default library.

(4) I created a folder for the new b.c.:
/data/maka/OpenFOAM/maka-1.3/src/LESmodels/incompressible/newBC
and compile it to:
LIB = $(FOAM_USER_LIBBIN)/libincompressibleLESmodelsUser

(5) the compilation works with no problem but when I run the solver (channelOodles) the new b.c. works. BUT when I run icoFoam (without using the new b.c.) it gives the following error:

icoFoam: symbol lookup error: /data//OpenFOAM/-1.3/lib/linuxAMD64Gcc4DPOpt/libincompressibleLESmodelsUser.so: undefined symbol: _ZN4Foam8LESmodel8typeNameE


My questions:

a) How can I know if a solver was linked to foamUser.so in the first place?
b) since no we have another foamUser.so in $(FOAM_USER_LIBBIN), how openFoam selects the correct one?
c) why I get error from icoFoam but not from channelOodles?

Thanks.

Best regards,
Maka

maka June 19, 2007 08:44

I looked harder for an answer
 
I looked harder for an answer for the above questions:

a) I found that foamUser is linked to OpenFOAM using the following line in options file in OpenFOAM-1.3/src/OpenFOAM/Make:

LIB_LIBS = -L$(FOAM_LIBBIN)/dummy -lPstream -lfoamUser -lz

This is how it is available for all the solvers and utilities.

b) By looking at g++ command and manual:
g++ ... -shared libfoamUser.o -L/data/maka/OpenFOAM/OpenFOAM-1.3/lib/linuxAMD64Gcc4DPOpt -L/data/maka/OpenFOAM/maka-1.3/lib/linuxAMD64Gcc4DPOpt -lfoamUser ...

which as user guide says: first g++ looks OpenFOAM-1.3/lib/ and then one specified in options file (/OpenFOAM/maka-1.3/lib/). But the question is: if in both folder there is a .so library with same name(like libfoamUser.so), what happens? The latter overrides the earlier or once a function definition is found the compiler does not look for it anymore (in this case the earlier has higher precedence while the latter may complement it). ??

c) ???

Thanks.

Best regards,
Maka

maka June 19, 2007 09:27

c) I tried to go and recompile
 
c) I tried to go and recompile icoFoam to get some message about the error. I got the following:

/data/maka/OpenFOAM/maka-1.3/lib/linuxAMD64Gcc4DPOpt/libfoamUser.so: undefined reference to `Foam::LESmodel::typeName'
/data/maka/OpenFOAM/maka-1.3/lib/linuxAMD64Gcc4DPOpt/libfoamUser.so: undefined reference to `typeinfo for Foam::LESmodel'

Now, It makes sense. I was trying to make any new boundary condition (b.c.) that I will create for LES (wall function) available for all LES models using foamUser. Since foamUser makes such b.c. available to all solvers and such b.c. depends on some LES feature (nuSgs). This needs such LES feature to be available for all solvers so they understand what this b.c. is about (some thing that one should not do). I wonder if there is a way to solve this using foamUser. What I thought about is to make a dummy library foamUserLES and compile it with a library from LES that is read by all LES solvers and utilities. Then use such a library in future to add new b.c.s. for LES only. I would welcome any correction of my understanding. Thanks.

Best regards,
Maka.

mattijs June 19, 2007 13:43

- link in whatever lib contain
 
- link in whatever lib contains nuSgs into foamUser. But then all codes carry around a lot of unused code.

- (ab)use the function objects. E.g. for a certain application I need to load in a few extra libraries. I used a dummy probes functionObject in the system/controlDict. This works great for specialised bc's since they are usually specific to a case.

functions
(
// Dummy probes to load in libParMetis
probes1
{
type probes;
functionObjectLibs
(
"libsampling.so"
"libparMetisDecompositionMethod.so"
);
region region0;
probeLocations();
fields();
}
);

maka June 21, 2007 13:43

I tried to make a foamUserLESm
 
I tried to make a foamUserLESmodelsIncompressible and link it to LESmodels/incompressable. Then one can use it to add any new b.c. or LES model to the incompressible LES library without recompiling. It worked. Thanks for the idea regarding using function objects.

Best regards,
Maka

nishant_hull April 11, 2008 09:12

Hi All I am trying to use
 
Hi All

I am trying to use timeVaryingUniformFixedValueFvPatchField for my application here. Since last discussion has been for OF-1.3 and I am currently using OF-1.4.1. So there has been some confusion about the problem.
I am using the default cavity problem of icoFoam. I specified the movingWall patch as timevaryinguniformFixedValue, as:
movingWall
{
type timeVaryingUniformFixedValue;
timeDataFileName "movingWall.dat";
value uniform 1e5;
}
I made a director in constant named "movingWall" and kept the file movingWall.dat there, which read:
(
0.0 1
0.1 1.2
0.2 1.4
0.3 1.6
0.4 1.8
0.5 2.0
)

After running this programm, Its complaining that file movingWall.dat cant be find. The error is:
Starting time loop

Time = 0.005

Courant Number mean: 0 max: 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.96338e-06, No Iterations 8
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 2.96338e-06, No Iterations 8


--> FOAM FATAL IO ERROR : file "movingWall.dat" does not exist

file: movingWall.dat at line 1.

From function IFstream::operator()
in file db/IOstreams/Fstreams/IFstream.C at line 171.

FOAM exiting


Can you tell me, where I am going wrong? Is the file location correct?

cheers!!

iyer_arvind May 16, 2008 23:47

the data file must be at the l
 
the data file must be at the location from where are launching the solver. It would be much better if the implementation makes it to be available in the <root> directory (wishlist ;) ).


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