|
[Sponsors] |
How to put an already-obtained velocity distribution as initial condition??? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 23, 2016, 13:19 |
How to put an already-obtained velocity distribution as initial condition???
|
#1 |
Member
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10 |
Hello Foamers
I need your suggestion regarding a very interesting and useful topic. Suppose I got a fully-developed velocity profile from a pipe flow solution (U Vs. Z) and I want to implement it to another problem as an initial velocity field. This might save some of the computational time since the solver is already dealing with a good solution. Did anyone use this type of condition in any of your simulations?? ANY type of suggestion is highly appreciated. |
|
June 23, 2016, 16:44 |
|
#2 |
Member
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10 |
Anybody please give me some hints from your experience how to add my own initial conditions to a problem, say an initial temperature profile or an initial velocity profile
|
|
June 23, 2016, 17:06 |
|
#3 |
Senior Member
|
User Guide, chapter 2.1.5.3. In fact whole section 2.1.5 could be useful - http://cfd.direct/openfoam/user-guid...#x5-170002.1.5.
|
|
June 23, 2016, 17:20 |
|
#4 |
Member
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10 |
Thanks Alexey. I was thinking of using somehow the setFields utility to specify a user-defined initial velocity of temperature profile. This might be the easiest option if I can do that.
Not necessarily that I have to merge the older one with the new one as you mentioned. Suppose that I have any profile and I want to use it as my initial condition instead of a fixed value. PLEASE help me if you have any idea. |
|
June 23, 2016, 17:36 |
|
#5 |
Senior Member
|
Well, you can use setFields, you can use codeStream as internalField (if you know OpenFOAM's C++), you can use so called funkySetFields (according to forum it can be used for the case you have described, yet I have never used it myself). Below is an example of codeStream as internalField for velocity:
Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } dimensions [0 1 -1 0 0 0 0]; internalField #codeStream { codeInclude #{ #include "fvCFD.H" #include "vectorField.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; code #{ const IOdictionary& d = static_cast<const IOdictionary&>(dict); const fvMesh& mesh = refCast<const fvMesh>(d.db()); vectorField U(mesh.nCells()); const vector C = vector(0.05, 0.05, 0.005); forAll(U, i) { const vector& Ci = mesh.C()[i]; const vector R = Ci - C; U[i] = R ^ Ci; } U.writeEntry("", os); #}; }; ... [your boundary conditions] |
|
September 5, 2019, 13:18 |
|
#6 | |
Senior Member
Alejandro
Join Date: Jan 2014
Location: Argentina
Posts: 128
Rep Power: 12 |
Quote:
Code:
error: ‘Foam::vectorField {aka class Foam::Field<Foam::Vector<double> >}’ has no member named ‘writeEntry’ /opt/openfoam-dev/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/codeStreamTemplate.o' failed make: *** [Make/linux64GccDPInt32Opt/codeStreamTemplate.o] Error 1 |
||
September 6, 2019, 08:16 |
|
#7 |
Senior Member
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8 |
A very simplem method can be copy and paste the value in the oldSim/U to the nuew 0/U.
If the mesh is different, you can easily apply a mesh conversion |
|
Tags |
fully developed flow, initial velocity field, velocity profile |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressor Simulation using rhoPimpleDyMFoam | Jetfire | OpenFOAM Running, Solving & CFD | 107 | December 9, 2014 14:38 |
pimpleFoam: turbulence->correct(); is not executed when using residualControl | hfs | OpenFOAM Running, Solving & CFD | 3 | October 29, 2013 09:35 |
SLTS+rhoPisoFoam: what is rDeltaT??? | nileshjrane | OpenFOAM Running, Solving & CFD | 4 | February 25, 2013 05:13 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 13:50 |
Differences between serial and parallel runs | carsten | OpenFOAM Bugs | 11 | September 12, 2008 12:16 |