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/)
-   -   Customized Sutherland transport (https://www.cfd-online.com/Forums/openfoam-programming-development/165929-customized-sutherland-transport.html)

francesco_capuano January 29, 2016 12:16

Customized Sutherland transport
 
Dear all,
I am trying to customize the equation used to calculate the thermal conductivity when employing the Sutherland model. Apparently, OpenFOAM adopts the so-called modified Euken model, that is implemented in line 149 of (version 2.4):
thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H

Code:

template<class Thermo>
inline Foam::scalar Foam::sutherlandTransport<Thermo>::kappa
(
    const scalar p, const scalar T
) const
{
    scalar Cv_ = this->Cv(p, T);
    return mu(p, T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
}

However, any modifications of these lines do not seem to have any effect on the results. I am compiling the modified library by executing wmake in the Sutherland directory, and I am checking the kappa field by adding the following lines to createFields.H in my solver:

Code:

volScalarField kappa = thermo.kappa();
kappa.write();

The field of kappa remains unchanged to any modification in the formula.

What's wrong with this?

Thanks in advance for any suggestions.

marupio January 29, 2016 16:59

Are you sure the code you are editing is the code that is compiling, and are you sure the code that is compiling is the code you are linking to / running?

You could insert an obvious line in there:

Info << "Test line!" << endl;

If you don't see that get posted to the console, then you know you are not editing what you are running.

Sometimes old binaries have a habit of kicking around and messing things up. Try:

$ which nameOfApplicationYouAreRunning
e.g. $which blockMesh

Then:
ls -al outputOfLastCommand

This will tell you when your executable was modified last. Also, search for the .so that you are linking to. libspecie.so... I think. Check the date on that one. Check for multiples.

Another question, you are modifying the specie library, and then you are testing by calling the thermo object's kappa. The specie library returns only a single cell value. Thermo's kappa returns a full field. When does it do a forAll(cells) and update the kappa? Are you testing when it hasn't updated yet?

francesco_capuano February 1, 2016 13:06

Dear David, thanks for your suggestion.

I had already tried your hints. It's weird. The libspecie.so library appears as modified, but debugging messages are not displayed. I'm not sure whether the application is actually calling the specie's kappa function or not...


All times are GMT -4. The time now is 13:22.