Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some questions in running example.ALM #43

Closed
SH-Liao opened this issue Mar 14, 2019 · 14 comments
Closed

some questions in running example.ALM #43

SH-Liao opened this issue Mar 14, 2019 · 14 comments

Comments

@SH-Liao
Copy link

SH-Liao commented Mar 14, 2019

hello,I had run "example.ABL.flatTerrain.stable" yet ,and got the inflow velocity and temperature
data which are contained by folder"20000".(which looks nice in paraview)
So I turned to example.ALM,when I open the "runscript.preprocess",at line 16 "precursorDir=/projects/precursor/neutral3x3",that's not the same path as mine.
Then I saw command "#cp -rf $precursorDir/$startTime $startTime & cp -rf $precursorDir/constant/polyMesh ./constant",and I guess it may be the path to "example.ABL.flatTerrain.stable".
But I cannot find out the following:
Get the inflow data linked up.
#ln -s $precursorDir/drivingData/boundaryData ./constant
Get the driving source terms linked up.
#ln -s $precursorDir/drivingData/sources ./constant
becuase there are no such file or directory in "example.ABL.flatTerrain.stable",then I searched my computer and find out there is no directory name "drivingData" .

What am I missing ?
I would be very grateful if someone could help me.

@Bartdoekemeijer
Copy link
Contributor

Hello Shenghai,

Read my reply on Issue #26 . It will explain how to set-up the drivingData folder and couple your a windPlantSolver simulation to your precursor simulation.

Cheers,
Bart

@SH-Liao
Copy link
Author

SH-Liao commented Mar 20, 2019

Hello ,@Bartdoekemeijer ,thanks for your help.
I haven't start running yet becuase I want to learn a little more about example.ALM.
Until now ,I think that turbine models are located in constant/turbineArrayProperties

