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/)
-   -   applyConstraintsAndThermostats (https://www.cfd-online.com/Forums/openfoam-programming-development/81234-applyconstraintsandthermostats.html)

m.maneshi October 20, 2010 12:40

applyConstraintsAndThermostats
 
Dear all
i
in OpenFOAM/OpenFOAM-1.6/src/lagrangian/molecularDynamics/molecule at line 1158 we have the constrains and thermostats, yet i cant figure out if this member function is working or not, here it is the function
HTML Code:

void Foam::moleculeCloud::applyConstraintsAndThermostats
(
    const scalar targetTemperature,
    const scalar measuredTemperature
)
{
    scalar temperatureCorrectionFactor =
        sqrt(targetTemperature/measuredTemperature);

    Info<< "----------------------------------------" << nl
        << "Temperature equilibration" << nl
        << "Target temperature = "
        << targetTemperature << nl
        << "Measured temperature = "
        << measuredTemperature << nl
        << "Temperature correction factor = "
        << temperatureCorrectionFactor << nl
        << "----------------------------------------"
        << endl;

    iterator mol(this->
begin());

    for (mol = this->begin(); mol != this->end(); ++mol)
    {
        mol().v() *= temperatureCorrectionFactor;

        mol().pi() *= temperatureCorrectionFactor;
    }
}

must not the function print the two lines every time it is called ??

Thanks

l_r_mcglashan October 20, 2010 12:46

You mean the Info statements? Are you running it in parallel or in serial?

m.maneshi October 20, 2010 12:50

Yes i exactly mean the Info statement, i tried in both serial and parralel, no diffrence.

l_r_mcglashan October 20, 2010 12:53

It won't be called then.

If you run in parallel, I think Info will only output for the master processor (correct me if wrong)? If you want it to output the results for each processor you have to use Pout instead of Info.

m.maneshi October 20, 2010 12:55

So how can i call it in the molecule.c ?


All times are GMT -4. The time now is 19:55.