void Foam::ThermoCloud<ParcelType>::evolveCloud()
{
    const volScalarField& T = thermo_.thermo().T();
    const volScalarField cp = thermo_.thermo().Cp();

    autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
    (
        this->interpolationSchemes(),
        this->rho()
    );

    autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
    (
        this->interpolationSchemes(),
        this->U()
    );

    autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
    (
        this->interpolationSchemes(),
        this->mu()
    );

    autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
    (
        this->interpolationSchemes(),
        T
    );

    autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
    (
        this->interpolationSchemes(),
        cp
    );

    typename ParcelType::trackData td
    (
        *this,
        constProps_,
        rhoInterp(),
        UInterp(),
        muInterp(),
        TInterp(),
        cpInterp(),
        this->g().value()
    );

    this->surfaceFilm().inject(td);

    this->injection().inject(td);

    if (this->coupled())
    {
        resetSourceTerms();
    }

    Cloud<ParcelType>::move(td);
}
Exemple #2
0
void Foam::solidParticleCloud::move(const dimensionedVector& g)
{
    const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho");
    const volVectorField& U = mesh_.lookupObject<const volVectorField>("U");
    const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu");

    interpolationCellPoint<scalar> rhoInterp(rho);
    interpolationCellPoint<vector> UInterp(U);
    interpolationCellPoint<scalar> nuInterp(nu);

    solidParticle::trackData td(*this, rhoInterp, UInterp, nuInterp, g.value());

    Cloud<solidParticle>::move(td);
}
int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    #include "createFields.H"
    #include "createFvOptions.H"
    #include "initContinuityErrs.H"

    simpleControl simple(mesh);
    
    interpolationCellPoint<vector> UInterp(U);

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

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

    while (simple.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        // --- Pressure-velocity SIMPLE corrector
        {
            #include "UEqn.H"
            #include "UInterp.H"
            #include "pEqn.H"
        }

        turbulence->correct();

        runTime.write();

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

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

    return 0;
}
Exemple #4
0
void Foam::fishParticleCloud::move(const dimensionedVector& g, int check)
{

	// Particle Diameter
	scalar d = 1e-3;
if(check == 1){
	// Injector 1
	vector pos1 = vector(-0.5,0.1,0.05);
	//Set initial velocity vector
	vector vel1=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell1=mesh_.findCell(pos1);
	if(cell1>=0) {
	fishParticle* ptr= new fishParticle(*this,pos1,cell1,d,vel1);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 2
	vector pos2 = vector(-0.5,0.08,0.05);
	//Set initial velocity vector
	vector vel2=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell2=mesh_.findCell(pos2);
	if(cell2>=0) {
	fishParticle* ptr= new fishParticle(*this,pos2,cell2,d,vel2);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 3
	vector pos3 = vector(-0.5,0.06,0.05);
	//Set initial velocity vector
	vector vel3=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell3=mesh_.findCell(pos3);
	if(cell3>=0) {
	fishParticle* ptr= new fishParticle(*this,pos3,cell3,d,vel3);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 4
	vector pos4 = vector(-0.5,0.04,0.05);
	//Set initial velocity vector
	vector vel4=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell4=mesh_.findCell(pos4);
	if(cell4>=0) {
	fishParticle* ptr= new fishParticle(*this,pos4,cell4,d,vel4);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 5
	vector pos5 = vector(-0.5,0.02,0.05);
	//Set initial velocity vector
	vector vel5=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell5=mesh_.findCell(pos5);
	if(cell5>=0) {
	fishParticle* ptr= new fishParticle(*this,pos5,cell5,d,vel5);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 6
	vector pos6 = vector(-0.5,0,0.05);
	//Set initial velocity vector
	vector vel6=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell6=mesh_.findCell(pos6);
	if(cell6>=0) {
	fishParticle* ptr= new fishParticle(*this,pos6,cell6,d,vel6);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 7
	vector pos7 = vector(-0.5,-0.02,0.05);
	//Set initial velocity vector
	vector vel7=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell7=mesh_.findCell(pos7);
	if(cell7>=0) {
	fishParticle* ptr= new fishParticle(*this,pos7,cell7,d,vel7);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 7
	vector pos8 = vector(-0.5,-0.04,0.05);
	//Set initial velocity vector
	vector vel8=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell8=mesh_.findCell(pos8);
	if(cell8>=0) {
	fishParticle* ptr= new fishParticle(*this,pos8,cell8,d,vel8);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 8
	vector pos9 = vector(-0.5,-0.06,0.05);
	//Set initial velocity vector
	vector vel9=vector(1,0,0);

	// Find cell at specified injection position and add particle here
	label cell9=mesh_.findCell(pos9);
	if(cell9>=0) {
	fishParticle* ptr= new fishParticle(*this,pos9,cell9,d,vel9);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 9
	vector pos10 = vector(-0.5,-0.08,0.05);
	//Set initial velocity vector
	vector vel10=vector(1,0,0);
	// Find cell at specified injection position and add particle here
	label cell10=mesh_.findCell(pos10);
	if(cell10>=0) {
	fishParticle* ptr= new fishParticle(*this,pos10,cell10,d,vel10);
	Cloud<fishParticle>::addParticle(ptr);
	}

	// Injector 11
	vector pos11 = vector(-0.5,-0.1,0.05);
	//Set initial velocity vector
	vector vel11=vector(1,0,0);
	// Find cell at specified injection position and add particle here
	label cell11=mesh_.findCell(pos11);
	if(cell11>=0) {
	fishParticle* ptr= new fishParticle(*this,pos11,cell11,d,vel11);
	Cloud<fishParticle>::addParticle(ptr);
	}
}


    const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho");
    const volVectorField& U = mesh_.lookupObject<const volVectorField>("U");
    const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu");

    interpolationCellPoint<scalar> rhoInterp(rho);
    interpolationCellPoint<vector> UInterp(U);
    interpolationCellPoint<scalar> nuInterp(nu);

    fishParticle::trackData td(*this, rhoInterp, UInterp, nuInterp, g.value());

    Cloud<fishParticle>::move(td);
}