turbine0
{
turbineType "NREL5MWRef";
baseLocation (1000.0 1500.0 0.0);
numBladePoints 40;

turbine1
{
turbineType "NREL5MWRef";
baseLocation (1000.0 1500.0 0.0);
numBladePoints 40;

so as far as I'm consider there are two turbines named turbine0 & turbine1,
they have the same propreties ,but how could they be at the same location?

And what if I want to choose/change the airfoilProperties ?
I saw the following in constant/NREL5MWRef

Airfoils
(
"Cylinder1"
"Cylinder2"
"DU40_A17"
"DU35_A17"
"DU30_A17"
"DU25_A17"
"DU21_A17"
"NACA64_A17"
);

I cannot figure out where it was defined,
would you mine send me some help.

yours
ShenghaiLiao

@ewquon
Copy link
Collaborator

ewquon commented Mar 20, 2019 via email

@SH-Liao
Copy link
Author

SH-Liao commented Mar 21, 2019

hello ,thanks for the both of you @ewquon @Bartdoekemeijer ,that's really helpful.
Today , I run example.ABL.flatTerrain.stable to create a precursor ,in order to save some time ,I changed some data in setUp :first I change the field to 300x300x100 (with Mesh 30x30x10)as a test ,and it provided a good turbulence.Then next i tried 300x300x200(with Mesh 30x30x20) and 600x600x200(with Mesh 60x60x20),but the conclusions which came out are likely to be wrong .In paraview ,it seems that the turbulence only appears at the bottom ,about 100 meters .
So I went back to run the original edition, it came the same ,the turbulence only appears at low atitude about z<100.Not look like tutorial in which turbulene is full of the whole field.
And then I saw these in the setUp

// Initial values for the variables.
// Note that U and T get overwritten if setFieldsABL is called.
U0Mag 8.0; // Initial condition for wind speed (m/s).
dir 270.0; // Initial condition for wind direction (deg).
windHeight 99.27; // Height at which to drive mean wind to U0Mag/dir (m).
p_rgh0 0.0;

the windHeight is only 99.27m,the tubine is 87.6 meters high with radiius 63 meters

In total ,is this output capable to be a"precursor" or I should change some parameters,I'm going to use it to run example.ALM

@Bartdoekemeijer
Copy link
Contributor

Hi @ShenghaiLiao ,

In theory, you could use any kind of precursor as an inflow to your wind farm simulation. I guess the question becomes "how realistic is my precursor simulation", which is a big topic on itself. I am by no means an expert, but in my experience, wind farm simulations are typically done in domains much larger than the wind farm itself, I assume to reduce boundary effects. Hence, a precursor is generally also much larger than the wind farm. This is why the example precursor simulation is of a 3km x 3km x 1km domain. A domain of 600m x 600m x 200m seems very small. I am not sure why your turbulence levels seem so off on this small domain, though. I have had success with smaller precursor domains myself (e.g., a 2km x 1km x 650m domain sampled at 200 x 100 x 65 cells). You might want to try a slightly larger domain.

Furthermore, please note that in the windPlantSolver.ALM simulation, you will need to further refine the mesh near the rotor for accurate results, yielding even more cells. Perhaps to avoid these boundaryData issues, you could consider running a pisoFoamTurbine.ADM or pisoFoamTurbine.ALM simulation. In contrary to windPlantSolver, pisoFoamTurbine does not require a precursor simulation and assumes a uniform inflow. This might be easier to start out with. Furthermore, the ADM code works pretty well without further refining the mesh.

Cheers,
Bart

@ewquon
Copy link
Collaborator

ewquon commented Mar 21, 2019

@ShenghaiLiao ,

A few comments:

  • What do you mean by "good turbulence"? What metrics are you looking at?
  • Under stable conditions, the boundary layer height is expected to be much shallower than neutral or unstable conditions. Turbulence shouldn't exist above the boundary layer for these idealized simulations.
  • Regarding domain size, one important consideration is the integral length scale of the ABL flow. In other words, the domain should be larger than the largest eddies in the flow. Otherwise, if a large flow structure (e.g., under unstable atmospheric conditions) spans the length of the periodic computational domain, the structure becomes locked in and you're effectively simulating an infinitely long flow feature.

Eliot

@SH-Liao
Copy link
Author

SH-Liao commented Mar 25, 2019

Thanks again for both of you @ewquon @Bartdoekemeijer,I have successfully run example.ALM
here are some experience and advices:
first :
[0]
[0]
[0] --> FOAM FATAL IO ERROR:
[0] Illegal dictionary entry or environment variable name "meanStartTime"
Valid dictionary entries are ..

then I went to "setUp"
at line34:AvgStartTime 20200; // Time to begin accumulating the mean;
Should it be "meanStartTime",this error vanished after I made the change.

second:
Starting time loop

<U_1> = (4.31034335563 0.164729403542 -0.0118860960976) <U_s> = (2.35541986325 0.0981680940245 0) <dU/dn> = (0.195492349239 0.00665613095171 -0.00237721921951)
[1]
[1]
[1] --> FOAM FATAL ERROR:
[1] [3]
[3]
[3] --> FOAM FATAL ERROR:
[3] Cannot find starting sampling values for current time 20000
Have sampling values for times
2804
(
20000.7173601
20001.4352356

I checked $precursorDir/drivingData/west and find the values start at 20000.7173601,so I created a floder name "20000",and just copied the contents form "20000.7173601" and the error disappeared,
I wonder if some change could be made in "makeBoundaryDataFiles.west.sh"

Third
In example.ALM/system/controlDict.1 at line 18
application ABLSolver; it should be
application windPlantSolver.ALM;
(same in ADM)

At last ,What are those in floder example.ALM/turbineOutput/20000,they can not be open by paraview,could them be postProcessing?

best wishes
ShenghaiLiao

@SH-Liao SH-Liao closed this as completed Mar 25, 2019
@Bartdoekemeijer
Copy link
Contributor

Bartdoekemeijer commented Mar 25, 2019

at line34:AvgStartTime 20200; // Time to begin accumulating the mean;
Should it be "meanStartTime",this error vanished after I made the change.

Yes, correct

I checked $precursorDir/drivingData/west and find the values start at 20000.7173601,so I created a floder name "20000",and just copied the contents form "20000.7173601" and the error disappeared,

This is how it is fixed in practice, too. Indeed, perhaps a fix can be made in the makeBoundaryDataFiles scripts!

At last ,What are those in floder example.ALM/turbineOutput/20000,they can not be open by paraview,could them be postProcessing?

This folder contains the full state information of your simulation. This is in binary OpenFOAM format. You need to convert it to readable format if you would like to open it in ParaView. Take a look at the FoamToVTK function.

Hope this helps!

Best regards,
Bart

@Hosein-F
Copy link

Dear Bart Doekemeijer,

I am sorry that I am placing question in this closed discussion.

I am going to run example.ALM based on the precursors made from "example.ABL.flatTerrain.stable".
I am trying to make precursorDir according to your instruction in #26. However I am getting error in executing:

reconstructPar -time 20000 -fields '(k kappat nuSgs p_rgh qwall Rwall T U)'

as:

Reconstructing fields for mesh region0

Time = 1000

Reconstructing FV fields

    Reconstructing volScalarFields

        nuSgs
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::fixedValueFvPatchField<double>::fixedValueFvPatchField(Foam::fixedValueFvPatchField<double> const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?
#4  Foam::fvPatchField<double>::addpatchMapperConstructorToTable<Foam::fixedValueFvPatchField<double> >::New(Foam::fvPatchField<double> const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::fvPatchFieldMapper const&) at ??:?
#5  ? at ??:?
#6  ? at ??:?
#7  ? at ??:?
#8  ? at ??:?
#9  ? at ??:?
#10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11  ? at ??:?

Could you please let me know, if you have any idea about the source of error?

Thanks a lot.

Best regards,

Hosein

@rthedin
Copy link

rthedin commented Mar 16, 2021

Hosein,
The problem you are having is with the reconstructPar utility, which is a standard OpenFOAM utility, rather than a SOWFA utility. Placing your non-SOWFA question on a closed two-year-old SOWFA issue is not the way to get help.

In any case, note that even though you asked for time 20000, it is attempting to reconstruct time 1000. Check if you have times 1000 and 20000, and check if the variable that is giving you issues actually exists.

Good luck.

@Cookiewyf
Copy link

hello, I was trying to run "Example.ALM", and I fellow the suggestions provided by #26
I succeed to run "example.ABL.flatTerrain.stable" (the field:3km3km01.02km,endTime:5000s),then continued simulation to 7000s, and I got the "boundaryDataPre". Next , I used boundaryDataConversion and sourceDataConversion to create boundaryData for 2000s and sources.
I checked the boundarydata folder, every time folder contain "K","T","U". But the average are all 0. Is there any problem?

Screenshot from 2021-11-19 21-06-12
After that I put them in drivingData and reconstructPar, got 500:5000(10 folders).
Is that right to create the precursor data? Then I fellow the hint given by @SH-Liao changed the "meanStartTIme", add 5000 in $precursorDir/drivingData/south and changed application to windPlantSolver.ALM in controlDict.
Then I got the error when I simulate:

Starting time loop

<U_1> = (7.99914611291 8.35307024211e-06 0) <U_s> = (8.00085388709 -8.35307024206e-06 0) <dU/dn> = (-8.53887094084e-05 8.35307024206e-07 0)
[0]
[0]
[0] [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] Only 0 provided.
Need at least three non-colinear points to be able to interpolate.
[1]
[1] From function pointToPointPlanarInterpolation::calcCoordinateSystem(const pointField&)
[2]
[2]
[2] --> FOAM FATAL ERROR:
[2] Only 0 provided.
Need at least three non-colinear points to be able to interpolate.
[2]
[2] From function pointToPointPlanarInterpolation::calcCoordinateSystem(const pointField&)
[2] in file triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C at line 58.
[2]

FOAM parallel run exiting
[2]
--> FOAM FATAL ERROR:
[0] Only 0 provided.
Need at least three non-colinear points to be able to interpolate.
[0]
[0] From function pointToPointPlanarInterpolation::calcCoordinateSystem(const pointField&)
[0] in file triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C at line 58.
[0]
FOAM parallel run exiting
[0]
[1] in file triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C at line 58.
[1]
FOAM parallel run exiting
[1]

MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.

Anyone can help me or give me a hint? thanks! @Bartdoekemeijer @ewquon
log_windPlantSolver_ALM.md

@nish-ant
Copy link

nish-ant commented Nov 19, 2021

I checked the boundarydata folder, every time folder contain "K","T","U". But the average are all 0. Is there any problem?

The average value is not used as mentioned here in #26. So you can ignore that.
The files in your boundaryData directory are however not populated (i.e., there is no data in between the parentheses after 0). Ideally The files should look something like this (example for k):

FoamFile
{
    version     2.0;
    format      ascii;
    class       scalarAverageField;
    object      values;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Average
0


30000
(
0.0273590000799
0.0233944500754
.
.
.
)

Are the same files at the locations postProcessing/boundaryDataPre/<time>/west/scalarField/ and postProcessing/boundaryDataPre/<time>/west/vectorField/ populated? If yes, then check for errors when you do the data conversion in Steps 5 and 6 of #26.

Just from the data you've provided, it is difficult to say why it might be happening but see if you exactly followed the steps as given in #26. Also, as you've changed the simulation times, see if the startTime, endTime, etc. are correctly set in your controlDict.1 and controlDict.2.

Having said that, you can also think of following the same initial run-time of 20000 s as the time span of 5000 s is not long enough to reach a quasi-equilibrium state.

@Cookiewyf
Copy link

I checked the boundarydata folder, every time folder contain "K","T","U". But the average are all 0. Is there any problem?

The average value is not used as mentioned here in #26. So you can ignore that. The files in your boundaryData directory are however not populated (i.e., there is no data in between the parentheses after 0). Ideally The files should look something like this (example for k):

FoamFile
{
    version     2.0;
    format      ascii;
    class       scalarAverageField;
    object      values;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Average
0


30000
(
0.0273590000799
0.0233944500754
.
.
.
)

Are the same files at the locations postProcessing/boundaryDataPre/<time>/west/scalarField/ and postProcessing/boundaryDataPre/<time>/west/vectorField/ populated? If yes, then check for errors when you do the data conversion in Steps 5 and 6 of #26.

Just from the data you've provided, it is difficult to say why it might be happening but see if you exactly followed the steps as given in #26. Also, as you've changed the simulation times, see if the startTime, endTime, etc. are correctly set in your controlDict.1 and controlDict.2.

Having said that, you can also think of following the same initial run-time of 20000 s as the time span of 5000 s is not long enough to reach a quasi-equilibrium state.

Thank you! Maybe it caused the error.
This first time I fellow thehttps://github.com//issues/26 I try to create a controlDict.2, but it did not work, like the controlDict did not change. So I have to change the data in controlDict.1 ,and continued run runscript.solve.1 with
cp system/controlDict.1 system/controlDict
Maybe it caused the problem.And could you teach me how to set the controlDict.2 to make it run? Thank you!
And the thing about run-time, I know it's not enough to get a good output. At this moment I only consider letting the program run normally!
Thank you for your reply!

@nish-ant
Copy link

nish-ant commented Nov 19, 2021

@Cookiewyf Okay, this explains the source of error. So, once you have finished the initial run (upto 5000 s or 20000 s as mentioned in #26), your next step should be to create a new controlDict.2 file by copying controlDict.1 and making the changes as mentioned in #26. Now, in order to use this new controlDict file, you MUST set runNumber=2 in the file runscript.solve.1 (or you can create a new runscript.solve.2 file for consistency).

You can see the if clause here:

When you were launching the script runscript.solve.1 to generate the precursor data without changing the runNumber, the initializer was overwriting the simulation data created in the first run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants