CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Probes (http://www.cfd-online.com/Forums/openfoam-pre-processing/62201-probes.html)

msrinath80 April 27, 2006 15:35

I have successfully been able
 
I have successfully been able to run a 2D case for flow past an obstacled in a channel. I now wish to extract the frequency of vortex shedding for which I wish to create a monitor point for Y-velocity (my flow is in the X-direction) on the channel centerline. Can someone help me with the procedure for doing this?

I would appreciate if you could also include the steps for any code compilation (if necessary).

Thanks very much for taking time to read my post.

mattijs April 28, 2006 04:22

See the 'probes' functionality
 
See the 'probes' functionality in e.g. the oodles solver (createProbes.H). Compile with 'wmake'.

msrinath80 April 28, 2006 06:45

Thanks for the response. In th
 
Thanks for the response. In the ~/OpenFOAM/OpenFOAM-1.3/applications/solvers/DNSandLES/oodles directory, I find the following files with the following contents:

***************
createProbes.H
***************

Info<< "Reading probeLocations\n" << endl;

IOdictionary probeLocations
(
IOobject
(
"probeLocations",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


Info<< "Constructing probes\n" << endl;

Probe<volvectorfield> UProbe(probeLocations, U);
Probe<volscalarfield> pProbe(probeLocations, p);


**************
writeProbes.H
**************

UProbe.write();
pProbe.write();


*********
oodles.C
*********
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/transportModel/transportModel.H"
#include "incompressible/LESmodel/LESmodel.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Random.H"
#include "Probe.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{

# include "setRootCase.H"
# include "createTime.H"
# include "createMeshNoClear.H"
# include "readTransportProperties.H"
# include "createFields.H"
# include "createAverages.H"
# include "createProbes.H"
# include "initContinuityErrs.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nStarting time loop\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readPISOControls.H"
# include "CourantNo.H"

sgsModel->correct();

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ sgsModel->divB(U)
);

if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}


// --- PISO loop

(p4 of 5)
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

adjustPhi(phi, U, p);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

# include "continuityErrs.H"

(p5 of 5)
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}


# include "calculateAverages.H"

runTime.write();

# include "writeNaveragingSteps.H"

# include "writeProbes.H"

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);
}


// ************************************************** *********************** //


I would really appreciate if someone could quickly point out what needs to be changed and where. Also, I'm terrible in C++, so a more detailed explanation is always welcome!

And sorry for pasting all this code. I know this isn't right, but I really need to get this probe working. Any help is gratefully appreciated!

msrinath80 April 28, 2006 06:51

Thanks for the response. In th
 
Thanks for the response. In the ~/OpenFOAM/OpenFOAM-1.3/applications/solvers/DNSandLES/oodles directory, I find the following files with the following contents:

***************
createProbes.H
***************

Info<< "Reading probeLocations\n" << endl;

IOdictionary probeLocations
(
IOobject
(
"probeLocations",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


Info<< "Constructing probes\n" << endl;

Probe<volvectorfield> UProbe(probeLocations, U);
Probe<volscalarfield> pProbe(probeLocations, p);


**************
writeProbes.H
**************

UProbe.write();
pProbe.write();


*********
oodles.C
*********
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/transportModel/transportModel.H"
#include "incompressible/LESmodel/LESmodel.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Random.H"
#include "Probe.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{

# include "setRootCase.H"
# include "createTime.H"
# include "createMeshNoClear.H"
# include "readTransportProperties.H"
# include "createFields.H"
# include "createAverages.H"
# include "createProbes.H"
# include "initContinuityErrs.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nStarting time loop\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readPISOControls.H"
# include "CourantNo.H"

sgsModel->correct();

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ sgsModel->divB(U)
);

if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}


// --- PISO loop

(p4 of 5)
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

adjustPhi(phi, U, p);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

# include "continuityErrs.H"

(p5 of 5)
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}


# include "calculateAverages.H"

runTime.write();

# include "writeNaveragingSteps.H"

# include "writeProbes.H"

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);
}


// ************************************************** *********************** //


I would really appreciate if someone could quickly point out what needs to be changed and where. Also, I'm terrible in C++, so a more detailed explanation is always welcome!

And sorry for pasting all this code. I know this isn't right, but I really need to get this probe working. Any help is gratefully appreciated!

msrinath80 April 28, 2006 06:55

Darn! What a mess. My apologie
 
Darn! What a mess. My apologies for the dual post. If only the server responded faster http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif


All times are GMT -4. The time now is 00:59.