CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Initialising buoyantSimpleFoam using ISA equations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2017, 15:23
Default Initialising buoyantSimpleFoam using ISA equations
  #1
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
Hi all

I'm trying to model simplified atmospheric flow and thermal updrafts in buoyantSimpleFoam. Right now I'm trying to get the case to run before adding the complications of thermal effects. The case is 2D, 10 by 605km, and I've disabled turbulence to further simplify the case while I track down where my errors lie.

So I am using funkySetFields to initialise p and T, going by standard ISA equations (http://www.wxaviation.com/ISAweb-2.pdf). The domain is a rectangle with bottom slip boundary condition, representing the ground, and ceiling is symmetry. The left hand side is going to be a velocity inlet and right hand side a pressure outlet, but just now I have disabled velocity in an effort to track down why my case is crashing. Initially, the fields seem reasonable:

p:



T:



However, the case immediately explodes, unless I massively relax it, where I get a strange solution after a few iterations:









The result is the same at the opposite end of the case.

The initial values are correct and physically realistic, so either my boundary conditions are wrong, or buoyantSimpleFoam is unsuitable for modelling this type of situation. If this is the case, could someone point me in the direction of a more suitable solver?

Here are the relevant files from /0, although I've redacted the internal field sections to make them more readable. Note that I changed the inlet patch to remove any velocity to try and isolate the problem, in the actual situation I would use fixedValue for u and fixedFluxPressure for p for the inlet.

p:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   nonuniform List<scalar> 
605000
(
REDACTED);

boundaryField
{
    inlet
{
        type            fixedValue;
        value           nonuniform List<scalar> 
100
(
100725.757506361
99535.8807790932
98357.4115372469
97190.2659228576
96034.3605060575
94889.6122838566
93755.9386789229
92633.2575383652
91521.4871325154
90420.5461537114
89330.3537150819
88250.8293493305
87181.8930075217
86123.4650578667
85075.4662845103
84037.8178863189
83010.4414756684
81993.2590772337
80986.1931267782
79989.1664699442
79002.1023610447
78024.9244618550
77057.5568404053
76099.9239697743
75151.9507268834
74213.5623912918
73284.6846439917
72365.2435662049
71455.1656381799
70554.3777379900
69662.8071403315
68780.3815153232
67907.0289273064
67042.6778336461
66187.2570835321
65340.6959167814
64502.9239626415
63673.8712385941
62853.4681491596
62041.6454847023
61238.3344202370
60443.4665142351
59656.9737074327
58878.7883216387
58108.8430585442
57347.0709985318
56593.4055994869
55847.7806956086
55110.1304962218
54380.3895845908
53658.4929167320
52944.3758202292
52237.9739930483
51539.2235023537
50848.0607833246
50164.4226379729
49488.2462339616
48819.4691034234
48158.0291417812
47503.8646065682
46856.9141162499
46217.1166490458
45584.4115417529
44958.7384885690
44340.0375399177
43728.2491012736
43123.3139319885
42525.1731441184
41933.7682012511
41349.0409173351
40770.9334555085
40199.3883269296
39634.3483896074
39075.7568472340
38523.5572480163
37977.6934835101
37438.1097874541
36904.7507346046
36377.5612395716
35856.4865556553
35341.4722736834
34832.4643208498
34329.4089595529
33832.2527862362
33340.9427302286
32855.4260525860
32375.6503449337
31901.5635283095
31433.1138520077
30970.2498924242
30512.9205519015
30061.0750575758
29614.6629602243
29173.6341331130
28737.9387708459
28307.5273882148
27882.3508190501
27462.3602150723
27047.5070447442
26637.7430921242
)
;
        valueExpression "101325*pow((1-0.0065/288.15*pos().y),5.2561)";
        evaluateDuringConstruction 0;
        variables       "";
        timelines       (
);
        lookuptables    (
);
        lookuptables2D  (
);
    
    }
    roof
    {
        type            symmetry;
    }
    outlet
    {
        type            fixedValue;
        value           nonuniform List<scalar> 
100
(
100725.757506361
99535.8807790932
98357.4115372469
97190.2659228576
96034.3605060575
94889.6122838566
93755.9386789229
92633.2575383652
91521.4871325154
90420.5461537114
89330.3537150819
88250.8293493305
87181.8930075217
86123.4650578667
85075.4662845103
84037.8178863189
83010.4414756684
81993.2590772337
80986.1931267782
79989.1664699442
79002.1023610447
78024.9244618550
77057.5568404053
76099.9239697743
75151.9507268834
74213.5623912918
73284.6846439917
72365.2435662049
71455.1656381799
70554.3777379900
69662.8071403315
68780.3815153232
67907.0289273064
67042.6778336461
66187.2570835321
65340.6959167814
64502.9239626415
63673.8712385941
62853.4681491596
62041.6454847023
61238.3344202370
60443.4665142351
59656.9737074327
58878.7883216387
58108.8430585442
57347.0709985318
56593.4055994869
55847.7806956086
55110.1304962218
54380.3895845908
53658.4929167320
52944.3758202292
52237.9739930483
51539.2235023537
50848.0607833246
50164.4226379729
49488.2462339616
48819.4691034234
48158.0291417812
47503.8646065682
46856.9141162499
46217.1166490458
45584.4115417529
44958.7384885690
44340.0375399177
43728.2491012736
43123.3139319885
42525.1731441184
41933.7682012511
41349.0409173351
40770.9334555085
40199.3883269296
39634.3483896074
39075.7568472340
38523.5572480163
37977.6934835101
37438.1097874541
36904.7507346046
36377.5612395716
35856.4865556553
35341.4722736834
34832.4643208498
34329.4089595529
33832.2527862362
33340.9427302286
32855.4260525860
32375.6503449337
31901.5635283095
31433.1138520077
30970.2498924242
30512.9205519015
30061.0750575758
29614.6629602243
29173.6341331130
28737.9387708459
28307.5273882148
27882.3508190501
27462.3602150723
27047.5070447442
26637.7430921242
)
;
        valueExpression "101325*pow((1-0.0065/288.15*pos().y),5.2561)";
        evaluateDuringConstruction 0;
        variables       "";
        timelines       (
);
        lookuptables    (
);
        lookuptables2D  (
);
    
    }
    coldWalls
    {
        type            zeroGradient;
    }
	
	 hotWalls
    {
        type            zeroGradient;
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
T

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   nonuniform List<scalar> 
605000
(
REDACTED
)
;
        refGradient     uniform 0;
        valueFraction   uniform 1;
        value           nonuniform List<scalar> 
100
(
  287.825000000000
287.175000000000
286.525000000000
285.875000000000
285.225000000000
284.575000000000
283.925000000000
283.275000000000
282.625000000000
281.975000000000
281.325000000000
280.675000000000
280.025000000000
279.375000000000
278.725000000000
278.075000000000
277.425000000000
276.775000000000
276.125000000000
275.475000000000
274.825000000000
274.175000000000
273.525000000000
272.875000000000
272.225000000000
271.575000000000
270.925000000000
270.275000000000
269.625000000000
268.975000000000
268.325000000000
267.675000000000
267.025000000000
266.375000000000
265.725000000000
265.075000000000
264.425000000000
263.775000000000
263.125000000000
262.475000000000
261.825000000000
261.175000000000
260.525000000000
259.875000000000
259.225000000000
258.575000000000
257.925000000000
257.275000000000
256.625000000000
255.975000000000
255.325000000000
254.675000000000
254.025000000000
253.375000000000
252.725000000000
252.075000000000
251.425000000000
250.775000000000
250.125000000000
249.475000000000
248.825000000000
248.175000000000
247.525000000000
246.875000000000
246.225000000000
245.575000000000
244.925000000000
244.275000000000
243.625000000000
242.975000000000
242.325000000000
241.675000000000
241.025000000000
240.375000000000
239.725000000000
239.075000000000
238.425000000000
237.775000000000
237.125000000000
236.475000000000
235.825000000000
235.175000000000
234.525000000000
233.875000000000
233.225000000000
232.575000000000
231.925000000000
231.275000000000
230.625000000000
229.975000000000
229.325000000000
228.675000000000
228.025000000000
227.375000000000
226.725000000000
226.075000000000
225.425000000000
224.775000000000
224.125000000000
223.475000000000
)
;
        valueExpression "288.15-0.0065*pos().y";
        gradientExpression "0";
        fractionExpression "1";
        evaluateDuringConstruction 0;
        variables       "";
        timelines       (
);
        lookuptables    (
);
        lookuptables2D  (
);
    }
    roof
    {
        type            symmetry;
		}
    outlet
    {
	        type            inletOutlet;
	        value           nonuniform List<scalar> 
100
(
287.825000000000
287.175000000000
286.525000000000
285.875000000000
285.225000000000
284.575000000000
283.925000000000
283.275000000000
282.625000000000
281.975000000000
281.325000000000
280.675000000000
280.025000000000
279.375000000000
278.725000000000
278.075000000000
277.425000000000
276.775000000000
276.125000000000
275.475000000000
274.825000000000
274.175000000000
273.525000000000
272.875000000000
272.225000000000
271.575000000000
270.925000000000
270.275000000000
269.625000000000
268.975000000000
268.325000000000
267.675000000000
267.025000000000
266.375000000000
265.725000000000
265.075000000000
264.425000000000
263.775000000000
263.125000000000
262.475000000000
261.825000000000
261.175000000000
260.525000000000
259.875000000000
259.225000000000
258.575000000000
257.925000000000
257.275000000000
256.625000000000
255.975000000000
255.325000000000
254.675000000000
254.025000000000
253.375000000000
252.725000000000
252.075000000000
251.425000000000
250.775000000000
250.125000000000
249.475000000000
248.825000000000
248.175000000000
247.525000000000
246.875000000000
246.225000000000
245.575000000000
244.925000000000
244.275000000000
243.625000000000
242.975000000000
242.325000000000
241.675000000000
241.025000000000
240.375000000000
239.725000000000
239.075000000000
238.425000000000
237.775000000000
237.125000000000
236.475000000000
235.825000000000
235.175000000000
234.525000000000
233.875000000000
233.225000000000
232.575000000000
231.925000000000
231.275000000000
230.625000000000
229.975000000000
229.325000000000
228.675000000000
228.025000000000
227.375000000000
226.725000000000
226.075000000000
225.425000000000
224.775000000000
224.125000000000
223.475000000000
)
;
        inletValue           nonuniform List<scalar> 
100
(
287.825000000000
287.175000000000
286.525000000000
285.875000000000
285.225000000000
284.575000000000
283.925000000000
283.275000000000
282.625000000000
281.975000000000
281.325000000000
280.675000000000
280.025000000000
279.375000000000
278.725000000000
278.075000000000
277.425000000000
276.775000000000
276.125000000000
275.475000000000
274.825000000000
274.175000000000
273.525000000000
272.875000000000
272.225000000000
271.575000000000
270.925000000000
270.275000000000
269.625000000000
268.975000000000
268.325000000000
267.675000000000
267.025000000000
266.375000000000
265.725000000000
265.075000000000
264.425000000000
263.775000000000
263.125000000000
262.475000000000
261.825000000000
261.175000000000
260.525000000000
259.875000000000
259.225000000000
258.575000000000
257.925000000000
257.275000000000
256.625000000000
255.975000000000
255.325000000000
254.675000000000
254.025000000000
253.375000000000
252.725000000000
252.075000000000
251.425000000000
250.775000000000
250.125000000000
249.475000000000
248.825000000000
248.175000000000
247.525000000000
246.875000000000
246.225000000000
245.575000000000
244.925000000000
244.275000000000
243.625000000000
242.975000000000
242.325000000000
241.675000000000
241.025000000000
240.375000000000
239.725000000000
239.075000000000
238.425000000000
237.775000000000
237.125000000000
236.475000000000
235.825000000000
235.175000000000
234.525000000000
233.875000000000
233.225000000000
232.575000000000
231.925000000000
231.275000000000
230.625000000000
229.975000000000
229.325000000000
228.675000000000
228.025000000000
227.375000000000
226.725000000000
226.075000000000
225.425000000000
224.775000000000
224.125000000000
223.475000000000
)
;
}
    coldWalls
    {
        type            zeroGradient;
    }
    hotWalls
    {
        type            zeroGradient;
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
U:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1612+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
type inletOutlet;
value uniform (0 0 0);
inletValue uniform (0 0 0);
    }
	
	    roof
    {
        type            symmetry;
    }
	
    outlet
    {
type inletOutlet;
value uniform (0 0 0);
inletValue uniform (0 0 0);
    }
    coldWalls
    {
        type            slip;
    }
    hotWalls
    {
        type            slip;
    }
    defaultFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
p_rgh

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
	    location    "0";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 101325;

boundaryField
{

	
    inlet
{
		type fixedValue;
        value          nonuniform List<scalar> 
        100
		(
101653
101616
101579
101542
101505
101421
101334
101247
101160
101073
100941
100805
100668
100531
100395
100220
100039
99857.9
99676.8
99495.6
99281.5
99059.1
98836.6
98614.2
98391.8
98141
97880.8
97620.5
97360.3
97100.1
96815.8
96521.1
96226.4
95931.7
95637.1
95322.3
94996.6
94671
94345.4
94019.8
93677.5
93324.1
92970.8
92617.4
92264
91896.8
91518.3
91139.8
90761.3
90382.8
89993.2
89592.3
89191.4
88790.5
88389.7
87979.9
87559.3
87138.6
86718
86297.4
85869.9
85432.3
84994.6
84557
84119.3
83676.5
83224.2
82771.8
82319.4
81867.1
81410.9
80946
80481.1
80016.1
79551.2
79083.7
78608.4
78133.1
77657.9
77182.6
76705.6
76221.9
75738.2
75254.5
74770.9
74286.2
73796.2
73306.2
72816.2
72326.2
71835.9
71343.3
70850.6
70358
69865.3
69372.6
68877.7
68382.8
67887.8
67392.9



)
;
}
	    roof
    {	
        type            symmetry;
    }
	

outlet
{
		type fixedValue;
        value          nonuniform List<scalar> 
        100
		(
101653
101616
101579
101542
101505
101421
101334
101247
101160
101073
100941
100805
100668
100531
100395
100220
100039
99857.9
99676.8
99495.6
99281.5
99059.1
98836.6
98614.2
98391.8
98141
97880.8
97620.5
97360.3
97100.1
96815.8
96521.1
96226.4
95931.7
95637.1
95322.3
94996.6
94671
94345.4
94019.8
93677.5
93324.1
92970.8
92617.4
92264
91896.8
91518.3
91139.8
90761.3
90382.8
89993.2
89592.3
89191.4
88790.5
88389.7
87979.9
87559.3
87138.6
86718
86297.4
85869.9
85432.3
84994.6
84557
84119.3
83676.5
83224.2
82771.8
82319.4
81867.1
81410.9
80946
80481.1
80016.1
79551.2
79083.7
78608.4
78133.1
77657.9
77182.6
76705.6
76221.9
75738.2
75254.5
74770.9
74286.2
73796.2
73306.2
72816.2
72326.2
71835.9
71343.3
70850.6
70358
69865.3
69372.6
68877.7
68382.8
67887.8
67392.9



)
;
}

    coldWalls
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        value           uniform 101325;
    }
	
	 hotWalls
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        value           uniform 101325;
    }
	
	    frontAndBack
    {
        type            empty;
    }
	
	
	
}

// ************************************************************************* //
Any advice is greatly appreciated!

cheers
sturgeon
sturgeon is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guide: Writing Equations in LaTeX on the CFD Online Forums pete Site Help, Feedback & Discussions 27 May 19, 2022 03:19
how to implement k-epsilon equations in ADI method kiamey Main CFD Forum 2 July 17, 2014 17:13
modelling Differential equations in a udf RikardMNorén Fluent UDF and Scheme Programming 2 October 1, 2013 03:36
Riemann invariants of adjoint equations of shallow water equations zqb0929 Main CFD Forum 0 March 15, 2012 00:54
CFD governing equations m.gos Main CFD Forum 0 April 30, 2011 14:21


All times are GMT -4. The time now is 03:04.