hystrath / hyStrath

Hypersonic / Rarefied gas dynamics code developments (GPL-3.0)
https://hystrath.github.io/
GNU General Public License v3.0
226 stars 111 forks source link

electrical conductivity models in hy2mdhFoam - Boltzmann #57

Closed iainsymthe closed 3 years ago

iainsymthe commented 4 years ago

When I try to use the Boltzmann model for hy2mhdFoam with the mhdproperties file set as

mhd true;

mhdModel lowReMag;

collisionData constant;

conductivityModel Boltzmann;

//T0 12000;

//n 2;

//sigma0 1;//5100 for Bush

hallEffect true;

I get an error as

Looking for conductivityModel name Selecting conductivityModel Boltzmann Creating Boltzmann conductivity model conductivity model initialised. Getting conductivity values from the model max(nD_e-) [0 -3 0 0 0 0 0] 0 min(nD_e-) [0 -3 0 0 0 0 0] 0 Calculating electron velocity max(ve) [0 1 -1 0 0 0 0] 116793.4692 Calculating Coulomb logarithm Calculating number density of neutrals max(nn) [0 -3 0 0 0 0 0] 3.76634194e+23 [17] [7] [7] [7] --> FOAM FATAL IO ERROR: [7] keyword transportPropertiesFile is undefined in dictionary "IOstream" [7] [7] file: IOstream from line 0 to line 0. [7] [7] From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const [7] in file db/dictionary/dictionary.C at line 551. [7] FOAM parallel run exiting

I tried using the collisionData as "GuptaD1989" as in my transportproperties file but that too gives the same error. Can you provide the mhdproperties file for the Boltzmann option?

vincentcasseau commented 3 years ago

Hi Iain,

Thanks for reporting this bug.

I will wait until the ISRO-dev branch is merged into main (master) before addressing this issue. The source code was cleaned and improved, and the MHD dictionary structure was changed a bit. To answer one of your emails, there is no documentation on MHD as yet.

Regards, Vincent

vincentcasseau commented 3 years ago

Hi Iain,

Please update your local copy of hyStrath.

