|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Join Date: Jun 2009
Posts: 22
Rep Power: 17 ![]() |
Hello!
I'm trying to modify the settlingFoam solver so that it can be used within a rotating frame of reference. I have more or less tried to copy what is done in the SRFPimpleFoam solver. However, some additional modifications are necessary also in e.g. the drift velocity definitions and in the calculation of the hydrostatic pressure. And this is where I run into problems (related to my very limited C++ experience). I tried to modify the drift velocity so that it reads: Code:
Vdj = mag(V0)*(SRF->Fcentrifugal())/mag(g)* ( exp(-a*max(alpha - alphaMin, scalar(0))) - exp(-a1*max(alpha - alphaMin, scalar(0))) ); Code:
calcVdj.H:7: error: no match for ?operator*? in ?Foam::operator/(const Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >&, const Foam::dimensioned<double>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::volMesh](((const Foam::dimensioned<double>&)((const Foam::dimensioned<double>*)(& Foam::mag(const Foam::dimensioned<Type>&) [with Type = Foam::Vector<double>]())))) * Foam::operator-(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = double, Type2 = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::exp(const Foam::tmp<Foam::GeometricField<double, PatchField, GeoMesh> >&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]()))))? Code:
)mag(SRF->Fcentrifugal()) BR Olle ![]() |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Join Date: Jun 2009
Posts: 22
Rep Power: 17 ![]() |
Hello again!
Still trying to understand/solve this problem. I think the problem could be related to types being incompatible. The member function returning the centrifugal force is defined in SRFModel.C as a DimensionedField<vector, volMesh>, see below: Code:
Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > Foam::SRF::SRFModel::Fcentrifugal() const { return tmp<DimensionedField<vector, volMesh> > ( new DimensionedField<vector, volMesh> ( IOobject ( "Fcentrifugal", mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), omega_ ^ (omega_ ^ mesh_.C()) ) ); } The DimensionedField can be used as a term in the momentum equations (see e.g. UrelEqn.H in SRFPimpleFoam) but it seems not to be possible to use it in algebraic expressions used to define a volScalarField or volVectorField. If someone with deeper knowledge cold tell me how to resolve this problem I would be very grateful. BR Olle |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 ![]() |
The DimensionedField is only defined over the internal field. A GeometricField is defined over the internal field and the boundary surfaces. It's a little like trying to add a vector and a scalar... one has three values, the other has only one... how do you want me to add them?
So you need to decide what happens on the boundary field. If nothing happens, you can define your algebraic exrpession in terms of the internal field only: Code:
// U is a volVectorField U.dimensionedField() = srfModel.FCentrifugal() / mass * ... etc.
__________________
~~~ Follow me on twitter @DavidGaden |
|
![]() |
![]() |
![]() |
Tags |
pointers, settlingfoam, srf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent- Error: Null Domain Pointer | Mary | FLUENT | 12 | February 28, 2020 10:44 |
FloWorks and CPU usage? | cvp_dk | FloEFD, FloWorks & FloTHERM | 6 | June 20, 2011 08:57 |
OpenFOAM Solver/BC usage description | murrayjc | OpenFOAM | 3 | August 25, 2009 04:48 |
thread pointer comparison crash in Fluent UDF | Miriam | Main CFD Forum | 0 | August 31, 2008 16:40 |
pointer 'p' in UDF | Umesh Shah | FLUENT | 8 | June 20, 2003 08:36 |