Skip to content

Commit

Permalink
modified: miniapps/nurbs_stokes_fsi/nurbs_stokes_fsi.cpp
Browse files Browse the repository at this point in the history
	modified:   miniapps/nurbs_stokes_fsi/nurbs_stokes_fsi_solver.cpp
	new file:   miniapps/nurbs_stokes_fsi/temp_advection.csv
	new file:   miniapps/nurbs_stokes_fsi/temp_diffusion.csv
	new file:   miniapps/nurbs_stokes_fsi/temp_fsi_tfdc0.2_tsdc0.5.csv
	new file:   miniapps/nurbs_stokes_fsi/temp_fsi_tfdc0.5_tsdc0.5.csv
	new file:   miniapps/nurbs_stokes_fsi/temp_fsi_tfdc0.8_tsdc0.5.csv
	new file:   miniapps/nurbs_stokes_fsi/validate_temp_advection.py
	new file:   miniapps/nurbs_stokes_fsi/validate_temp_fsi.py
	new file:   miniapps/nurbs_stokes_fsi/visco.csv
  • Loading branch information
NorbertHofbauer committed Aug 3, 2024
1 parent b78e4d7 commit ee2fc53
Show file tree
Hide file tree
Showing 11 changed files with 4,113 additions and 21 deletions.
1 change: 1 addition & 0 deletions build/.cmake/api/v1/query/client-vscode/query.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]}
24 changes: 14 additions & 10 deletions miniapps/nurbs_stokes_fsi/nurbs_stokes_fsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int main(int argc, char *argv[])
// temp diffusion
//./nurbs_stokes_fsi -mf ../../../MA/data/quad_nurbs.mesh -ms ../../../MA/data/quad_nurbs.mesh -r 3 -vm 0 -mp '1' -vnos '' -vdbc '' -vdbc_values '' -pdbc '' -pdbc_values '' -tfdbc '1 3' -tfdbc_values '100 200' -tsdbc '1 3' -tsdbc_values '100 200' -d 1 -tfdc 0.1 -tsdc 0.5 -tfiface '' -tsiface '' -mi 10000 -mi2 2 -oev 1 -oep 0 -oetf 0 -oets 0 -rel 1 -betaq 0.3 -betat 0.3 -me 1e-8 -at 1e-12 -rt 1e-12 -job test
// temp advection -> temp function hardcoded
//./nurbs_stokes_fsi -mf ../../../MA/data/quad_nurbs.mesh -ms ../../../MA/data/quad_nurbs.mesh -r 3 -vm 0 -mp '1' -vnos '' -vdbc '4 1' -vdbc_values '1 1 1 1' -pdbc '' -pdbc_values '' -tfdbc '1 4' -tfdbc_values '100 200' -tsdbc '1 3' -tsdbc_values '100 200' -d 1 -tfdc 0.1 -tsdc 0.5 -tfiface '' -tsiface '' -mi 10000 -mi2 2 -oev 1 -oep 0 -oetf 0 -oets 0 -rel 1 -betaq 0.3 -betat 0.3 -me 1e-8 -at 1e-12 -rt 1e-12 -job test
//./nurbs_stokes_fsi -mf ../../../MA/data/quad_nurbs.mesh -ms ../../../MA/data/quad_nurbs.mesh -r 3 -vm 0 -mp '1' -vnos '' -vdbc '4' -vdbc_values '1 0' -pdbc '' -pdbc_values '' -tfdbc '4' -tfdbc_values '100' -tsdbc '' -tsdbc_values '' -d 1 -tfdc 0 -tsdc 0.5 -tfiface '' -tsiface '' -mi 10000 -mi2 2 -oev 1 -oep 0 -oetf 0 -oets 0 -rel 1 -betaq 0.3 -betat 0.3 -me 1e-8 -at 1e-12 -rt 1e-12 -job test
// temp coupling
//./nurbs_stokes_fsi -mf ../../../MA/data/validate_2_fluid.mesh -ms ../../../MA/data/validate_2_solid.mesh -r 3 -vm 0 -mp '200' -vnos '' -vdbc '' -vdbc_values '' -pdbc '' -pdbc_values '' -tfdbc '' -tfdbc_values '' -tsdbc '4 6' -tsdbc_values '200 220' -d 1 -tfdc 0.1 -tsdc 0.5 -tfiface '2 4' -tsiface '2 8' -mi 1000 -mi2 2 -oev 2 -oep 1 -oetf 0 -oets 0 -rel 0.5 -betaq 0.3 -betat 0.3 -me 1e-8 -at 1e-7 -rt 1e-8 -job test