I looked at what was done in the dev-isro-1 branch (now merged into master) last Summer. I decided to remove the Boltzmann electrical conductivity model because the collision data was hard-coded locally (Alexey had done it years ago before improvements were made on this aspect in hy2Foam in 2019). I will add it back once it will be bug-free (I don't have a timeline).

The available models currently are:

This is what the new mhdProperties dictionary looks like: https://vincentcasseau.github.io/how-tos-cfd-fleming/how-tos-cfd-fleming-mhd/

Thanks, Vincent

iainsymthe commented 3 years ago

Hi Vincent: I tried to update my local copy by running install.sh and choosing option 15 (resyn all modules) The install.sh ran successfully and created logSync files for CFD, DSMC, hybridPICDSMC & MHD I tried to rerun the NASA_MSL_forebody_NR-MHD case but deliberately set the conductivityModel as Bush3 in the mhdProperties file and ran Allrun The case stopped (as expected) and said ...Valid conductivityModel types are : 6(BoltzmannBushChapmanCowlingRaizerSpitzerHarmconstSigma) This is different from the conductivity models listed below and includes the Boltzmann model. Is my resync/updating procedure wrong?Could you please let me know the steps for updating my local copy? Thanks Iain On Thursday, December 24, 2020, 09:45:46 AM CST, Vince notifications@github.com wrote:

Hi Iain,

Please update your local copy of hyStrath.

I looked at what was done in the dev-isro-1 branch (now merged into master) last Summer. I decided to remove the Boltzmann electrical conductivity model because the collision data was hard-coded locally (Alexey had done it years ago before improvements were made on this aspect in hy2Foam in 2019). I will add it back once it will be bug-free (I don't have a timeline).

The available models currently are:

This is what the new mhdProperties dictionary looks like: https://vincentcasseau.github.io/how-tos-cfd-fleming/how-tos-cfd-fleming-mhd/

Thanks, Vincent

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vincentcasseau commented 3 years ago

Hi Iain,

You took the right decision in trying to re-install everything. It works on my laptop. I will have a look at the compilation issue.

Selecting electrical conductivity model Bush3

--> FOAM FATAL ERROR: 
Unknown electricalConductivityModel type Bush3

Valid electricalConductivityModel types are: 

5
(
Bush
ChapmanCowling
Raizer
SpitzerHarm
constantElectricalConductivity
)

    From function electricalConductivityModel::New(const mhdModel&, const fvMesh&)
    in file submodels/electricalConductivityModels/electricalConductivityModel/electricalConductivityModel.C at line 86.
iainsymthe commented 3 years ago

Thanks, Vincent With the complete reinstall the correct options for electrical conductivity are reported when I use "Bush3" as the option.   However, this new version is not "backward compatible".  There are a few strings in the transportProperties files that have changed as listed below.  There may be more - these are the changes I had to make to case that had run with the older version of the code. <     binaryDiffusionModel         collisionData; //New--->     binaryDiffusivityModel         GuptaD;//old

<        diffusionModelParameters //New--->     diffusiveFluxesParameters //old <         collisionDataModel             "Gupta1989D"; //New--->         yearGuptaModel                 "1989";      //old <   tabulatedInteractions  //New--->     neutralNeutralInteractions //old

On Tuesday, December 29, 2020, 03:32:13 PM CST, Vince <notifications@github.com> wrote:  

Hi Iain,

You took the right decision in trying to re-install everything. It works on my laptop. I will have a look at the compilation issue. Selecting electrical conductivity model Bush3

--> FOAM FATAL ERROR: Unknown electricalConductivityModel type Bush3

Valid electricalConductivityModel types are:

5 ( Bush ChapmanCowling Raizer SpitzerHarm constantElectricalConductivity )

From function electricalConductivityModel::New(const mhdModel&, const fvMesh&)
in file submodels/electricalConductivityModels/electricalConductivityModel/electricalConductivityModel.C at line 86.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vincentcasseau commented 3 years ago

Hi Iain,

It is not backward compatible indeed. This is the reason why I was developing it in another branch. The non-backward compatibility started with commit f120fb5 and the command lines you wrote are typed in the description. I created a new release after that as a marker. https://github.com/vincentcasseau/hyStrath/tags

Regards, Vincent

iainsymthe commented 3 years ago

Thanks, Vincent.  I had not checked the github tags link.  Luckily, the FIRE-II example was useful in tracking down the changes to get the old case to run again with the new install. On Wednesday, December 30, 2020, 08:33:08 AM CST, Vince notifications@github.com wrote:

Hi Iain,

It is not backward compatible indeed. This is the reason why I was developing it in another branch. The non-backward compatibility started with commit f120fb5 and the command lines you wrote are typed in the description. I created a new release after that as a marker. https://github.com/vincentcasseau/hyStrath/tags

Regards, Vincent

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

iainsymthe commented 3 years ago

Hi Vincent: The iHat values for various species in the latest version of hystrath (commit 90020f3e9145f9c6e6ce1aca6e0e629c021fdf18) examples is different from the values in the older version (commit 7e6c616a0ae0503a05f49142398989501992a514). I also see that the 4th entry in decoupledCvCoeffs is different in the bluntedCone example and fire-II example the bluntedCone example has decoupledCvCoeffs    ( 1.5 1 1 0 0 0 0 );whereas FireII cases have decoupledCvCoeffs    ( 1.5 1 1 1 0 0 0 );Is there a reason for this? Are thecollisionDataOcollisionDataD options for binaryDiffusionModel the same as the Gupta0, GuptaD options in the older version? I am trying to check the results from a case run with the older version with the latest version, so I was trying to make sure I have all the settings the same. ThanksIain

vincentcasseau commented 3 years ago

Hi Iain,

I will split my answer in several posts.

iHat (first ionization energy of the species, used in the free-electron impact ionization vibro-electronic source term) values in commit 7e6c616 were taken from Scalabrin's PhD, Table A.1: Species Chemistry Data, page 140. After double-checking the input data with Gupta, Yos, and Thompson, NASA-TM-101528 (Feb. 1989), Document ID: 19890011822 A review of reaction rates and thermodynamic and transport properties for the 11-species air model for chemical and thermal nonequilibrium calculations to 30000 K, Table I, Species data, p 32, I realised his input data was incorrectly ordered.

On page 31, Scalabrin wrote: _the terms Ihats are set to be around 1/3 of the first energy of ionization because the vibro-electronic energy removed by this term would otherwise be over-estimated.

So what I did in 90020f3 is to use Gupta, Yos, and Thompson input species data and to multiply their values by 1/3. This is what you can see in the new thermoDEM dictionaries. Please feel free to double-check it if you will.

Thanks for your careful review, Vincent

vincentcasseau commented 3 years ago

Hi Iain,

The bluntedCone example has decoupledCvCoeffs ( 1.5 1 1 0 0 0 0 ); whereas fireII cases have decoupledCvCoeffs ( 1.5 1 1 1 0 0 0 ); Is there a reason for this?

The difference is whether the electronic energy mode is accounted for or not: please see Choosing a thermoDEM dictionary

It is not accounted for in the bluntedCone test case for 2 reasons:

For the fireII cases however, you have to have it in.

I have made this easier with the new Release: all species can be left uncommented in the thermoDEM dictionary and you can copy-paste & rename one of the thermoDEM dictionaries present in the generic hy2Foam test case into your local working directory.

Thanks, Vincent

vincentcasseau commented 3 years ago

Are thecollisionDataOcollisionDataD options for binaryDiffusionModel the same as the Gupta0, GuptaD options in the older version?

Yes, except that there used to be a bug for one of the input coefficients in the tabulated data. This is fixed.

iainsymthe commented 3 years ago

Thanks for the clarifications, Vincent. Can the user use decoupledCvCoeffs ( 1.5 1 1 1 0 0 0 ) as default for all problems, so that if  T<1000, then the electronic energy is not activated and the electronic modes are activated at higher temps? Thanks again for your prompt responses, Iain On Saturday, January 2, 2021, 01:46:22 PM CST, Vince notifications@github.com wrote:

Hi Iain,

The bluntedCone example has decoupledCvCoeffs ( 1.5 1 1 0 0 0 0 ); whereas fireII cases have decoupledCvCoeffs ( 1.5 1 1 1 0 0 0 ); Is there a reason for this?

The difference is whether the electronic energy mode is accounted for or not: please see Choosing a thermoDEM dictionary

It is not accounted for in the bluntedCone test case for 2 reasons:

For the fireII cases however, you have to have it in.

I have made this easier with the new Release: all species can be left uncommented in the thermoDEM dictionary and you can copy-paste & rename one of the thermoDEM dictionaries present in the generic hy2Foam test case into your local working directory.

Thanks, Vincent

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vincentcasseau commented 3 years ago

Of course, you can use thermoDEM_TRVE for any test case.

Reasons not to always use thermoDEM_TRVE:

iainsymthe commented 3 years ago

Thanks, Vincent.  Indeed, setting the electronic modes ON for every case has a computational penalty.  Iain On Saturday, January 2, 2021, 05:06:05 PM CST, Vince notifications@github.com wrote:

Of course, you can use thermoDEM_TRVE for any test case.

Reasons not to always use thermoDEM_TRVE:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.