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/)
-   -   TimeVaryingMappedFixedValue (https://www.cfd-online.com/Forums/openfoam-solving/58837-timevaryingmappedfixedvalue.html)

sunnysun May 29, 2008 04:39

Hi, everyone, I want to use
 
Hi, everyone,

I want to use timeVaryingMappedFixedValue for my inlet velocities and I set different velocity values for each time step for my simulation (in this case, deltaT = 0.0002 s).

I created the directories in constant/boundaryData/inlet/:

constant/boundaryData/inlet/points
constant/boundaryData/inlet/0/U
constant/boundaryData/inlet/0.0002/U
constant/boundaryData/inlet/0.0004/U
constant/boundaryData/inlet/0.0006/U

However, when I run the case(using icoFoam and the time step is set to be 0.0004), I got the following errors:


Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.0004

Courant Number mean: 0 max: 0.362781

10061
(
0
0.0002
0.0004
0.0006
0.0008
0.001
0.0012
0.0014
0.0016
...
...
3.2

)


In directory "constant/boundaryData/inlet"
on patch inlet of field U in file "/vol/isdata8/FIXI-Flow/QiSUN/openfoamtest/Second/ExpeCylinder1uP9/0/U"

From function findTime
in file fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedV alueFvPatchField.C at line 470.

FOAM exiting


Could anyone help me ?

Thank you very much in advance!!

sunny

mattijs May 29, 2008 18:19

Switch on the debug flag for t
 
Switch on the debug flag for the b.c: Set timeVaryingMappedFixedValue to 1 in your ~/OpenFOAM-1.4.1/controlDict.

Have a look at the source ($FOAM_SRC/finiteVolume/lnInclude/timeVaryingMappedFixedValueFvPatchField.C) to see what is happening.

sunnysun May 30, 2008 03:44

Hi,Mattijs, Thanks for the
 
Hi,Mattijs,

Thanks for the reply!
I am really new to this, so...can you explain a bit more how to do this?? Thanks!!

Vivien

johndeas May 30, 2008 06:46

There are several controlDict
 
There are several controlDict in OpenFOAM.

One is located by default in $HOME/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1

It contains commonly used by all solvers. You have various sections in it, the one of interrest for you would be "DebugSwitches". Set it to 1 for timeVaryingMappedFixedValue. This will force timeVaryingMappedFixedValue to be more verbose in its output, and will help debug.

Then, you have a specific controlDict in every case you run, which is only use by the case it belongs to, and contain other infos, but no debugSwitches.

sunnysun June 2, 2008 11:01

Hi, John and Mattijs, I cha
 
Hi, John and Mattijs,

I changed the DebugSwitches in controlDict and save the changes. But When I run the case, I did not get any more information, ie, the error is exactly the same as I posted before...

Any ideas?

Thanks!!

vivien

mattijs June 2, 2008 14:30

The controlDict file is first
 
The controlDict file is first looked for in

~/.OpenFOAM-1.4.1/controlDict

and then in

~/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1

sunnysun June 3, 2008 05:35

Hi, Mattijs, do you mean th
 
Hi, Mattijs,

do you mean there are two controlDict I need to edit?

I only find one in ~/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1/controlDict and I change the DebugSwitches for timeVaringMappedFixedValue to 1, but I did not see much information after I run the solver.

Thanks!

Vivien

mattijs June 3, 2008 18:35

Have a look at the sources: $F
 
Have a look at the sources: $FOAM_SRC/finiteVolume/lnInclude/timeVaryingMappedFixedValueFvPatchField.H

It is the 'TypeName' macro which specifies the name. This is the exact name you should use in the controlDict. In your post you mention 'timeVaringMappedFixedValue' instead of 'timeVaryingMappedFixedValue'.

sunnysun June 4, 2008 09:40

Hi, Mattijs, This is not t
 
Hi, Mattijs,

This is not the problem...

I made a simpler case that there are only 5 time step in constant->boundaryData->inlet(which are 0 0.0002 0.0004 0.0006 0.0008), the geometry is a cylinder and contain 100 points at inlet. After I run icoFoam, I got the following errors and seems the order of files are sorted:


Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

timeVaryingMappedFixedValue : construct from dictionary
timeVaryingMappedFixedValueFvPatchField : Read 100 sample points from "/openfoamtest/NewCase/constant/boundaryData/inlet/points"
timeVaryingMappedFixedValueFvPatchField : Used points (0.00138321 0.00138321 0) (0.00154865 0.00111043 0) (0.00167642 0.000812023 0) to define coordinate system with normal (0 0 -1)
readSamplePoints : Dumping triangulated surface to triangulation.stl
readSamplePoints : Dumping face centres to "/openfoamtest/NewCase/localFaceCentres.obj"
timeVaryingMappedFixedValueFvPatchField : In directory "/openfoamtest/NewCase/constant/boundaryData/inlet" found times
5
(
0.0008
0
0.0002
0.0004
0.0006
)



--> FOAM FATAL ERROR : Cannot find starting sampling values for current time 0
Have sampling values for times
5
(
0.0008
0
0.0002
0.0004
0.0006
)

In directory "constant/boundaryData/inlet"
on patch inlet of field U in file "/openfoamtest/NewCase/0/U"

From function findTime
in file fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedV alueFvPatchField.C at line 470.

FOAM exiting


Do you know why this is hapening?

Many thanks!!


Vivien

mattijs June 4, 2008 16:36

Could you try with this findTi
 
Could you try with this findTimes.C (src/OpenFOAM/db/Time/findTimes.C)?

(It was using this routine to detect the time directories inside constant/boundaryData. There was an assumption in it that the time directories would always have a 'constant')

You'll have to rebuild the OpenFOAM library (wmake libso $FOAM_SRC/OpenFOAM)

John Deas, this should also fix your problem - couldn't repeat it on your case since it depends on the original file order.

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif findTimes.C

sunnysun June 5, 2008 03:56

Hi, Mattijs, It is working
 
Hi, Mattijs,

It is working now, thank you very much!

Vivien

johndeas June 5, 2008 05:52

Thanks Mattijs, now I am stuck
 
Thanks Mattijs, now I am stuck with creating the timeVaryingMappedFixedValue on another thread, but will test it as soon as possible !

mmmn036 October 30, 2013 15:22

1 Attachment(s)
Hello,
I was trying to use timeVaryingMappedFixedValue bc to get U, k , nuSgs fields value from precursor run to my inlet to have turbulence.

I used sample utility to get the field data at precursor run. I added 11 time directory (0,1,2,3.....10) at constant/boundaryData/inlet. Simulation timestep is 0.001.

It works fine until the simulation blows out at 2.158 s because of courant no. reaches a huge value.

I am adding the log file here.

Anyone faces that kind of problem? Any help will be appreciated.

Thanks
MMMN


All times are GMT -4. The time now is 15:29.