CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Probes

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 27, 2006, 15:35
Default I have successfully been able
  #1
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
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.
msrinath80 is offline   Reply With Quote

Old   April 28, 2006, 04:22
Default See the 'probes' functionality
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
See the 'probes' functionality in e.g. the oodles solver (createProbes.H). Compile with 'wmake'.
mattijs is offline   Reply With Quote

Old   April 28, 2006, 06:45
Default Thanks for the response. In th
  #3
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
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 is offline   Reply With Quote

Old   April 28, 2006, 06:51
Default Thanks for the response. In th
  #4
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
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 is offline   Reply With Quote

Old   April 28, 2006, 06:55
Default Darn! What a mess. My apologie
  #5
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Darn! What a mess. My apologies for the dual post. If only the server responded faster
msrinath80 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Probes function martinr OpenFOAM Running, Solving & CFD 0 December 29, 2008 12:01
Probes and multiprocessor runs grtabor OpenFOAM Running, Solving & CFD 1 June 12, 2007 13:59
Probes in OpenFOAM14 otsuki OpenFOAM Running, Solving & CFD 2 May 16, 2007 06:18
Probes writing frequency maka OpenFOAM Running, Solving & CFD 7 July 10, 2006 09:54
Dynamic probes Greg Z. FLUENT 1 December 2, 2005 13:05


All times are GMT -4. The time now is 08:49.