|
[Sponsors] |
setup new filed in createFileds.H in pisoFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 2, 2013, 11:23 |
setup new filed in createFileds.H file using pisoFoam solver
|
#1 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Hi all.
I have just used openfoam. I has LES model and it runs good. And now, I would like to calculate some terms in LES as first term1 = nu{p*[d2(ui/xi)]} and second term2 = p*[d((ui uj)/xj)]. After that, get average term1 - average term2. d2 is second derivative and d is first derivative. HTML Code:
volScalarField term1 ( IOobject ( "term1", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*fvc::laplacian(U) ); volVectorField term2 ( IOobject ( "term2", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*fvc::grad(phi,U) ); HTML Code:
/opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:209:1: note: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensionSet&, const Foam::word&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam::fvMesh] /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.C:209:1: note: candidate expects 4 arguments, 2 provided /opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] /opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] make: *** [Make/linux64GccDPOpt/mypisoFoam.o] Error 1 Thanks. Last edited by hiuluom; October 3, 2013 at 03:21. |
|
October 3, 2013, 03:59 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
For term 1, you write ui/xi. This would be the divergence of u, not the laplacian. The laplacian of a vector is a vector, while you store it as a scalar. Is this line 209, that gives you the error message?
|
|
October 3, 2013, 09:17 |
|
#3 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Sorry, i think I had mistake description filed. The term1 is really second derivative of velocity Ui as [d(ui^2)/d(xj^2)] and other term2 is first derivative of uiuj as [d(uiuj)/dxj)].
I fixed code the term1 is ok but term2 I think It is still error. HTML Code:
Info<< "Reading/calculating laplacian of velocity \n" << endl; volVectorField plapU ( IOobject ( "plapU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*fvc::laplacian(U) ); Info<< "Reading/calculating divergence of velocity \n" << endl; volVectorField pdivU ( IOobject ( "pdivU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*fvc::div(U,U) ); |
|
October 3, 2013, 09:32 |
|
#4 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Which line is giving you the error message? I'd rather not guess.
|
|
October 3, 2013, 09:35 |
|
#5 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Sorry Bernhard, this is error in terminal. I don't know the line caution error. I only see 68:21 caution error.
HTML Code:
Making dependency list for source file mypisoFoam.C SOURCE=mypisoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mypisoFoam.o In file included from mypisoFoam.C:46:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:68:21: error: no matching function for call to ‘div(Foam::volVectorField&, Foam::volVectorField&)’ createFields.H:68:21: note: candidates are: /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:46:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:64:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:83:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::innerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:104:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::innerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:127:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::innerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:144:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::innerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:158:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:176:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:194:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const surfaceScalarField&, const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:212:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::word&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:231:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:246:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:263:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const surfaceScalarField&, const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&) /opt/openfoam211/src/finiteVolume/lnInclude/fvcDiv.C:280:1: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&) /opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] /opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] make: *** [Make/linux64GccDPOpt/mypisoFoam.o] Error 1 Best regard, Thanh Last edited by hiuluom; October 3, 2013 at 13:23. |
|
October 4, 2013, 01:47 |
|
#6 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Hi Foamer
I need DU/Dt values for all grids. How can i calculate and write this parameter. Any suggestion will be appreciated. Best regards. Thanh |
|
October 4, 2013, 02:05 |
|
#7 | |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Quote:
|
||
October 4, 2013, 03:13 |
|
#8 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Thank your reply.
I sorry about my presentation and English. My English only immediate. Really I would like to find derivative of velocity mention above. The first example I setup derivative is error. So the second example I changed otherwise but it still error. My example is pitzdaily use LES dynOneEqEddy and pisoFoam solver. Code:
Info<< "Reading/calculating laplacian of velocity \n" << endl; volVectorField plapU ( IOobject ( "plapU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*(fvc::laplacian(U)) ); /*Info<< "Reading/calculating divergence of velocity \n" << endl; volVectorField pdivU ( IOobject ( "pdivU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*(U&fvc::grad(U)) );*/ Info<< "Reading/calculating divergence of velocity \n" << endl; volVectorField pdivU ( IOobject ( "pdivU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), p*fvc::div(U*U) ); Last edited by hiuluom; October 5, 2013 at 12:45. |
|
October 5, 2013, 22:19 |
|
#9 |
Senior Member
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 105
Rep Power: 12 |
Hi anybody can help me my new field div(u,u) in createField.H.
regards, Thanh. Last edited by hiuluom; October 7, 2013 at 23:19. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Differences in solution method for pisoFoam and buoyantBoussinesqPisoFoam | mchurchf | OpenFOAM | 7 | August 6, 2023 09:12 |
Taylor Couette Setup and Boundary Conditions | DaSh | OpenFOAM Pre-Processing | 2 | September 28, 2017 12:02 |
[ICEM] Hexa mesh, curve mesh setup, bunching law | Anorky | ANSYS Meshing & Geometry | 4 | November 12, 2014 00:27 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 17:18 |
setup vof test problem | Fang Jin | FLUENT | 1 | June 14, 2005 08:27 |