CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

write nut fields in simpleFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2009, 15:29
Default write nut fields in simpleFoam
  #1
New Member
 
Qi Ying
Join Date: Mar 2009
Posts: 6
Rep Power: 17
maurice is on a distinguished road
Hi All,
Sorry if this question sounds stupid but how can I write out the nut field from simpleFoam? I copied the simpleFoam code to my application directory and then add the following in createFields:

Info << "Creating nut" << endl;
volScalarField nut
(
IOobject
(
"nut",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
turbulence().nut()()
);

It compiles and runs ok but it seems that the output field is uniform and does not chage as iterations go on...

Any suggestions?

Q.
maurice is offline   Reply With Quote

Old   March 22, 2009, 21:41
Default
  #2
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 21
Rep Power: 17
jurich is on a distinguished road
Hello Qi,

You need to add a line into simpleFoam.c:

nut=turbulence->nut();

Your code in createFields.H creates nut as a volScalarField and initializes it with the starting values for turbulent viscosity. The line above is what's necessary to update it during each iteration.

Regards,

J. Urich
jurich is offline   Reply With Quote

Old   March 22, 2009, 22:26
Default
  #3
New Member
 
Qi Ying
Join Date: Mar 2009
Posts: 6
Rep Power: 17
maurice is on a distinguished road
Hi jruich,
Thanks a lot. Works now.
Qi
maurice is offline   Reply With Quote

Old   March 22, 2009, 22:36
Default
  #4
New Member
 
Cynthia Poon
Join Date: Mar 2009
Posts: 4
Rep Power: 17
Cynthia Poon is on a distinguished road
Hi all,

I am making a boundary conditon using FvPatchFields, I need to correct the U boundary using another field like nut. I use the normal code find from this forum to get nut in the fvpatchfields, but it fails to run saying that no nut field is detected.

Therefore, I use the same way as the above (creating and copying the nut field in my own solver) by using also this:
kco == turbulence->nut();
This time, the fvPatchField class can detect nut.

The solver together with the boundary condition run successfully, but I cannot use the decomposePar and paraFoam since then, the following is the error message that I got:

[cynthia@atmospheric-turbulence cavity_upbound]$ paraFoam


request for volScalarField kco from objectRegistry region0 failed
available objects of type volScalarField are
0
(
)
#0 Foam::error:rintStack(Foam::Ostream&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::Ostream& Foam:perator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#3 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const& Foam:bjectRegistry::lookupObject<Foam::Geometric Field<double, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const in "/home/cynthia/OpenFOAM/cynthia-1.5/lib/linux64GccDPOpt/libbccondtion.so"
#4 Foam::wallSlipFvPatchVectorField::evaluate(Foam::P stream::commsTypes) in "/home/cynthia/OpenFOAM/cynthia-1.5/lib/linux64GccDPOpt/libbccondtion.so"
#5 Foam::wallSlipFvPatchVectorField::wallSlipFvPatchV ectorField(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/cynthia/OpenFOAM/cynthia-1.5/lib/linux64GccDPOpt/libbccondtion.so"
#6 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::wallSlipF vPatchVectorField>::New(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/cynthia/OpenFOAM/cynthia-1.5/lib/linux64GccDPOpt/libbccondtion.so"
#7 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#8 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricB oundaryField(Foam::fvBoundaryMesh const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#10 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"
#11 void Foam::vtkPV3Foam::convertVolFields<Foam::Vector<do uble> >(Foam::fvMesh const&, Foam::volPointInterpolation const&, Foam::IOobjectList const&, vtkDataArraySelection*, vtkMultiBlockDataSet*) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libvtkPV3Foam.so"
#12 Foam::vtkPV3Foam::updateVolFields(vtkMultiBlockDat aSet*) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libvtkPV3Foam.so"
#13 Foam::vtkPV3Foam::Update(vtkMultiBlockDataSet*) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libvtkPV3Foam.so"
#14 vtkPV3FoamReader::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libPV3FoamReader_SM.so"
#15 vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#16 vtkDemandDrivenPipeline::ExecuteData(vtkInformatio n*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#17 vtkCompositeDataPipeline::ExecuteData(vtkInformati on*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#18 vtkDemandDrivenPipeline::ProcessRequest(vtkInforma tion*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#19 vtkStreamingDemandDrivenPipeline::ProcessRequest(v tkInformation*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#20 vtkCompositeDataPipeline::ProcessRequest(vtkInform ation*, vtkInformationVector**, vtkInformationVector*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#21 vtkDemandDrivenPipeline::UpdateData(int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#22 vtkStreamingDemandDrivenPipeline::Update(int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFiltering.so.pv3.3"
#23 vtkAlgorithmCommand(vtkClientServerInterpreter*, vtkObjectBase*, char const*, vtkClientServerStream const&, vtkClientServerStream&) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFilteringCS.so"
#24 vtkMultiBlockDataSetAlgorithmCommand(vtkClientServ erInterpreter*, vtkObjectBase*, char const*, vtkClientServerStream const&, vtkClientServerStream&) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkFilteringCS.so"
#25 vtkPV3FoamReaderCommand(vtkClientServerInterpreter *, vtkObjectBase*, char const*, vtkClientServerStream const&, vtkClientServerStream&) in "/home/cynthia/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libPV3FoamReader_SM.so"
#26 vtkClientServerInterpreter::ProcessCommandInvoke(v tkClientServerStream const&, int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkClientServer.so"
#27 vtkClientServerInterpreter::ProcessOneMessage(vtkC lientServerStream const&, int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkClientServer.so"
#28 vtkClientServerInterpreter::ProcessStream(vtkClien tServerStream const&) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkClientServer.so"
#29 vtkSelfConnection::ProcessStreamLocally(vtkClientS erverStream&) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#30 vtkProcessModuleConnection::SendStream(unsigned int, vtkClientServerStream&) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#31 vtkProcessModuleConnectionManager::SendStream(long long, unsigned int, vtkClientServerStream&, int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#32 vtkProcessModule::SendStream(long long, unsigned int, vtkClientServerStream&, int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#33 vtkSMOutputPort::UpdatePipeline(double) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerManager.so"
#34 vtkSMSourceProxy::UpdatePipeline(double) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerManager.so"
#35 pqOutputPort::getDataInformation(bool) const in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#36 pqDisplayPolicy::getPreferredViewType(pqOutputPort *, bool) const in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#37 pqDisplayPolicy::getPreferredView(pqOutputPort*, pqView*) const in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#38 pqDisplayPolicy::createPreferredRepresentation(pqO utputPort*, pqView*, bool) const in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#39 pqPendingDisplayManager::createPendingDisplays(pqV iew*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#40 pqMainWindowCore::qt_metacall(QMetaObject::Call, int, void**) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqComponents.so"
#41 QMetaObject::activate(QObject*, int, int, void**) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#42 pqObjectInspectorWidget::accept() in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqComponents.so"
#43 pqObjectInspectorWidget::qt_metacall(QMetaObject:: Call, int, void**) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqComponents.so"
#44 QMetaObject::activate(QObject*, int, int, void**) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#45 QAbstractButton::clicked(bool) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#46 ?? in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#47 ?? in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#48 QAbstractButton::mouseReleaseEvent(QMouseEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#49 QWidget::event(QEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#50 QApplicationPrivate::notify_helper(QObject*, QEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#51 QApplication::notify(QObject*, QEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#52 QCoreApplication::notifyInternal(QObject*, QEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#53 ?? in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#54 QApplication::x11ProcessEvent(_XEvent*) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#55 ?? in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#56 g_main_context_dispatch in "/lib64/libglib-2.0.so.0"
#57 g_main_context_prepare in "/lib64/libglib-2.0.so.0"
#58 g_main_context_iteration in "/lib64/libglib-2.0.so.0"
#59 QEventDispatcherGlib:rocessEvents(QFlags<QEventL oop::ProcessEventsFlag>) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#60 ?? in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtGui.so.4"
#61 QEventLoop:rocessEvents(QFlags<QEventLoop::Proce ssEventsFlag>) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#62 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsF lag>) in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#63 QCoreApplication::exec() in "/usr/local/Trolltech/Qt-4.3.5/lib/libQtCore.so.4"
#64 pqProcessModuleGUIHelper::RunGUIStart(int, char**, int, int) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#65 vtkProcessModule::StartClient(int, char**) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#66 vtkProcessModule::Start(int, char**) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#67 vtkProcessModuleGUIHelper::Run(vtkPVOptions*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libvtkPVServerCommon.so"
#68 pqMain::Run(QApplication&, pqProcessModuleGUIHelper*) in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/libpqCore.so"
#69 main in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/paraview"
#70 __libc_start_main in "/lib64/libc.so.6"
#71 _start in "/home/cynthia/OpenFOAM/ThirdParty/ParaView3.3-cvs/platforms/linux64Gcc/bin/paraview"

From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/cynthia/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 142.
FOAM aborting
/home/cynthia/OpenFOAM/OpenFOAM-1.5/bin/paraFoam: line 83: 16607 Aborted paraview --data=$caseFile

I am sorry if my message is too long, but I really don't get an idea why I got the above error message.

Can anybody offer me some help?

Regards,
Cynthia
Cynthia Poon is offline   Reply With Quote

Old   March 23, 2009, 00:19
Default
  #5
New Member
 
Qi Ying
Join Date: Mar 2009
Posts: 6
Rep Power: 17
maurice is on a distinguished road
Hi Cynthia,
Have you tried to convert to VTK and run paraview directly?
Qi
maurice is offline   Reply With Quote

Old   March 23, 2009, 02:57
Default
  #6
New Member
 
Cynthia Poon
Join Date: Mar 2009
Posts: 4
Rep Power: 17
Cynthia Poon is on a distinguished road
Hi Qi and all,

I have try foamToVTK, but the same error message appeared. It cannot detect the user-defined kco field. May I ask where do you define your field? in createField.H and after where turbulence pointer is defined?

Thanks.
Regards,
Cynthia
Cynthia Poon is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
incompatible fields for operationproblem in simpleFoam kbr OpenFOAM Running, Solving & CFD 3 March 10, 2009 11:25
Error running simpleFoam in parallel skabilan OpenFOAM Running, Solving & CFD 2 August 29, 2008 10:42
TurbFoam simpleFoam incompatible fields for operation braennstroem OpenFOAM Running, Solving & CFD 0 June 19, 2008 11:43
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37
Differences between simpleFoam an turbFoam francois OpenFOAM Running, Solving & CFD 3 November 15, 2005 15:03


All times are GMT -4. The time now is 12:26.