Expand Down Expand Up @@ -999,11 +999,13 @@ int main(int argc, char *argv[])

// FSI TEST
// POSTPROCESSING
nop = 20; // number of points - 1
nop = 99; // number of points - 1
y_coor = 0.5; // ycoord for extracting results

// SCALARFIELD ts0 part1
gf_source = new mfem::GridFunction(ts0);
post_vector.clear(); // clear results from before

// SCALARFIELD ts part1
//gf_source = new mfem::GridFunction(ts0);
gf_source = new mfem::GridFunction(ts);
gfc_source = mfem::GridFunctionCoefficient(gf_source);
sdim = gf_source->FESpace()->GetMesh()->SpaceDimension();

Expand Down Expand Up @@ -1046,8 +1048,9 @@ int main(int argc, char *argv[])
post_vector.push_back({phys_points[i][0],phys_points[i][1],source});
}

// SCALARFIELD tf0
gf_source = new mfem::GridFunction(tf0);
// SCALARFIELD tf
//gf_source = new mfem::GridFunction(tf0);
gf_source = new mfem::GridFunction(tf);
gfc_source = mfem::GridFunctionCoefficient(gf_source);
sdim = gf_source->FESpace()->GetMesh()->SpaceDimension();

Expand Down Expand Up @@ -1090,8 +1093,9 @@ int main(int argc, char *argv[])
post_vector.push_back({phys_points[i][0],phys_points[i][1],source});
}

// SCALARFIELD ts0 part2
gf_source = new mfem::GridFunction(ts0);
// SCALARFIELD ts part2
//gf_source = new mfem::GridFunction(ts0);
gf_source = new mfem::GridFunction(ts);
gfc_source = mfem::GridFunctionCoefficient(gf_source);
sdim = gf_source->FESpace()->GetMesh()->SpaceDimension();

