CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Creating a rhoCentralFoam with a minimum Energy (https://www.cfd-online.com/Forums/openfoam-programming-development/215329-creating-rhocentralfoam-minimum-energy.html)

c_underwood March 1, 2019 09:42

Creating a rhoCentralFoam with a minimum Energy
 
I am trying to create a new solver which is effectively rhoCentralFoam, but with a way of giving a min energy to the simulation.
The reason I want to do this is because I am trying to simulate a Gas Nozzle and the temperature keeps dropping below 0K, which causes a crash.

I found on here:
https://www.cfd-online.com/Forums/op...ntralfoam.html
where changing line 218 in openfoam6 from:
e = rhoE/rho - 0.5*magSqr(U);
to
e = max(rhoE/rho - 0.5*magSqr(U),minE);

I now want to be able to add minE to the control dict, and then I will be able to enter my value in there. However, I can't work out how the control dict is read in, and whether I can make a modification for just my new solver?

If someone could point me in the right direction for adding this minE term and reading it into my new solver that would be great.

raumpolizei March 1, 2019 10:01

Hello c_underwood,

it is strange that your temperature goes below 0 K, are you getting negative energies or something alike in your domain? I don't think it's a too good idea to bind the energy or temperature in such a manner. Nonetheless, regarding your issue, you could do something like this (assuming thermo is a reference to your thermodynamics object in your simulation):
Code:

// In your createFields.H - of1612
dimensionedScalar minEnergy(static_cast<dictionary>(thermo).lookup("eMin"));

the entry eMin will have to be specified in your case/constant/thermodynamicProperties file, which is in my opinion better than the controlDict.

permianchain March 29, 2022 03:49

Mining Digital Energy Currency
 
PermianChain Technologies Inc. is operating the world’s first Blockchain-as-a-Service (BaaS) platform for natural resources, enhancing transparency, efficiency and profitability for our stakeholders. We discover the effective ways to harness the blockchain’s potential, using data science and AI to digitise, tokenize and capitalise on proven but undeveloped natural resources. If you’d like to hear more about how PermianChain is enhancing oil and gas trading and investment, join our mailing list today.


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