Expand Down Expand Up @@ -1138,7 +1142,7 @@ int main(int argc, char *argv[])
//std::ofstream output_file;
output_file.open(filename.c_str(), std::ofstream::out | std::ofstream::trunc);
output_file << "fsi temperature\n";
for (size_t i = ic + 1; i < post_vector.size(); i++)
for (size_t i = 0; i < post_vector.size(); i++)
{
for (size_t ii = 0; ii < post_vector[i].size(); ii++)
{
Expand Down
34 changes: 23 additions & 11 deletions miniapps/nurbs_stokes_fsi/nurbs_stokes_fsi_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,18 @@ bool NurbsStokesSolver::calc_dirichletbc_fluid(mfem::GridFunction &v0, mfem::Gri
return;
};

//auto lambda_inlet2 = [this](const mfem::Vector &QuadraturPointPosition, double &VelocityValue) -> void
auto lambda_inlet2 = [this](const mfem::Vector &QuadraturPointPosition, double &VelocityValue) -> void
/*
//auto lambda_inlet2 = [](const mfem::Vector &x) { return std::sin(M_PI*x[0])*std::sin(2.*M_PI*x[1]); };
auto lambda_inlet2 = [this](const mfem::Vector &QuadraturPointPosition)
{
double h=1;
VelocityValue = 4*(h-QuadraturPointPosition(1))*QuadraturPointPosition(1)/(h*h)*v_max;
//VelocityValue[0] = v_max;
//VelocityValue[1] = 4*(h-QuadraturPointPosition(1))*QuadraturPointPosition(1)/(h*h)*v_max;
//VelocityValue[1] = 0;
//std::cout << " qp(0) = " << QuadraturPointPosition(0) << " qp(1) = " << QuadraturPointPosition(1) << std::endl;
//std::cout << " v(0) = " << VelocityValue(0) << " v(1) = " << VelocityValue(1) << std::endl;
return;
double TemperatureValue;
TemperatureValue = 4*(h-QuadraturPointPosition(1))*QuadraturPointPosition(1)/(h*h)*100;
std::cout << " qp(0) = " << QuadraturPointPosition(0) << " qp(1) = " << QuadraturPointPosition(1) << std::endl;
std::cout << " TemperatureValue = " << TemperatureValue << std::endl;
return TemperatureValue;
};

*/
mfem::GridFunction v_bc(vfes),p_bc(pfes), tf_bc(tffes); // to calculate our gridfunction on the dirichlet boundary

// we need grid functions to first compute the controlpoint values on the boundary, so we can project them on to our system
Expand Down Expand Up @@ -483,7 +482,7 @@ bool NurbsStokesSolver::calc_dirichletbc_fluid(mfem::GridFunction &v0, mfem::Gri
// define rhs with the desired boundary condition values
//mfem::ConstantCoefficient tfc_inlet(temp_1); // function for our desired boundary condition
//mfem::ConstantCoefficient tfc_walls(temp_2); // function for our desired boundary condition
mfem::FunctionCoefficient tfc_inlet(lambda_inlet2); // function for our desired boundary condition
//mfem::FunctionCoefficient tfc_inlet(lambda_inlet2); // function for our desired boundary condition
mfem::LinearForm *h_bc(new mfem::LinearForm(tffes)); // define linear form for rhs
// define bilinear form add the boundary, means the nurbs add the boundary
mfem::BilinearForm d_bc(tffes); // define the bilinear form results in n x n matrix, we use the velocity finite element space
Expand Down Expand Up @@ -714,6 +713,17 @@ bool NurbsStokesSolver::calc_dirichletbc_fluid(mfem::GridFunction &v0, mfem::Gri

bool NurbsStokesSolver::calc_dirichletbc_fluid_cht(mfem::GridFunction &tf0,mfem::GridFunction &ts0)
{
/*
auto lambda_inlet2 = [this](const mfem::Vector &QuadraturPointPosition)
{
double h=1;
double TemperatureValue;
TemperatureValue = 4*(h-QuadraturPointPosition(1))*QuadraturPointPosition(1)/(h*h)*100;
std::cout << " qp(0) = " << QuadraturPointPosition(0) << " qp(1) = " << QuadraturPointPosition(1) << std::endl;
std::cout << " TemperatureValue = " << TemperatureValue << std::endl;
return TemperatureValue;
};
*/
mfem::GridFunction tf_bc(tffes); // to calculate our gridfunction on the dirichlet boundary
// we need grid functions to first compute the controlpoint values on the boundary, so we can project them on to our system
// means we will build a system that needed to be solved for the desired boundary values
Expand Down Expand Up @@ -741,6 +751,7 @@ bool NurbsStokesSolver::calc_dirichletbc_fluid_cht(mfem::GridFunction &tf0,mfem:
// TEMPERATURE
// define rhs with the desired boundary condition values
mfem::ConstantCoefficient One_bc(1); // coefficient for the kinematic viscosity
//mfem::FunctionCoefficient tfc_inlet(lambda_inlet2); // function for our desired boundary condition
mfem::LinearForm *h_bc(new mfem::LinearForm(tffes)); // define linear form for rhs
// define bilinear form add the boundary, means the nurbs add the boundary
mfem::BilinearForm d_bc(tffes); // define the bilinear form results in n x n matrix, we use the velocity finite element space
Expand All @@ -749,6 +760,7 @@ bool NurbsStokesSolver::calc_dirichletbc_fluid_cht(mfem::GridFunction &tf0,mfem:
for (size_t i = 0; i < tfdbc_bdr_marker.size(); i++)
{
h_bc->AddBoundaryIntegrator(new mfem::BoundaryLFIntegrator(tfdbc_bdr_coefficient[i]),tfdbc_bdr_marker[i]); // define integrator on desired boundary
//h_bc->AddBoundaryIntegrator(new mfem::BoundaryLFIntegrator(tfc_inlet),tfdbc_bdr_marker[i]); // define integrator on desired boundary
d_bc.AddBoundaryIntegrator(new mfem::MassIntegrator(One_bc),tfdbc_bdr_marker[i]); // bilinear form (lambda*u_vector),(v_vector))
}
h_bc->Assemble(); // assemble the linear form (vector)
Expand Down
Loading

0 comments on commit ee2fc53

Please sign in to comment.